Skip to main content

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

FieldTypeRequiredDescription
notifications_sms_notifierIntegerNoID of the SMS notifier to use (nullable)
notifications_email_notifierIntegerNoID of the email notifier to use (nullable)
notifications_otp_code_lenIntegerNoLength of OTP codes (default: 5)
notifications_otp_ttlIntegerNoOTP code time-to-live in seconds (default: 120)

Notifier Data Object Structure Both notifications_sms_notifier_data and notifications_email_notifier_data contain:

FieldTypeRequiredDescription
idIntegerNoNotifier ID
nameStringNoNotifier display name

Example Requests

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

Response Fields

FieldTypeDescription
notifications_sms_notifier_dataObjectSMS notifier details with `id` and `name` fields
notifications_email_notifier_dataObjectEmail notifier details with `id` and `name` fields
notifications_otp_code_lenIntegerLength of OTP codes (default: 5)
notifications_otp_ttlIntegerOTP code time-to-live in seconds (default: 120)

Notifier Data Object Structure

Both notifications_sms_notifier_data and notifications_email_notifier_data contain:

FieldTypeDescription
idIntegerNotifier ID
nameStringNotifier 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.