Update a template

Updates an existing template's name, category, language, definition, or submits it for review. While the template is in review (status PENDING, or any channel awaiting a verdict) its definition, category and language are frozen and a resubmission is refused — those requests answer 409 CONFLICT_006. The display name stays editable throughout.

definition, category and language are editable only from status DRAFT, REJECTED or APPROVED. An edit to any of them on a template in another state (PAUSED, DISABLED or REVOKED) is refused with 400 VALIDATION_001 and the detail "Template (except display name) cannot be updated unless it is in draft or rejected status"; name stays editable in every state. submit_for_review on a PAUSED, DISABLED or REVOKED template is accepted and answers 200, but opens no review and does not move the status — only the reviewer can reinstate it.

Editing an APPROVED template is a live edit: the new content is stored immediately, and sending submit_for_review: true re-opens review, which returns the affected channels to PENDING so they stop sending until they are approved again. The previously approved content is never sent during re-review. Watch the per-channel templates webhook events rather than assuming the template-level status.

Templates provisioned by Sent (light-onboarding templates, whose names carry the reserved sent_ prefix) are read-only: every field is refused with 400 VALIDATION_001 and the detail "This template is read-only. Only 'submit for review' is allowed.", and only submit_for_review is accepted. A name starting with sent_ is refused for the same reason — the prefix is reserved.

PUT
/v3/templates/{id}

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v3/templates/7ba7b820-9dad-11d1-80b4-00c04fd430c8" \  -H "Idempotency-Key: req_abc123_retry1" \  -H "Content-Type: application/json" \  -d '{    "name": "Updated Welcome Message",    "category": "MARKETING",    "submit_for_review": false,    "sandbox": false  }'
{
  "success": true,
  "data": {
    "id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
    "customer_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Updated Welcome Message",
    "category": "MARKETING",
    "auto_reply_action": null,
    "language": "en_US",
    "status": "DRAFT",
    "channels": [
      "sms",
      "whatsapp",
      "rcs"
    ],
    "variables": [
      "name",
      "company"
    ],
    "created_at": "2026-08-31T14:13:13.2881043+00:00",
    "updated_at": "2026-09-30T14:13:13.2881049+00:00",
    "is_published": false
  },
  "error": null,
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-30T14:13:13.2881053+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "VALIDATION_001",
    "message": "Request validation failed",
    "details": {
      "category": [
        "Category must be one of: MARKETING, UTILITY, AUTHENTICATION"
      ]
    },
    "doc_url": "https://docs.sent.dm/reference/api/error-catalog"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-30T14:13:13.2881091+00:00",
    "version": "v3"
  }
}
Empty
Empty
{
  "success": false,
  "data": null,
  "error": {
    "code": "RESOURCE_002",
    "message": "Template not found",
    "details": null,
    "doc_url": "https://docs.sent.dm/reference/api/error-catalog"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-30T14:13:13.2881096+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "CONFLICT_006",
    "message": "This template is in review; its definition, category and language are frozen until the review completes",
    "details": null,
    "doc_url": "https://docs.sent.dm/reference/api/error-catalog"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-30T14:13:13.2881099+00:00",
    "version": "v3"
  }
}
{
  "success": false,
  "data": null,
  "error": {
    "code": "INTERNAL_001",
    "message": "Failed to update template",
    "details": null,
    "doc_url": "https://docs.sent.dm/reference/api/error-catalog"
  },
  "meta": {
    "request_id": "req_7X9zKp2jDw",
    "timestamp": "2026-09-30T14:13:13.288123+00:00",
    "version": "v3"
  }
}