# Read a template

https://docs.sendsms.to/en/api/get-template/

`GET /v1/templates/{id}`

Required permission: templates.read

## Parameters

- `id` (path, required): 

## Request example

```bash
curl --max-time 30 --request GET \
  --url 'https://api.sendsms.to/v1/templates/TEMPLATE_ID' \
  --header "X-API-Key: $SENDSMS_API_KEY"
```

## Responses

### HTTP 200 — Successful result

```json
{
  "id": "00000000-0000-4000-8000-000000000001",
  "channel": "sms",
  "name": "Order update",
  "body": "Hello {{name}}",
  "status": "pending",
  "trafficClass": "transactional",
  "variables": [
    {
      "name": "name",
      "required": true,
      "sample": "Aygun",
      "label": "Name",
      "builtin": true
    }
  ],
  "version": 1,
  "archived": false,
  "createdAt": "2026-10-29T00:00:00.000Z",
  "updatedAt": "2026-10-29T00:00:00.000Z"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `id` | string · uuid | required. Template UUID generated by the SendSMS database when created. Stable across edits; use version to identify content revisions. It is not messageId. |
| `channel` | string | required. Template channel stored by SendSMS. This API is SMS-only. |
| `name` | string | required. Customer-supplied template name validated and stored by SendSMS. |
| `body` | string | required. Customer-supplied template text with {{placeholders}}, stored for this version. Not a sent message. |
| `status` | string | required. Moderation 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. |
| `createdAt` | string · date-time | required. Template record creation timestamp assigned by the SendSMS database. ISO 8601 UTC; Not a message-delivery timestamp. |
| `updatedAt` | string · date-time | required. Last record change timestamp maintained by SendSMS. ISO 8601 UTC; Not a message-delivery timestamp. |
| `trafficClass` | string | null | required. Traffic class supplied by the customer and stored by SendSMS; null means none is pinned in the template. This does not override account permissions. |
| `variables` | array<object> | required. Variable definitions derived by SendSMS from placeholders actually used in body and supplied definitions. An empty array means no placeholders. |
| `variables[].name` | string | required. Variable 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. |
| `variables[].required` | boolean | required. Requirement computed/stored by SendSMS from the variable definition; normally true. phone is supplied from the recipient when available. |
| `variables[].sample` | string | required. Example value supplied by the customer or SendSMS catalog. Used only by preview with useSamples=true; never a substitute for actual send values. |
| `variables[].label` | string | optional. Display label supplied by the customer or SendSMS built-in catalog. May be absent from template definitions. Not used as the substitution key. |
| `variables[].builtin` | boolean | required. Boolean generated by SendSMS: true means a built-in variable such as phone; false means a customer-defined variable. |
| `version` | integer | required. Positive version number assigned by SendSMS: starts at 1 and increments when content/settings change. An unchanged update can retain the number. Not a timestamp. |
| `archived` | boolean | required. Boolean calculated by SendSMS from the archive marker. true means unavailable for a new send; history is retained. |
| `dryRun` | boolean | optional. Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional. |

### HTTP 400 — Invalid input

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
| `errors` | array<object> | optional. Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result. |
| `errors[].field` | string | optional. Request field identified by the SendSMS validator, such as name or body. |
| `errors[].message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `missing` | array<string> | optional. Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors. |
| `invalid` | array<object> | optional. Invalid variable values identified by SendSMS, with variable name and validation reason. |
| `invalid[].name` | string | optional. Variable 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[].reason` | string | optional. SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery. |
| `channel` | string | optional. Requested channel echoed by SendSMS in a channel-availability refusal. |
| `reasons` | array<string> | optional. SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes. |

### HTTP 401 — Invalid or revoked API key

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 403 — Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
| `errors` | array<object> | optional. Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result. |
| `errors[].field` | string | optional. Request field identified by the SendSMS validator, such as name or body. |
| `errors[].message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `missing` | array<string> | optional. Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors. |
| `invalid` | array<object> | optional. Invalid variable values identified by SendSMS, with variable name and validation reason. |
| `invalid[].name` | string | optional. Variable 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[].reason` | string | optional. SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery. |
| `channel` | string | optional. Requested channel echoed by SendSMS in a channel-availability refusal. |
| `reasons` | array<string> | optional. SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes. |

### HTTP 404 — Resource unavailable to this account

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
| `errors` | array<object> | optional. Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result. |
| `errors[].field` | string | optional. Request field identified by the SendSMS validator, such as name or body. |
| `errors[].message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `missing` | array<string> | optional. Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors. |
| `invalid` | array<object> | optional. Invalid variable values identified by SendSMS, with variable name and validation reason. |
| `invalid[].name` | string | optional. Variable 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[].reason` | string | optional. SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery. |
| `channel` | string | optional. Requested channel echoed by SendSMS in a channel-availability refusal. |
| `reasons` | array<string> | optional. SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes. |

### HTTP 409 — Conflict

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
| `errors` | array<object> | optional. Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result. |
| `errors[].field` | string | optional. Request field identified by the SendSMS validator, such as name or body. |
| `errors[].message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `missing` | array<string> | optional. Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors. |
| `invalid` | array<object> | optional. Invalid variable values identified by SendSMS, with variable name and validation reason. |
| `invalid[].name` | string | optional. Variable 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[].reason` | string | optional. SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery. |
| `channel` | string | optional. Requested channel echoed by SendSMS in a channel-availability refusal. |
| `reasons` | array<string> | optional. SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes. |

### HTTP 422 — Validation or eligibility failure

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
| `errors` | array<object> | optional. Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result. |
| `errors[].field` | string | optional. Request field identified by the SendSMS validator, such as name or body. |
| `errors[].message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `missing` | array<string> | optional. Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors. |
| `invalid` | array<object> | optional. Invalid variable values identified by SendSMS, with variable name and validation reason. |
| `invalid[].name` | string | optional. Variable 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[].reason` | string | optional. SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery. |
| `channel` | string | optional. Requested channel echoed by SendSMS in a channel-availability refusal. |
| `reasons` | array<string> | optional. SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes. |

### HTTP 429 — Rate limit

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |

### HTTP 503 — Temporarily unavailable

```json
{
  "error": "string"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | required. Error 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. |
| `message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `code` | string | optional. Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code. |
| `statusCode` | integer | optional. Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative. |
| `errors` | array<object> | optional. Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result. |
| `errors[].field` | string | optional. Request field identified by the SendSMS validator, such as name or body. |
| `errors[].message` | string | optional. Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation. |
| `missing` | array<string> | optional. Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors. |
| `invalid` | array<object> | optional. Invalid variable values identified by SendSMS, with variable name and validation reason. |
| `invalid[].name` | string | optional. Variable 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[].reason` | string | optional. SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery. |
| `channel` | string | optional. Requested channel echoed by SendSMS in a channel-availability refusal. |
| `reasons` | array<string> | optional. SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes. |
