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 scoperead(its own project; the argument is ignored). - Returns
items(id,name,kind,version,created_at) andnext_cursor: pass it ascursorfor the next page; null on the last page. The same asGET /api/v1/projects/{project_id}/templates.
Arguments
- object
-
cursorstring | nullnext_cursorof the previous page; leave it out for the first. -
kindstringOnly templates of this kind:
messageorpartial. -
limitinteger · int64 | nullPage size, 1 to 100; default 50.
1–100
-
project_idstring · uuid | nullThe 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 TemplateSummaryOutputIn id order, each by its latest version.
6 fields
- TemplateSummaryOutput object · all fields required
-
created_atstring · date-timeWhen the latest version was saved.
-
idstring · uuid -
What a template is.
messageA message: subject, HTML, text.partialA fragment other templates include. -
namestring -
project_idstring · uuid -
versioninteger · uint32The latest version.
≥ 0
-
next_cursorstring | nullPass as
cursorfor the next page;nullon 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-timeWhen the latest version was saved.
-
idstring · uuid -
What a template is.
messageA message: subject, HTML, text.partialA fragment other templates include. -
namestring -
project_idstring · uuid -
versioninteger · uint32The 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