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.
ApiKeyAuthAuthorizationBearer <API Key>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.
application/json- body
name*stringInternal name for the template.
description?stringOptional internal note. Not sent to recipients.
subject*stringbody*stringHTML body. Use {{variable}} placeholders to interpolate contact data at send time.
from*stringSender address. Must belong to a domain verified for this project.
emailfromName?stringSender display name.
replyTo?stringemailtype?stringOptional. Defaults to MARKETING when omitted.
"MARKETING""TRANSACTIONAL""MARKETING""HEADLESS"Template created
application/json- response
id?stringname?stringdescription?stringsubject?stringbody?stringHTML content with {{variable}} placeholders.
from?stringSender address. Must belong to a verified domain.
emailfromName?stringreplyTo?stringemailtype?string"TRANSACTIONAL""MARKETING""HEADLESS"projectId?stringcreatedAt?stringdate-timeupdatedAt?stringdate-timecurl -X POST 'https://api.send.47signals.com/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"}