Sign inGet started

Get an SMS template

GET
/v1/sms/templates/{template_ref}
const tpl = await bird.smsTemplates.get("bird_otp_verification");
console.log(tpl.default_language, tpl.live_version_id);
Response200
{
  "id": "smt_01krdgeqcxet5s7t44vh8rt9mg",
  "workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
  "slug": "order-shipped",
  "name": "Order shipped",
  "scope": "system",
  "status": "active",
  "category": "transactional",
  "draft_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
  "live_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
  "published_version_id": "smv_01krdgeqcxet5s7t44vh8rt9mg",
  "languages": {
    "en": {
      "status": "live"
    },
    "nl": {
      "status": "live",
      "draft": true
    }
  },
  "default_language": "pt-BR",
  "available_languages": [
    "en"
  ],
  "on_missing_language": "fallback"
}
Returns one SMS template's metadata, policies, language states, draft revision, and draft and live version IDs. The response is shallow; read a version to retrieve content and variables. An unknown or deleted template returns 404.
Parameters
template_ref
string
The template's ID (smt_…) or slug. Built-in templates use a bird_ slug. Write operations accept workspace templates because built-in templates are read-only.
Response Payload
id
string
required
Template ID.
workspace_id
nullable string
required
The workspace that owns the template. Null for a built-in system template.
slug
string
required
The immutable handle used to address and send the template. A built-in template's slug starts with bird_.
name
string
required
The template's display name. It defaults to the slug and can be changed on workspace templates.
description
nullable string
required
What the template is for. Null if it has no description.
scope
string
required
Whether the template is one of our built-in templates (system) or one your workspace created (workspace).
Possible values: system, workspace
status
string
required
Where the template stands as a whole. The same five states on every channel.
  • draft: nothing has ever gone live.
  • pending: nothing is live and at least one language is in review.
  • active: at least one language is live, so something can be sent.
  • rejected: it was reviewed and every language was refused.
  • inactive: nothing is live and nothing is in review, so content was withdrawn or was blocked before anything went live.
A template with one language live is active even while another is still drafted or refused. Read languages for the state of each language and its reason.
Which values a channel reports follows its review model. A channel whose content a third party reviews uses all five. On email and SMS, where content goes live on publish, a template is draft, active or inactive, and pending and rejected are reserved for the review stage coming to both, so a template reaching either is not a breaking change.
Possible values: draft, pending, active, rejected, inactive
category
string
required
Why messages use this template. Use authentication for one-time codes, marketing for promotions, and transactional for service messages.
Possible values: transactional, marketing, authentication
draft_version_id
nullable string
required
The permanent editable draft version. Null for a built-in template.
live_version_id
nullable string
required
The version sends resolve to, or null before a workspace template is first published. A built-in template points to a synthetic published version that projects its current catalogue content.
published_version_id
nullable string
required
Deprecated. Use live_version_id, which carries the same value.
revision
nullable integer
required
The draft revision to use for concurrent-edit checks. Null for a built-in template.
languages
object
required
Each language the template has, keyed by canonical BCP-47 tag, with its live state and whether the draft contains unpublished changes. Content is available from version reads.
default_language
string
required
The draft's default language. Sends continue using the live version's default until the draft is published.
available_languages
array of string
required
Languages the live version can currently send. Empty before first publication.
on_missing_language
string
required
How a send handles a requested language that the live version does not have.
language_source_required
boolean
required
Whether each send must name a language instead of using the live version's default.
last_submitted_at
nullable string
required
When the template was last published. Null before first publication and for built-in templates.
created_at
nullable string
required
When the template was created. Null for built-in templates.
updated_at
nullable string
required
When the template was last modified. Null for built-in templates.