Update Notification Settings
Updates the notification settings of the project
HTTP Request
PATCH/api/settings/notifications
Authorization
Authorization
- Required: Yes
- Permission: Staff with NotificationsSettingsPermission or Admin
- Permission Code: 1037
- Authentication: Token authentication
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| notifications_sms_notifier | Integer | No | ID of the SMS notifier to use (nullable) |
| notifications_email_notifier | Integer | No | ID of the email notifier to use (nullable) |
| notifications_otp_code_len | Integer | No | Length of OTP codes (default: 5) |
| notifications_otp_ttl | Integer | No | OTP code time-to-live in seconds (default: 120) |
Notifier Data Object Structure
Both notifications_sms_notifier_data and notifications_email_notifier_data contain:
| Field | Type | Required | Description |
|---|---|---|---|
| id | Integer | No | Notifier ID |
| name | String | No | Notifier display name |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Update notification settings
4response = requests.patch('http://www.example.com/api/settings/notifications',
5 headers={'Authorization': 'Token <your_api_key>'},
6 json={
7 "notifications_sms_notifier": 1,
8 "notifications_email_notifier": 2,
9 "notifications_otp_code_len": 6,
10 "notifications_otp_ttl": 180,
11 }
12)
13print(response.json())1# Update notification settings
2curl -X PATCH "http://www.example.com/api/settings/notifications" -H "Authorization: Token <your_api_key>" -H "Content-Type: application/json" -d '{
3 "notifications_sms_notifier": 1,
4 "notifications_email_notifier": 2,
5 "notifications_otp_code_len": 6,
6 "notifications_otp_ttl": 180,
7}'Response Fields
| Field | Type | Description |
|---|---|---|
| notifications_sms_notifier_data | Object | SMS notifier details with `id` and `name` fields |
| notifications_email_notifier_data | Object | Email notifier details with `id` and `name` fields |
| notifications_otp_code_len | Integer | Length of OTP codes (default: 5) |
| notifications_otp_ttl | Integer | OTP code time-to-live in seconds (default: 120) |
Notifier Data Object Structure
Both notifications_sms_notifier_data and notifications_email_notifier_data contain:
| Field | Type | Description |
|---|---|---|
| id | Integer | Notifier ID |
| name | String | Notifier display name |
Example Response
{
"notifications_sms_notifier_data": {
"id": 2,
"name": "ippanel_one"
},
"notifications_email_notifier_data": {
"id": 3,
"name": "moeinmail"
},
"notifications_otp_code_len": 6,
"notifications_otp_ttl": 120
}
Notes
- Id of the email and sms notifiers should be from the valid notifiers defined per project.