Method
POST /v1/comms/templates
Body Parameters
Bearer token (requires comms:write).
Request Example
curl -X POST "https://api.voyantcloud.com/v1/comms/templates" \
-H "Authorization: Bearer $VOYANT_API_KEY" \
-H "content-type: application/json" \
-d '{
"name": "Booking Confirmation",
"key": "booking_confirmation",
"channel": "email",
"purpose": "transactional",
"status": "active"
}'
Response Fields
id – Template ID.
workspace_id – Workspace owning the template.
name, key, channel, purpose, status – Echoed metadata.
created_at, updated_at – ISO timestamps.
Response Example
{
"id": "tmpl_01J0CBFPXW7SP2N8A9Q7T2048Q",
"workspace_id": "ws_01HZYPM2QF2R8X9SZQ0J9SYBCN",
"name": "Booking Confirmation",
"key": "booking_confirmation",
"channel": "email",
"purpose": "transactional",
"status": "active",
"created_at": "2025-01-08T10:22:31.000Z",
"updated_at": "2025-01-08T10:22:31.000Z"
}
Duplicate keys return 409 with error code TEMPLATES_DUPLICATE. Choose a unique key per workspace.