X Enterprises
fastify-xrcs

listTemplates

List all registered Twilio Content API templates, returning summary objects with type information.

listTemplates

Lists all content templates registered in the Twilio Content API, up to limit entries. Returns summary objects with the SID, friendly name, language, and a list of content type keys (e.g. ["twilio/card"]).

Signature

fastify.xrcs.listTemplates(limit?: number): Promise<TemplateSummary[]>

Params

NameTypeRequiredDescription
limitnumberNoMax templates to return. Default: 50. Must be a positive number.

Returns

Array<{
  sid: string,
  friendlyName: string,
  language: string,
  types: string[],     // e.g. ["twilio/card"]
  dateCreated: Date
}>

Throws

  • [xRCS] Twilio credentials required — no credentials at registration
  • [xRCS] 'limit' must be a positive number — invalid limit value
  • [xRCS] Failed to list templates: {message} — Twilio API error

Examples

List templates in an admin endpoint

fastify.get("/admin/templates", async (request) => {
  const limit = Number(request.query.limit) || 50;
  return fastify.xrcs.listTemplates(limit);
});

Find all card templates

const templates = await fastify.xrcs.listTemplates(100);
const cardTemplates = templates.filter((t) => t.types.includes("twilio/card"));

See Also

AI Context

package: "@xenterprises/fastify-xrcs"
method: fastify.xrcs.listTemplates(limit?)
use-when: List all Twilio Content API templates registered to the account
params: limit (number, optional)
returns: Array of template objects
requires: Twilio credentials
Copyright © 2026