POST
/v1/admin/templates
Create Template
Create the template at the provider (via nexus), scoped to the given connector, and reflect it into core. Returns the created template.
curl -X POST https://api.{cluster}.{platform}.voiger.io/v1/admin/templates \
-H "Cookie: sid=$VOIGER_SESSION" \
-H "x-workspace-code: your-workspace-code" \
-H "x-csrf-token: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connector_id": "1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809",
"name": "parcel_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your parcel {{2}} has shipped.",
"example": {
"body_text": [
[
"Sam",
"A-1024"
]
]
}
},
{
"type": "FOOTER",
"text": "Reply STOP to unsubscribe"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Contact support"
}
]
}
],
"variables": [
{
"key": "1",
"name": "customer_name"
}
]
}'
const res = await fetch("https://api.{cluster}.{platform}.voiger.io/v1/admin/templates", {
method: "POST",
credentials: "include",
headers: { "x-workspace-code": "your-workspace-code" },
headers: { "Content-Type": "application/json", "x-csrf-token": csrf },
body: JSON.stringify({
"connector_id": "1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809",
"name": "parcel_shipped",
"language": "en_US",
"category": "UTILITY",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your parcel {{2}} has shipped.",
"example": {
"body_text": [
[
"Sam",
"A-1024"
]
]
}
},
{
"type": "FOOTER",
"text": "Reply STOP to unsubscribe"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "Contact support"
}
]
}
],
"variables": [
{
"key": "1",
"name": "customer_name"
}
]
}),
})
const data = await res.json()
Parameters
x-workspace-code
string
required
in header
x-csrf-token
string
required
in header
template▾
object
A message template, one row per business number (connector) it can be sent from. Provider ids are internal (`meta`); `variables` is the admin's placeholder→variable mapping and survives a sync.
connector_id
string
The business number (connector) this template can be sent from.
channel
string
The connector's channel, copied onto the template row.
status
string | null
Provider review status, e.g. APPROVED, PENDING, REJECTED.
components
array
The provider's template components (header/body/buttons), as the provider holds them. Read back verbatim and deliberately not constrained here: a template synced from the provider may carry shapes `CreateTemplate` would refuse, because it could have been created outside core.
variables▾
array
The admin's placeholder→variable mapping for this row.
json · 200
{
"template": {
"id": "8f2b1a3c-4d5e-6f70-8192-a3b4c5d6e7f8",
"connector_id": "1a2b3c4d-5e6f-7081-92a3-b4c5d6e7f809",
"channel": "whatsapp",
"name": "parcel_shipped",
"language": "en_US",
"category": "UTILITY",
"status": "APPROVED",
"components": [
{
"type": "BODY",
"text": "Hi {{1}}, your parcel {{2}} has shipped."
}
],
"variables": [
{
"key": "1",
"name": "customer_name"
}
],
"updated_at": "2026-09-24T08:12:20.921558Z"
}
}