Skip to main content

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

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the sms notifier

Request Body

FieldTypeRequiredDescription
statusStringNoStatus of the sms pattern (choices: `created`, `pending`, `approved`, `rejected`)
nameStringYesName of the sms notifier pattern
codeStringYesCode of the sms notifier pattern
descriptionStringNoExtra description about the sms notifier pattern
bodyStringYesText body of the sms notifier pattern with possible required placeholders

Example Requests

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())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the sms pattern.
statusStringStatus of the sms pattern (choices: `created`, `pending`, `approved`, `rejected`)
nameStringName of the sms pattern(unique over the specific notifier)
codeStringCode of the sms pattern
descriptionStringExtra descriptions about the sms pattern (nullable)
bodyStringText body of the sms pattern
created_atString (ISO 8601)Timestamp when the sms pattern was created.
updated_atString (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"
}