Create SMS pattern
Creates a new sms notifier pattern
HTTP Request
POST/api/notifications/notifiers/sms/:id/patterns
Authorization
Authorization
- Required: Yes
- Permission: Staff with SMSPatternPermission or Admin
- Permission Code: 2821
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the sms notifier |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| status | String | No | Status of the sms pattern (choices: `created`, `pending`, `approved`, `rejected`) |
| name | String | Yes | Name of the sms notifier pattern |
| code | String | Yes | Code of the sms notifier pattern |
| description | String | No | Extra description about the sms notifier pattern |
| body | String | Yes | Text body of the sms notifier pattern with possible required placeholders |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Create a new sms notifier
4response = requests.post('http://www.example.com/api/notifications/notifiers/sms/1/patterns',
5 json={
6 "status": "rejected",
7 "name": "otp-code",
8 "code": "187566",
9 "description": "used for sending otp codes",
10 "body": "Your login otp code is {0}"
11 },
12 headers={'Authorization': 'Token <your_api_key>'}
13)
14print(response.json())1# Create a new sms notifier
2curl -X POST "http://www.example.com/api/notifications/notifiers/sms/1/patterns" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "status": "rejected",
7 "name": "otp-code",
8 "code": "187566",
9 "description": "used for sending otp codes",
10 "body": "Your login otp code is {0}"
11}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the sms pattern. |
| status | String | Status of the sms pattern (choices: `created`, `pending`, `approved`, `rejected`) |
| name | String | Name of the sms pattern(unique over the specific notifier) |
| code | String | Code of the sms pattern |
| description | String | Extra descriptions about the sms pattern (nullable) |
| body | String | Text body of the sms pattern |
| created_at | String (ISO 8601) | Timestamp when the sms pattern was created. |
| updated_at | String (ISO 8601) | Timestamp when the sms pattern] was last updated. |
Example Response
{
"id": 3,
"status": "rejected",
"name": "otp-code",
"code": "187566",
"description": "used for sending otp codes",
"body": "Your login otp code is {0}",
"created_at": "2025-12-28T16:42:35.264559Z",
"updated_at": "2025-12-28T16:42:35.264568Z"
}