Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

Templates HTTP API

GET/api/v1/projects/{project_id}/templates

list_templates

Lists the templates of a project in id order, each by its latest version and without its sources, at most 100 per call.

Call it
to find a template’s id or latest version number.
Needs
an admin key with project_id, or a project key with scope read (its own project; the argument is ignored).
Returns
items (id, name, kind, version, created_at) and next_cursor: pass it as cursor for the next page; null on the last page. The same as GET /api/v1/projects/{project_id}/templates.

Arguments

  • object
  • cursorstring | null

    next_cursor of the previous page; leave it out for the first.

  • kindstring

    Only templates of this kind: message or partial.

  • limitinteger · int64 | null

    Page size, 1 to 100; default 50.

    1–100

  • project_idstring · uuid | null

    The project whose templates to list. An admin key must pass it; a project key’s own project is used and this is ignored.

No other arguments are accepted.

Result

The result comes back as structuredContent, with the same JSON as a text block.

  • object · all fields required
  • itemsarray of TemplateSummaryOutput

    In id order, each by its latest version.

    6 fields
    • TemplateSummaryOutput object · all fields required
    • created_atstring · date-time

      When the latest version was saved.

    • idstring · uuid
    • What a template is.

      message A message: subject, HTML, text.

      partial A fragment other templates include.

    • namestring
    • project_idstring · uuid
    • versioninteger · uint32

      The latest version.

      ≥ 0

  • next_cursorstring | null

    Pass as cursor for the next page; null on the last page.

Definitions

TemplateKindOutput

What a template is.

string · enum

message A message: subject, HTML, text.

partial A fragment other templates include.

TemplateSummaryOutput

A template as list_templates shows it: its latest version, without sources.

  • object · all fields required
  • created_atstring · date-time

    When the latest version was saved.

  • idstring · uuid
  • What a template is.

    message A message: subject, HTML, text.

    partial A fragment other templates include.

  • namestring
  • project_idstring · uuid
  • versioninteger · uint32

    The latest version.

    ≥ 0

Errors

A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors

HTTP API

The same operation over HTTP: GET /api/v1/projects/{project_id}/templates