Sign inGet Started

List email templates

GET
/v1/email/templates
for await (const tpl of bird.email.templates.list({ scope: "workspace" })) {
  console.log(tpl.slug, tpl.name);
}
Réponse200
{
  "data": [
    {
      "id": "emt_01krdgeqcxet5s7t44vh8rt9mg",
      "workspace_id": "ws_01krdgeqcxet5s7t44vh8rt9mg",
      "slug": "welcome-email",
      "name": "Welcome email",
      "scope": "workspace",
      "status": "active",
      "category": "transactional",
      "source": "html",
      "theme": null,
      "draft_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
      "live_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
      "published_version_id": "emv_01krdgeqcxet5s7t44vh8rt9mg",
      "available_languages": [
        "en"
      ],
      "default_language": "pt-BR",
      "languages": {
        "en": {
          "status": "live"
        },
        "de": {
          "status": "draft"
        }
      }
    }
  ],
  "next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}

Returns a paginated list of email templates, newest first.

The list covers both the workspace's own templates and our built-in system templates. Use scope to get only one of the two, or leave it out to get both. When you leave it out, the workspace's own templates come first, newest first, and our built-in templates fill the rest of the list once the workspace's templates run out.

Filter further by category or authoring format, or search with q, a case-insensitive substring match against the template's slug, name, and description.

Our built-in templates come in five visual themes. Each theme ships its own set of eight emails, and the sets overlap only partly. Use theme to see one of them. A template your workspace authored has no theme, so naming one returns our built-ins alone.

Paramètres de requête

scopestring

Filter by who owns the template. Use system for our built-in templates and workspace for the ones your workspace created. Leave it out to get both.

Possible values: system, workspace

categorystring

Return only transactional or marketing templates; omit to return both categories.

Possible values: transactional, marketing

sourcestring

Return only templates authored in this format.

Possible values (may grow over time): html

themestring

Filter by the visual theme a built-in template is designed in. Only our built-in templates have a theme, so naming one returns built-ins alone.

Possible values: arcane, barebone, matte, protocol, studio

qstring

A case-insensitive substring search across the template's slug, name, and description.

limitinteger

Maximum number of items to return per page.

starting_afterstring

Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.

ending_beforestring

Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.

Contenu de la réponse

data
array of object
obligatoire

Page of email templates.

Afficher les attributs enfants
next_cursor
nullable string
obligatoire

Cursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.

prev_cursor
nullable string
obligatoire

Cursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.

refresh_cursor
nullable string
obligatoire

Refresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.