Templates

Create a new template

Changed on

Creates a new message template with header, body, footer, and buttons. The template can be submitted for review immediately or saved as draft for later submission. There is no name field on create — the display name is derived from the template's content and can be changed afterwards with PUT /v3/templates/{id}.

post/v3/templates

Request

  • Base URL
    https://api.sent.dm
  • URL
    https://api.sent.dm/v3/templates
  • Auth
    • API key in header x-api-key
    • or HTTP bearer

Headers

Idempotency-Keystring

Unique key to ensure idempotent request processing. Must be 1-255 alphanumeric characters, hyphens, or underscores. Responses are cached for 24 hours per key per customer.

x-profile-idstring uuid

Profile UUID to scope the request to a child profile. Only organization API keys can use this header. The profile must belong to the calling organization.

Request body

sandboxboolean

Sandbox flag - when true, the operation is simulated without side effects Useful for testing integrations without actual execution

categorystring nullable

Template category: MARKETING, UTILITY, AUTHENTICATION (optional, auto-detected if not provided)

languagestring nullable

Template language code (e.g., en_US) (optional, auto-detected if not provided)

creation_sourcestring nullable

Source of template creation (default: from-api)

auto_create_for_spboolean

Create this template automatically on every sender profile of the organization, now and in future (default: false). Accepted only from an organization that has been enabled for it, and only at creation — it cannot be changed afterwards.

submit_for_reviewboolean

Whether to submit the template for review after creation (default: false)

Example request

{
  "category": "MARKETING",
  "language": "en_US",
  "definition": {
    "body": {
      "multiChannel": {
        "type": "text",
        "template": "Hello {{0:variable}}! Welcome to {{1:variable}}. We are glad to have you on board.",
        "variables": [
          {
            "id": 0,
            "name": "name",
            "type": "variable",
            "props": {
              "variableType": "text",
              "sample": "John"
            }
          },
          {
            "id": 1,
            "name": "company",
            "type": "variable",
            "props": {
              "variableType": "text",
              "sample": "SentDM"
            }
          }
        ]
      }
    },
    "definitionVersion": "1.0"
  },
  "auto_create_for_sp": false,
  "submit_for_review": false,
  "sandbox": false
}

Response

Template created successfully

successboolean

Indicates whether the request was successful

Changes

    • breaking

      added subschema #2: SentDmServicesEndpointsCustomerAPIv3TemplatesRequestsCreateTemplateRequest_Properties to the request body allOf list

    • breaking

      added to the response property oneOf list for the response status

    • breaking

      added to the response property oneOf list for the response status

    • breaking

      added to the response property oneOf list for the response status

    • warning

      removed subschema #2: SentDmServicesEndpointsCustomerAPIv3RequestsCreateTemplateRequest_Properties from the request body allOf list

    • info

      the endpoint scheme security BearerAuth was added to the API

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      added to the response property allOf list for the response status

    • info

      removed from the response property allOf list for the response status

    • info

      removed from the response property allOf list for the response status

    • info

      removed from the response property allOf list for the response status

    • info

      removed from the response property allOf list for the response status

    • info

      removed from the response property oneOf list for the response status

    • info

      removed from the response property oneOf list for the response status

    • info

      removed from the response property oneOf list for the response status