Sign inGet Started

Get one language of a version

GET
/v1/email/templates/{template_ref}/versions/{version_id}/languages/{language}
const language = await bird.email.templates.versions.languages.get(
  "TEMPLATE_ID",
  "DRAFT_VERSION_ID",
  "en",
);
console.log(language.content?.html);
响应200
{
  "language": "en",
  "revision": 3,
  "authoring_mode": "html",
  "content_hash": "sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "updated_at": "2026-05-25T16:42:01Z",
  "content": {
    "subject": "Welcome to Acme, {{ bird.contact.first_name }}!",
    "preview_text": "{{ bird.contact.first_name }}, your order is on its way",
    "html": "<div style=\"display: flex;\"><h1>Hi {{ bird.contact.first_name }}</h1></div>"
  },
  "compatibility_severity": "warning",
  "compatibility": [
    {
      "rule_id": "css_display_flex_grid",
      "severity": "warning",
      "language": null,
      "field": "html",
      "message": "`display: flex` and `grid` don't work in Outlook (Windows/Windows Mail).",
      "fix": "Use tables for layout.",
      "partial": "Partial support for `display: flex` and `grid` in Gmail (iOS/Android).",
      "line": 1,
      "column": 13,
      "match": "display: flex",
      "unsupported_clients": [
        {
          "family": "outlook",
          "platforms": [
            "windows",
            "windows_mail"
          ]
        }
      ],
      "partial_clients": [
        {
          "family": "gmail",
          "platforms": [
            "ios",
            "android"
          ]
        }
      ]
    }
  ]
}

Returns one language's content from a version (its subject and bodies) plus the revision to send back when saving it.

Works on any version, including a published version whose content is frozen. Returns a 404 Not Found error if the version does not have the language.

In a language that links reusable blocks (has_shared_blocks), the HTML shows each block's current published content and changes when a block is published. Copying that HTML into another template creates independent content. Set authoring to true to read the HTML with its block markers and the shared_blocks links instead, which is what a save of the language needs.

参数

template_refstring

The template's id (emt_…) or slug. On read, a built-in system template's bird_ slug also resolves here. Writing or removing a language requires a workspace template, because a system template has no draft to edit and returns 404 not_found_error.

version_idstring

The version that holds the language.

languagestring

The language as a BCP-47 tag.

查询参数

authoringboolean

Return the HTML with its reusable block markers in place of the blocks' content, plus shared_blocks, so a language that links blocks can be saved back with its links intact. Compatibility locations still refer to the HTML with the blocks filled in.

响应载荷

language
string
必填

The language this content belongs to, in its canonical form. Send a tag in any casing and this reports the form the template stores.

revision
integer
必填

This language's revision counter. Send it back when you save this language so a concurrent edit is caught instead of silently overwritten. It counts only this language's own changes, so editing another language never invalidates it.

authoring_mode
string
必填

How this language is edited, derived from what it stores. visual: it keeps a document from the Bird dashboard's visual editor. A request that would add, move or remove its linked blocks is refused, and so is one that would replace its body while it links blocks; open the template's editor_url instead. Subject and preview text stay editable. While it links no blocks, a full save without editor_state replaces its visual design with your HTML, and a partial update that changes html or text keeps the design, so the language stays visual and the visual editor still shows the design rather than your HTML. html: it is edited as HTML, and blocks are linked with HTML comment markers of the form bird:shared-block:OCCURRENCE_UUID and shared_blocks. It changes only when a save keeps or drops the visual editor's document.

Possible values (may grow over time): visual, html

content_hash
nullable string

A hash over this language's content, prefixed with the algorithm that produced it (sha256:), so the algorithm can change without the field becoming ambiguous. It tells you whether a language differs without transferring the content, and is comparable only within one version of this API. Null for a language saved before fingerprints were recorded.

updated_at
nullable string

When this language was last saved. Null if that is not recorded.

content
object

One language's content for an email template. Each language carries its own subject, preview text and bodies, so a translation can differ in wording and length from every other language without affecting them.

显示子属性
compatibility_severity
string
必填

The worst severity across every finding the response was computed from, which is the authoritative reading: a response that caps how many findings it lists still accounts here for the ones it left out. Each response's compatibility says which content it covered.

  • problem: at least one finding is a problem.
  • warning: every finding is a warning.
  • none: there are no findings.

Possible values: problem, warning, none

compatibility
array of object
必填

What the stored HTML uses that mail clients remove, ignore, or render inconsistently, in the order the patterns appear. Empty when nothing is worth reporting. Line and column count in the content.html this response carries. At most 200 findings come back, the first 200 in source order; compatibility_severity is derived from every finding the HTML produced, including any beyond those 200.

显示子属性