SendSMSby ZEXTELDocumentation
EN
Cabinet
Open MarkdownOpen in ChatGPTOpen in Claude
⋯ Page actions
Open MarkdownOpen in ChatGPTOpen in ClaudeOpen in CursorOpen in PerplexityOpen in Gemini (question is copied)Open in Microsoft CopilotOpen in IBM Bob (question is copied)

Templates

Update a template

PUT/v1/templates/{id}

Required permission: templates.manageChanges data

PUT /v1/templates/{id}

cURL. The key is in the SENDSMS_API_KEY environment variable.

curl --max-time 30 --request PUT \
  --url 'https://api.sendsms.to/v1/templates/TEMPLATE_ID' \
  --header "X-API-Key: $SENDSMS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "body": "Order {{order_id}} is ready for pickup"
}'

#Parameters

FieldTypeDescription
idrequiredpath · string
X-Dry-Runoptionalheader · stringOptional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit.
true

#Request body

FieldTypeDescription
nameoptionalstring
minLength: 1
maxLength: 120
bodyoptionalstring
minLength: 1
maxLength: 1530
trafficClassoptional; the template class is used when a send has no trafficClassstring
variablesoptionalarray<object>Only placeholders used in body are stored. {{phone}} defaults to the recipient. Samples are used only by preview when useSamples=true; sending requires actual values.
maxItems: 30
variables[].namerequiredstring
pattern: "^[A-Za-z_][A-Za-z0-9_]{0,39}$"
variables[].requiredoptionalboolean
default: true
variables[].sampleoptionalstring
maxLength: 500
variables[].labeloptionalstring
maxLength: 80

What happens if it is not sent

trafficClass
The class comes from the send request or the «Default traffic class».

#Responses

200Successful result

Response format

FieldTypeDescription
idrequiredstring · uuidTemplate UUID generated by the SendSMS database when created. Stable across edits; use version to identify content revisions. It is not messageId.
channelrequiredstringTemplate channel stored by SendSMS. This API is SMS-only.
namerequiredstringCustomer-supplied template name validated and stored by SendSMS.
bodyrequiredstringCustomer-supplied template text with {{placeholders}}, stored for this version. Not a sent message.
statusrequiredstringModeration state recorded by SendSMS for the returned template/version. Lists can show the template state; detail/create/update use the current version state. pending/approved/rejected and historical legacy are documented below.
"pending" "approved" "rejected" "legacy"
  • pending — Current template/version is awaiting moderation.
  • approved — Current template/version is approved in SendSMS; archive and channel restrictions still apply.
  • rejected — Current template/version was rejected.
  • legacy — Historical version without current explicit approval; do not treat it as approved for a new send.
createdAtrequiredstring · date-timeTemplate record creation timestamp assigned by the SendSMS database. ISO 8601 UTC; Not a message-delivery timestamp.
updatedAtrequiredstring · date-timeLast record change timestamp maintained by SendSMS. ISO 8601 UTC; Not a message-delivery timestamp.
trafficClassrequiredstring | nullTraffic class supplied by the customer and stored by SendSMS; null means none is pinned in the template. This does not override account permissions.
variablesrequiredarray<object>Variable definitions derived by SendSMS from placeholders actually used in body and supplied definitions. An empty array means no placeholders.
maxItems: 30
variables[].namerequiredstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
pattern: "^[A-Za-z_][A-Za-z0-9_]{0,39}$"
variables[].requiredrequiredbooleanRequirement computed/stored by SendSMS from the variable definition; normally true. phone is supplied from the recipient when available.
default: true
variables[].samplerequiredstringExample value supplied by the customer or SendSMS catalog. Used only by preview with useSamples=true; never a substitute for actual send values.
maxLength: 500
variables[].labeloptionalstringDisplay label supplied by the customer or SendSMS built-in catalog. May be absent from template definitions. Not used as the substitution key.
maxLength: 80
variables[].builtinrequiredbooleanBoolean generated by SendSMS: true means a built-in variable such as phone; false means a customer-defined variable.
versionrequiredintegerPositive version number assigned by SendSMS: starts at 1 and increments when content/settings change. An unchanged update can retain the number. Not a timestamp.
archivedrequiredbooleanBoolean calculated by SendSMS from the archive marker. true means unavailable for a new send; history is retained.
dryRunoptionalbooleanPresent only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional.
const: true
400Invalid input

Check required fields, value types and the request format.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
errorsoptionalarray<object>Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result.
errors[].fieldoptionalstringRequest field identified by the SendSMS validator, such as name or body.
errors[].messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
missingoptionalarray<string>Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors.
invalidoptionalarray<object>Invalid variable values identified by SendSMS, with variable name and validation reason.
invalid[].nameoptionalstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
invalid[].reasonoptionalstringSendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery.
channeloptionalstringRequested channel echoed by SendSMS in a channel-availability refusal.
reasonsoptionalarray<string>SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes.
401Invalid or revoked API key

Check the X-API-Key header and key status. Never expose the key in client-side code. The machine code is in the code field: api_key_missing or api_key_invalid.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
403Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)

Check API key permissions, account settings and channel availability.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
errorsoptionalarray<object>Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result.
errors[].fieldoptionalstringRequest field identified by the SendSMS validator, such as name or body.
errors[].messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
missingoptionalarray<string>Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors.
invalidoptionalarray<object>Invalid variable values identified by SendSMS, with variable name and validation reason.
invalid[].nameoptionalstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
invalid[].reasonoptionalstringSendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery.
channeloptionalstringRequested channel echoed by SendSMS in a channel-availability refusal.
reasonsoptionalarray<string>SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes.
404Resource unavailable to this account

Check the resource ID and whether it belongs to the API key account.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
errorsoptionalarray<object>Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result.
errors[].fieldoptionalstringRequest field identified by the SendSMS validator, such as name or body.
errors[].messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
missingoptionalarray<string>Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors.
invalidoptionalarray<object>Invalid variable values identified by SendSMS, with variable name and validation reason.
invalid[].nameoptionalstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
invalid[].reasonoptionalstringSendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery.
channeloptionalstringRequested channel echoed by SendSMS in a channel-availability refusal.
reasonsoptionalarray<string>SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes.
409Conflict

Check the current resource state and operation conditions before retrying.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
errorsoptionalarray<object>Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result.
errors[].fieldoptionalstringRequest field identified by the SendSMS validator, such as name or body.
errors[].messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
missingoptionalarray<string>Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors.
invalidoptionalarray<object>Invalid variable values identified by SendSMS, with variable name and validation reason.
invalid[].nameoptionalstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
invalid[].reasonoptionalstringSendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery.
channeloptionalstringRequested channel echoed by SendSMS in a channel-availability refusal.
reasonsoptionalarray<string>SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes.
422Validation or eligibility failure

Correct the data or eligibility conditions indicated in the response.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
errorsoptionalarray<object>Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result.
errors[].fieldoptionalstringRequest field identified by the SendSMS validator, such as name or body.
errors[].messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
missingoptionalarray<string>Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors.
invalidoptionalarray<object>Invalid variable values identified by SendSMS, with variable name and validation reason.
invalid[].nameoptionalstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
invalid[].reasonoptionalstringSendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery.
channeloptionalstringRequested channel echoed by SendSMS in a channel-availability refusal.
reasonsoptionalarray<string>SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes.
429Rate limit

Reduce the request rate and delay retries. The general per-second limit: code = rate_limit_exceeded.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
503Temporarily unavailable

The service is temporarily unavailable. Before retrying an SMS submission, check whether the previous request was accepted.

Response format

FieldTypeDescription
errorrequiredstringError identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code.
messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
codeoptionalstringOptional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code.
statusCodeoptionalintegerOptional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative.
errorsoptionalarray<object>Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result.
errors[].fieldoptionalstringRequest field identified by the SendSMS validator, such as name or body.
errors[].messageoptionalstringOptional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation.
missingoptionalarray<string>Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors.
invalidoptionalarray<object>Invalid variable values identified by SendSMS, with variable name and validation reason.
invalid[].nameoptionalstringVariable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name.
invalid[].reasonoptionalstringSendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery.
channeloptionalstringRequested channel echoed by SendSMS in a channel-availability refusal.
reasonsoptionalarray<string>SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes.

Type to search