Sms template
SMS message templates
INFO
Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.
POST /sms-template/create
Create a new SMS template for the tenant.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | SMS message body text |
{
"content": "string"
}Response
| Field | Type | Description |
|---|---|---|
_id | string | SMS template ObjectId |
account_id | string | Tenant identifier (immutable, injected server-side) |
content | string | SMS message body text |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp (ISO 8601) |
updated_at | string (date-time) | Last update timestamp (ISO 8601) |
created_by | string | ObjectId of the user who created this template |
updated_by | string | ObjectId of the user who last updated this template |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"account_id": "string",
"content": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"created_by": "string",
"updated_by": "string"
},
"time": "2025-05-01T12:00:00Z"
}GET /sms-template/get-by-id/{id}
Fetch a single SMS template by ObjectId.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | SMS template ObjectId |
Request body
No request body.
Response
Same response shape as POST /sms-template/create.
POST /sms-template/get-paging
Paginated list of SMS templates scoped to the tenant.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
{
"page": 1,
"limit": 20
}Response
| Field | Type | Description |
|---|---|---|
total | number | |
list | object[] | |
list[]._id | string | SMS template ObjectId |
list[].account_id | string | Tenant identifier (immutable, injected server-side) |
list[].content | string | SMS message body text |
list[].is_deleted | boolean | Soft-delete flag |
list[].created_at | string (date-time) | Creation timestamp (ISO 8601) |
list[].updated_at | string (date-time) | Last update timestamp (ISO 8601) |
list[].created_by | string | ObjectId of the user who created this template |
list[].updated_by | string | ObjectId of the user who last updated this template |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"_id": "string",
"account_id": "string",
"content": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z",
"created_by": "string",
"updated_by": "string"
}
]
},
"time": "2025-05-01T12:00:00Z"
}PUT /sms-template/update/{id}
Update an existing SMS template by ObjectId.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | SMS template ObjectId |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | SMS message body text |
{
"content": "string"
}Response
Same response shape as POST /sms-template/create.
DELETE /sms-template/delete/{id}
Soft-delete an SMS template by ObjectId (sets is_deleted=true).
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | SMS template ObjectId |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}This page is generated from the OpenAPI spec.