PlunkPlunk
API ReferenceTemplates

Create template

Create a new email template.

from is required and its domain must already be verified for this project, otherwise the request is rejected.

POST
/templates

Authorization

ApiKeyAuth

AuthorizationBearer <token>

API Key authentication. The project is automatically derived from the key.

/v1/track requires a public key (pk_*) — it is the one endpoint intended for client-side use, and a secret key is rejected there with 401.

Every other endpoint requires a secret key (sk_*) and rejects public keys with 401.

So the two key types are not interchangeable in either direction: pick the key that matches the endpoint you are calling.

In: header

Request Body

application/json

name*string

Internal name for the template.

description?string

Optional internal note. Not sent to recipients.

subject*string
body*string

HTML body. Use {{variable}} placeholders to interpolate contact data at send time.

from*string

Sender address. Must belong to a domain verified for this project.

Formatemail
fromName?string

Sender display name.

replyTo?string
Formatemail
type?string

Optional. Defaults to MARKETING when omitted.

Default"MARKETING"
Value in"TRANSACTIONAL" | "MARKETING" | "HEADLESS"

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.plunk.jimster.dev/templates" \  -H "Content-Type: application/json" \  -d '{    "name": "Password reset",    "subject": "Reset your password",    "body": "<h1>Hi {{firstName}}</h1><p>Use this code: {{resetCode}}</p>",    "from": "hello@example.com",    "fromName": "My App",    "type": "TRANSACTIONAL"  }'
{
  "id": "string",
  "name": "string",
  "description": "string",
  "subject": "string",
  "body": "string",
  "from": "user@example.com",
  "fromName": "string",
  "replyTo": "user@example.com",
  "type": "TRANSACTIONAL",
  "projectId": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "error": "From address is required"
}
{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid secret API key. This endpoint requires a secret key (sk_*), not a public key.",
    "statusCode": 401,
    "requestId": "8f14e45f-ceea-467a-9575-1f0f38e0b1c2"
  },
  "timestamp": "2025-01-15T10:30:00.000Z"
}
{
  "success": false,
  "error": {
    "code": "INTERNAL_SERVER_ERROR",
    "message": "Domain \"example.com\" is not verified. Please complete the DNS verification process in your domain settings.",
    "statusCode": 403,
    "requestId": "8f14e45f-ceea-467a-9575-1f0f38e0b1c2"
  },
  "timestamp": "2025-01-15T10:30:00.000Z"
}