List templates

Returns template summaries, newest first, filterable by category, channel, status, project, and search.

GET
/v1/templates

Returns template summaries, newest first, filterable by category, channel, status, project, and search. Pass nextCursor back as cursor for the next page; it is null on the last page. Read a template's compiled content, current publication, and input schema with GET /v1/templates/{id}.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

limit?|null
cursor?string
category?string
Value in"transactional""marketing""support""notification""verification""reminder""alert"
channel?string
Value in"sms""whatsapp""email"
status?string
Value in"draft""pending""approved""published""rejected""archived"
search?string
projectId?string
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$
namespaceId?

Only the templates this namespace uses: its own and those shared with every namespace (add shared=false for its own only). A namespace-scoped key lists its own namespace's and shared templates.

shared?|

Only templates whose project is shared with every namespace (true), or only unshared ones (false).

Response Body

TemplatePage

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.templates.list({});
Example Response
{  "items": [    {      "id": "string",      "slug": "string",      "name": "string",      "channel": "sms",      "projectId": "string",      "namespaceId": "string",      "shared": true,      "entryPath": "string",      "status": "draft",      "isActive": true,      "publishedAt": "string",      "brand": {        "slug": "string",        "digest": "string",        "stale": true      },      "fromDefault": {        "email": "string",        "name": "string"      },      "usageCount": 0,      "lastUsedAt": "string",      "createdAt": "string",      "updatedAt": "string"    }  ],  "nextCursor": "string"}

Related documentation