Update Template Configuration
Update an existing template configuration, supporting modification of the template name, type, content, destination countries, and signature information. After updating, the template status will revert to "Pending Review".
Request URL
PUT https://smsapi.engagelab.com/v1/template-configs/:templateId
Call Authentication
Please refer to Call Authentication to learn how to authenticate API requests.
Request Example
Request Header
PUT /v1/template-configs/123456789 HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
PUT /v1/template-configs/123456789 HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
This code block in the floating window
Request Body
{
"template_name": "Order Notification Template",
"template_type": "utility",
"template_content": "Your order {order_no} has been shipped and is expected to be delivered by {delivery_time}",
"country_codes": "CN,US",
"add_signature": true,
"sign_id": "987654321",
"sign_position": 2
}
{
"template_name": "Order Notification Template",
"template_type": "utility",
"template_content": "Your order {order_no} has been shipped and is expected to be delivered by {delivery_time}",
"country_codes": "CN,US",
"add_signature": true,
"sign_id": "987654321",
"sign_position": 2
}
This code block in the floating window
Request Parameters
Path Parameters
| Parameter | Type | Option | Description |
|---|---|---|---|
| templateId | String | Required | Template ID |
Request Body Parameters
| Parameter | Type | Option | Description |
|---|---|---|---|
| template_name | String | Required | Template name, up to 255 characters |
| template_type | String | Required | Template type: utility (notification), marketing (marketing) |
| template_content | String | Required | Template content, cannot contain: 【, 】, 、, 测试, test, [, ] |
| country_codes | String | Required | Main destination country codes, comma-separated |
| add_signature | Boolean | Optional | Whether to add a signature, default false |
| sign_id | String | Conditionally Required | Required when add_signature is true, signature ID |
| sign_position | Integer | Conditionally Required | Required when add_signature is true, signature position: 1-prefix, 2-suffix |
Response Parameters
Success Response
The HTTP status code is 200, and the response body contains the following fields:
| Field | Type | Description |
|---|---|---|
| code | Integer | Status code, 0 indicates success |
| message | String | Status description |
Success Example
{
"code": 0,
"message": "success"
}
{
"code": 0,
"message": "success"
}
This code block in the floating window
Error Response
The HTTP status code is 4xx/5xx, and the response body contains the following fields:
| Field | Type | Description |
|---|---|---|
| code | Integer | Error code |
| message | String | Error details |
Error Example
{
"code": 400,
"message": "can not update pending status template"
}
{
"code": 400,
"message": "can not update pending status template"
}
This code block in the floating window
Error Codes
| Error Code | HTTP Code | Description |
|---|---|---|
| 400 | 400 | Parameter error or business logic error |
| 500 | 500 | Internal server error |
Common error messages:
invalid templateId: Template ID format errortemplate config not exist: Template configuration does not existcan not update pending status template: Template in pending review status cannot be updatedthere are pending or running plans using current template, can not update: There are pending or running plans using this template, cannot be updatedsign config not exist: Signature configuration does not existsign status is not approved, can not use: Signature status is not approved, cannot be used
Notes
- Templates in "Pending Review" status cannot be updated.
- If there are pending or running message plans using this template, it cannot be updated.
- After updating, the template status will revert to "Pending Review" (status=1).
- If adding a signature, the signature must be in an approved status.
- Template content cannot contain forbidden characters:
【,】,、,测试,test,[,] - Both template and signature IDs are string-type numbers.
Appendix
Template Configuration Status (status)
| Value | Description |
|---|---|
| 1 | Pending Review |
| 2 | Approved |
| 3 | Rejected |
Template Type (template_type)
| Value | Description |
|---|---|
| utility | Notification |
| marketing | Marketing |
Signature Position (sign_position)
| Value | Description |
|---|---|
| 0 | No signature |
| 1 | Prefix |
| 2 | Suffix |










