Get an SMS template
/v1/sms/templates/{template_ref}const tpl = await bird.smsTemplates.get("bird_otp_verification");
console.log(tpl.default_language, tpl.live_version_id);template = client.sms_templates.get("bird_otp_verification")
print(template.default_language, template.live_version_id)tpl, err := client.SmsTemplates.Get(context.Background(), "bird_otp_verification")
if err != nil {
log.Fatal(err)
}
fmt.Println(tpl.DefaultLanguage, *tpl.LiveVersionId)$template = $bird->smsTemplates->get('bird_otp_verification');
echo $template->getDefaultLanguage(), ' ', $template->getLiveVersionId();bird sms templates get <template-ref>curl -X GET "https://us1.platform.bird.com/v1/sms/templates/{template_ref}" \
-H "Authorization: Bearer $TOKEN"{
"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_refstringThe 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
idTemplate ID.
workspace_idThe workspace that owns the template. Null for a built-in system template.
slugThe immutable handle used to address and send the template. A built-in template's slug starts with bird_.
nameThe template's display name. It defaults to the slug and can be changed on workspace templates.
descriptionWhat the template is for. Null if it has no description.
scopeWhether the template is one of our built-in templates (system) or one your workspace created (workspace).
Possible values: system, workspace
statusWhere 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
categoryWhy 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_idThe permanent editable draft version. Null for a built-in template.
live_version_idThe 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_idDeprecated. Use live_version_id, which carries the same value.
revisionThe draft revision to use for concurrent-edit checks. Null for a built-in template.
languagesEach 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_languageThe draft's default language. Sends continue using the live version's default until the draft is published.
available_languagesLanguages the live version can currently send. Empty before first publication.
on_missing_languageHow a send handles a requested language that the live version does not have.
language_source_requiredWhether each send must name a language instead of using the live version's default.
last_submitted_atWhen the template was last published. Null before first publication and for built-in templates.
created_atWhen the template was created. Null for built-in templates.
updated_atWhen the template was last modified. Null for built-in templates.
Related resources
Continue with the documentation, guides and examples for this topic.