Templates

A saved message body with {{placeholders}}. Send template_id instead of message so your code does not ship the wording, and a colleague can reword it without a deploy.

Templates are also editable in the dashboard. It is the same list — the API and the dashboard read and write the same records.

List templates

GET/api/v1/templates
Response200
JSON
{
  "success": true,
  "data": [
    {
      "id": "cmuaxq0of000rtwq8n65tld2n",
      "name": "Fee reminder",
      "body": "Dear {{name}}, fees of GHS {{amount}} are due on {{date}}.",
      "variables": ["name", "amount", "date"],
      "segments_unrendered": 1,
      "encoding": "GSM7",
      "created_at": "2026-09-21T07:39:43.215Z",
      "updated_at": "2026-09-21T07:39:43.215Z"
    }
  ]
}
segments_unrendered is a floor, not a promise. It counts the raw template. A long value substituted into {{name}} can push a one-segment template to two. You are billed for the rendered text — see Segments and pricing.

Create a template

POST/api/v1/templates
Parameters
name
stringrequired
Up to 60 characters, unique within your organization.
body
stringrequired
Up to 1600 characters. Placeholders are parsed out at save time and returned as variables.
Shell
curl -X POST https://api.jkasms.com/api/v1/templates \
  -H "Authorization: Bearer $JKASMS_SECRET_KEY" \
  -H "X-JKASMS-Org-Id: $JKASMS_ORG_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Fee reminder",
    "body": "Dear {{name}}, fees of GHS {{amount}} are due on {{date}}."
  }'

Update a template

PATCH/api/v1/templates/:id

Send name, body, or both. Changing the body re-parses its placeholders.

Delete a template

DELETE/api/v1/templates/:id

Messages already sent from a template keep their rendered text — a template is a starting point, not a live reference.

Sending with a template

JSON
{
  "sender": "SCHOOL",
  "template_id": "cmuaxq0of000rtwq8n65tld2n",
  "recipients": ["0241234567"],
  "personalization": {
    "+233241234567": { "name": "Ama", "amount": "450", "date": "30 Sep" }
  }
}

Send exactly one of message or template_id. Both, or neither, returns 400 VALIDATION_ERROR — silently preferring one would mean editing the wrong field sends the old text with nothing to tell you why.

Test keys can read templates but not change them. Test keys end up in sample code and CI configs; letting one delete a live template would make "test" the most dangerous word in your integration. Writes with a test key return 403 FORBIDDEN.