Flex alerts: Notification configuration API (public beta)
Public beta
Alerts is currently available as a public beta product and the information contained in this document is subject to change. This means that some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by a SLA.
All URLs referenced in this document have the following base:
https://flex-api.twilio.com
The NotificationConfigurations resource manages notification settings for Flex alerts.
POST /v1/Instances/{instanceSid}/NotificationConfigurations
Create a notification configuration for alerts in your Flex instance.
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| InstanceSid (required) | string | The unique SID identifier for the Flex instance. 34 characters. | GO00000000000000000000000000000001 | Not PII |
Your Flex instance is the container that holds your Flex resources. You can find your Flex instance SID in Console on the Flex overview page.
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| I-Twilio-Auth-Account (required) | string | The SID of the Flex account. | AC00000000000000000000000000000000 | Not PII |
Schema: application/json.
You can have a maximum of 100 notification configurations per Flex instance.
| Name | Type | Description | Default | PII |
|---|---|---|---|---|
| destinations (required) | object | The destination types of the notification. | - | Not PII |
| destinations.subscriptions | object or null | The configuration for subscription type notification. | null | Not PII |
| destinations.subscriptions.defaults | object or null | The default configuration for subscription type notification. | null | Not PII |
| destinations.subscriptions.defaults.archive | boolean or null | Archive the notification. | true | Not PII |
| destinations.subscriptions.defaults.enabled | boolean or null | Enable the notification. | true | Not PII |
| destinations.subscriptions.defaults.notification_type | array of strings unique | The type of the notification.in_app, browser_push, or toast | in_app | Not PII |
| destinations.subscriptions.recipients (required) | array of objects | There is a limit of 10 Flex user SIDs per notification configuration. These user sids can be part of the same recipient config or spread over multiple recipient configs. | - | Not PII |
| destinations.subscriptions.recipients.user_sids (required) | array of strings | The list of Flex users. | - | Not PII |
| destinations.subscriptions.recipients.notification_type | array of strings unique | Override the default notification type for the recipient. in_app, browser_push, or toast | - | Not PII |
| destinations.subscriptions.recipients.archive | boolean or null | Override the default archive configuration for the recipient. | null | Not PII |
| destinations.subscriptions.recipients.enabled | boolean or null | Override the default enabled configuration for the recipient. | null | Not PII |
| destinations.webhooks | object or null | The configuration for webhook type notification. | null | Not PII |
| destinations.webhooks.defaults | object or null | The default configuration for webhook type notification. | null | Not PII |
| destinations.webhooks.defaults.enabled | boolean or null | Enable the notification. | true | Not PII |
| destinations.webhooks.endpoints (required) | array of objects | There is a limit of one webhook endpoint per notification configuration. | - | Not PII |
| destinations.webhooks.endpoints.type (required) | string | The type of the webhook. slack, custom | - | Not PII |
| destinations.webhooks.endpoints.url (required) | string <url> | The webhook URL to which the notification will be sent. | - | Not PII |
| destinations.webhooks.endpoints.enabled | boolean or null | Override the default enabled configuration for the webhook. | null | Not PII |
| destinations.emails | object or null | The configuration for email type notification. | null | Not PII |
| destinations.emails.defaults | object or null | Default configuration for email type notification. | null | Not PII |
| destinations.emails.defaults.enabled | boolean or null | Enable email notifications. | true | Not PII |
| destinations.emails.email_recipients | array of objects | There is a limit of 10 email addresses per notification configuration. | - | PII MTL: 30 days |
| destinations.emails.email_recipients.email_address (required) | string <email> | The email address to which the notification will be sent. | - | PII MTL: 30 days |
| Name | Type | Description | Default | PII |
|---|---|---|---|---|
| ttid (required) | string | The TTID of the notification configuration. | - | Not PII |
| instance_sid (required) | string | The SID of the Flex instance. | - | Not PII |
| destinations (required) | object | The destination types of the notification. | - | Not PII |
| destinations.subscriptions | object or null | The configuration for subscription type notification. | null | Not PII |
| destinations.subscriptions.defaults | object or null | The default configuration for subscription type notification. | null | Not PII |
| destinations.subscriptions.defaults.archive | boolean or null | Archive the notification. | true | Not PII |
| destinations.subscriptions.defaults.enabled | boolean or null | Enable the notification. | true | Not PII |
| destinations.subscriptions.defaults.notification_type | array of strings unique | The type of the notification. in_app, browser_push, or toast | in_app] | Not PII |
| destinations.subscriptions.recipients (required) | array of objects | There is a limit of 10 Flex user SIDs per notification configuration. These user SIDs can be part of the same recipient configuration or spread over multiple recipient configs. | - | Not PII |
| destinations.subscriptions.recipients.user_sids (required) | array of strings | The list of Flex users. | - | Not PII |
| destinations.subscriptions.recipients.notification_type | array of strings unique | Override the default notification type for the recipient. in_app, browser_push, or toast | - | Not PII |
| destinations.subscriptions.recipients.archive | boolean or null | Override the default archive configuration for the recipient. | null | Not PII |
| destinations.subscriptions.recipients.enabled | boolean or null | Override the default enabled configuration for the recipient. | null | Not PII |
| destinations.webhooks | object or null | The configuration for webhook type notification. | null | Not PII |
| destinations.webhooks.defaults | object or null | The default configuration for webhook type notification. | null | Not PII |
| destinations.webhooks.defaults.enabled | boolean or null | Enable the notification. | true | Not PII |
| destinations.webhooks.endpoints (required) | array of objects | There is a limit of one webhook endpoint per notification configuration. | - | Not PII |
| destinations.webhooks.endpoints.type (required) | string | The type of the webhook. slack or custom | - | Not PII |
| destinations.webhooks.endpoints.url (required) | string <url> | The webhook URL to which the notification will be sent. | - | Not PII |
| destinations.webhooks.endpoints.enabled | boolean or null | Override the default enabled configuration for the webhook. | null | Not PII |
| destinations.emails | object or null | The configuration for email type notification. | null | Not PII |
| destinations.emails.defaults | object or null | The default configuration for email type notification. | null | Not PII |
| destinations.emails.defaults.enabled | boolean or null | Enable email notifications. | true | Not PII |
| destinations.emails.email_recipients | array of objects | There is a limit of 10 email addresses per notification configuration. | - | PII MTL: 30 days |
| destinations.emails.email_recipients.email_address (required) | string <email> | The email address to which the notification will be sent. | - | PII MTL: 30 days |
1curl -X POST "https://flex-api.twilio.com/v1/Instances/{instanceSid}/NotificationConfigurations" \2-H "Content-Type: application/json" \3-H "I-Twilio-Auth-Account: AC00000000000000000000000000000000" \4-d '{5"destinations": {6"subscriptions": {7"defaults": {8"archive": true,9"enabled": true,10"notification_type": [11"in_app"12]13},14"recipients": [15{16"user_sids": [17"string"18],19"notification_type": [20"in_app"21],22"archive": true,23"enabled": false24}25]26},27"webhooks": {28"defaults": {29"enabled": true30},31"endpoints": [32{33"type": "slack",34"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",35"enabled": false36}37]38},39"emails": {40"defaults": {41"enabled": true42},43"email_recipients": [44{45"email_address": "user@example.com"46}47]48}49}50}'
1{2"ttid": "flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8",3"instance_sid": "GO00000000000000000000000000000001",4"destinations": {5"subscriptions": {6"defaults": {7"archive": true,8"enabled": true,9"notification_type": [10"in_app"11]12},13"recipients": [14{15"user_sids": [16"string"17],18"notification_type": [19"in_app"20],21"archive": true,22"enabled": false23}24]25},26"webhooks": {27"defaults": {28"enabled": true29},30"endpoints": [31{32"type": "slack",33"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",34"enabled": false35}36]37},38"emails": {39"defaults": {40"enabled": true41},42"email_recipients": [43{44"email_address": "user@example.com"45}46]47}48}49}
GET /v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}
Retrieve a notification configuration for a given Flex instance.
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| InstanceSid (required) | string | The unique SID identifier for the Flex instance. 34 characters. | GO00000000000000000000000000000001 | Not PII |
| NotificationConfigTTID (required) | string | The TTID of the notification configuration. | flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8 | Not PII |
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| I-Twilio-Auth-Account (required) | string | The SID of the Flex account. | AC00000000000000000000000000000000 | Not PII |
1curl -X GET "https://flex-api.twilio.com/v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}" \2-H "Content-Type: application/json" \3-H "I-Twilio-Auth-Account: AC00000000000000000000000000000000"
1{2"ttid": "flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8",3"instance_sid": "GO00000000000000000000000000000001",4"destinations": {5"subscriptions": {6"defaults": {7"archive": true,8"enabled": true,9"notification_type": [10"in_app"11]12},13"recipients": [14{15"user_sids": [16"string"17],18"notification_type": [19"in_app"20],21"archive": true,22"enabled": false23}24]25},26"webhooks": {27"defaults": {28"enabled": true29},30"endpoints": [31{32"type": "slack",33"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",34"enabled": false35}36]37},38"emails": {39"defaults": {40"enabled": true41},42"email_recipients": [43{44"email_address": "user@example.com"45}46]47}48}49}
POST /v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}
Update an existing notification configuration for a Flex instance.
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| InstanceSid (required) | string | The unique SID identifier for the Flex instance. 34 characters. | GO00000000000000000000000000000001 | Not PII |
| NotificationConfigTTID (required) | string | The TTID of the notification configuration. | flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8 | Not PII |
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| I-Twilio-Auth-Account (required) | string | The SID of the Flex account. | AC00000000000000000000000000000000 | Not PII |
The request body must be in application/json format. This is used to update the notification configuration.
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| Destinations (required) | object | The destination types of the notification. | subscriptions, webhooks, or emails | Not PII |
1{2"destinations": {3"subscriptions": {4"defaults": {5"archive": true,6"enabled": true,7"notification_type": [8"in_app"9]10},11"recipients": [12{13"user_sids": [14"string"15],16"notification_type": [17"in_app"18],19"archive": true,20"enabled": false21}22]23},24"webhooks": {25"defaults": {26"enabled": true27},28"endpoints": [29{30"type": "slack",31"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",32"enabled": false33}34]35},36"emails": {37"defaults": {38"enabled": true39},40"email_recipients": [41{42"email_address": "user@example.com"43}44]45}46}47}
1{2"ttid": "flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8",3"instance_sid": "GO00000000000000000000000000000001",4"destinations": {5"subscriptions": {6"defaults": {7"archive": true,8"enabled": true,9"notification_type": [10"in_app"11]12},13"recipients": [14{15"user_sids": [16"string"17],18"notification_type": [19"in_app"20],21"archive": true,22"enabled": false23}24]25},26"webhooks": {27"defaults": {28"enabled": true29},30"endpoints": [31{32"type": "slack",33"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",34"enabled": false35}36]37},38"emails": {39"defaults": {40"enabled": true41},42"email_recipients": [43{44"email_address": "user@example.com"45}46]47}48}49}
DELETE /v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}
Delete a specific notification configuration for a given Flex instance.
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| InstanceSid (required) | string | The unique SID identifier for the Flex instance. 34 characters. | GO00000000000000000000000000000001 | Not PII |
| NotificationConfigTTID (required) | string | The TTID of the notification configuration. | flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8 | Not PII |
| Name | Type | Description | Example | PII? |
|---|---|---|---|---|
| I-Twilio-Auth-Account (required) | string | The SID of the Flex account. | AC00000000000000000000000000000000 | Not PII |
1curl -X DELETE "https://flex-api.twilio.com/v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}" \2-H "Content-Type: application/json" \3-H "I-Twilio-Auth-Account: AC00000000000000000000000000000000"
204 No content.