Change a message template
PATCH
https://api.norreach.app/v1/templates/{id}Changes a saved template's name, category, subject (email) or body. Its channel stays. Owners, admins and managers. dry_run=true answers it as it would be.
templates:writeRole must allow: channels.templatesSupports dry_runOperation id: update_message_template
PATCH/templates/{id}
curl -X PATCH "https://api.norreach.app/v1/templates/{id}" \
-H "Authorization: Bearer $NORREACH_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"subject": "Nurses within 48 hours"
}'Change a message template
{
"id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"object": "template",
"kind": "message",
"name": "First touch",
"channel": "email",
"language": null,
"category": "Outreach",
"status": null,
"subject": "Nurses within 48 hours",
"body": "Hi {{first_name}}, …",
"variable_count": null
}Authorizations
Authorizationstringheaderrequired
Bearer authentication: send Authorization: Bearer <key>, with an API key or an OAuth access token. The key needs the scope templates:write. API keys and scopes
Path parameters
idstring (uuid)pathrequired
An id (UUID).
Query parameters
dry_runbooleanquery
Run every check and return what would happen, changing nothing.
Headers
Idempotency-Keystringheader
Any unique string (≤ 255). The same key with the same request returns the first answer for 24 hours.
Body
application/json
namestring
categorystring
subjectstring | null
bodystring
Response
200application/json— Change a message template
idstring (uuid)required
An id (UUID).
object"template"required
kindenumrequired
One of:
messagewhatsappnamestringrequired
channelstringrequired
languagestring | nullrequired
categorystring | nullrequired
statusstring | nullrequired
WhatsApp: the network's review state (only APPROVED templates can be sent).
subjectstring | nullrequired
bodystring | nullrequired
variable_countinteger | nullrequired
Errors
Errors are application/problem+json with a stable code.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request couldn't be read. |
| 400 | unknown_field | The request has a field this operation doesn't know. |
| 401 | unauthorized | A valid API key is required. |
| 403 | insufficient_scope | This API key doesn't have the scope this operation needs. |
| 403 | feature_not_enabled | The API isn't switched on for this workspace. |
| 403 | role_forbidden | The key's creator's role can't do this. |
| 404 | not_found | That doesn't exist. |
| 409 | idempotency_in_progress | A request with this Idempotency-Key is still running. |
| 413 | too_large | The request body is too large. |
| 422 | validation_failed | The request has invalid fields. |
| 422 | idempotency_mismatch | This Idempotency-Key was used with a different request. |
| 429 | rate_limited | Too many requests. Slow down and try again. |
| 500 | server_error | Something went wrong on our side. |
| 503 | unavailable | The API isn't available right now. Try again shortly. |