<Intro>

<EndpointHeader />

<Description>

Returns a single SMS template: its body preview, category, the `variables` it expects (each with its accepted format), and the languages it is available in. Fetch a template before sending with it to see which `parameters` keys are required; an unknown reference returns a `404`. To browse the whole catalogue, use [List SMS templates](/docs/api/reference/list-sms-templates) instead.

</Description>

</Intro>

<Parameters in="path">

<Parameter name="template_ref" type="string">

<Description>

The template's `name` (for example `bird_otp_verification`) or its `smt_`-prefixed id. A reference starting with `smt_` resolves by id; anything else resolves by name.

</Description>

</Parameter>

</Parameters>

<Payload kind="response">

<Field name="id" type="string" required>

<Description>

Unique identifier for the template.

</Description>

</Field>

<Field name="name" type="object" required>

<Description>

The template's stable handle. Pass it (or the id) as the template reference when sending.

</Description>

</Field>

<Field name="description" type="string" required>

<Description>

Human-readable description of what the template is for.

</Description>

</Field>

<Field name="scope" type="string" required>

<Description>

Whether the template is a built-in Bird template (`system`) or one your workspace authored (`workspace`).

</Description>

<Description>

Possible values: `system`, `workspace`

</Description>

</Field>

<Field name="category" type="object" required>

<Description>

Content classification applied to messages sent from this template.

</Description>

</Field>

<Field name="body" type="string" required>

<Description>

The template body in its default language, shown for preview. Variable placeholders appear inline (for example `{{ code }}`).

</Description>

</Field>

<Field name="variables" type="array of object" required>

<Description>

The typed slots this template fills in from the values you supply when sending.

</Description>

<FieldChildren kind="response">

<Field name="key" type="string" prefix="variables." required>

<Description>

The parameters key this slot is filled with.

</Description>

</Field>

<Field name="type" type="string" prefix="variables." required>

<Description>

The value type this slot accepts. Open enum — treat any unrecognized value as a future type rather than an error. SMS templates use the typed slots (`code`, `amount`, …); email templates use `text`.

</Description>

<Description>

Possible values (may grow over time): `code`, `ttl`, `count`, `ref`, `date`, `date_time`, `amount`, `currency`, `text`

</Description>

</Field>

<Field name="required" type="boolean" prefix="variables." required>

<Description>

Whether the slot must be supplied when sending. Advisory for email templates, where a missing value renders as empty rather than rejecting the send.

</Description>

</Field>

<Field name="constraint" type="string" prefix="variables." required>

<Description>

A human-readable description of the accepted values.

</Description>

</Field>

</FieldChildren>

</Field>

<Field name="available_languages" type="array of string" required>

<Description>

The languages this template is available in, as BCP-47 tags.

</Description>

</Field>

<Field name="status" type="string" required>

<Description>

The template's lifecycle state. `active` means the template can be sent; every built-in Bird template is `active`. `draft` (being edited), `pending` (submitted for review), `approved` (passed review), and `rejected` (failed review) describe a workspace-authored template's authoring lifecycle; workspace-authored SMS templates are not available yet, so today every template is `active`.

</Description>

<Description>

Possible values: `active`, `draft`, `pending`, `approved`, `rejected`

</Description>

</Field>

<Field name="draft_version_id" type="nullable string" required>

<Description>

The current editable draft version. Always null today: SMS templates are not yet versioned; present for parity with email templates.

</Description>

</Field>

<Field name="published_version_id" type="nullable string">

<Description>

The currently published version, or null if the template has never been published. Always null today: SMS templates are not yet versioned; present for parity with email templates.

</Description>

</Field>

<Field name="revision" type="nullable integer" required>

<Description>

The draft's revision counter. Always null today: SMS templates are not yet versioned; present for parity with email templates.

</Description>

</Field>

<Field name="created_at" type="nullable string" required>

<Description>

When the template was created. Null for built-in templates.

</Description>

</Field>

<Field name="updated_at" type="nullable string" required>

<Description>

When the template was last updated. Null for built-in templates.

</Description>

</Field>

</Payload>