Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Flex alerts: Notification configuration API (public beta)


(new)

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.


Base URL

base-url page anchor

All URLs referenced in this document have the following base: https://flex-api.twilio.com


NotificationConfigurations resource

notificationconfigurations-resource page anchor

The NotificationConfigurations resource manages notification settings for Flex alerts.


Create a notification configuration

create-a-notification-configuration page anchor

POST /v1/Instances/{instanceSid}/NotificationConfigurations

Create a notification configuration for alerts in your Flex instance.

Path parameter

path-parameter page anchor
NameTypeDescriptionExamplePII?
InstanceSid (required)stringThe unique SID identifier for the Flex instance. 34 characters.GO00000000000000000000000000000001Not 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(link takes you to an external page) page.

NameTypeDescriptionExamplePII?
I-Twilio-Auth-Account (required)stringThe SID of the Flex account.AC00000000000000000000000000000000Not PII

Schema: application/json.

You can have a maximum of 100 notification configurations per Flex instance.

NameTypeDescriptionDefaultPII
destinations (required)objectThe destination types of the notification.-Not PII
destinations.subscriptionsobject or nullThe configuration for subscription type notification.nullNot PII
destinations.subscriptions.defaultsobject or nullThe default configuration for subscription type notification.nullNot PII
destinations.subscriptions.defaults.archiveboolean or nullArchive the notification.trueNot PII
destinations.subscriptions.defaults.enabledboolean or nullEnable the notification.trueNot PII
destinations.subscriptions.defaults.notification_typearray of strings uniqueThe type of the notification.in_app, browser_push, or toastin_appNot PII
destinations.subscriptions.recipients (required)array of objectsThere 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 stringsThe list of Flex users.-Not PII
destinations.subscriptions.recipients.notification_typearray of strings uniqueOverride the default notification type for the recipient. in_app, browser_push, or toast-Not PII
destinations.subscriptions.recipients.archiveboolean or nullOverride the default archive configuration for the recipient.nullNot PII
destinations.subscriptions.recipients.enabledboolean or nullOverride the default enabled configuration for the recipient.nullNot PII
destinations.webhooksobject or nullThe configuration for webhook type notification.nullNot PII
destinations.webhooks.defaultsobject or nullThe default configuration for webhook type notification.nullNot PII
destinations.webhooks.defaults.enabledboolean or nullEnable the notification.trueNot PII
destinations.webhooks.endpoints (required)array of objectsThere is a limit of one webhook endpoint per notification configuration.-Not PII
destinations.webhooks.endpoints.type (required)stringThe 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.enabledboolean or nullOverride the default enabled configuration for the webhook.nullNot PII
destinations.emailsobject or nullThe configuration for email type notification.nullNot PII
destinations.emails.defaultsobject or nullDefault configuration for email type notification.nullNot PII
destinations.emails.defaults.enabledboolean or nullEnable email notifications.trueNot PII
destinations.emails.email_recipientsarray of objectsThere 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
NameTypeDescriptionDefaultPII
ttid (required)stringThe TTID of the notification configuration.-Not PII
instance_sid (required)stringThe SID of the Flex instance.-Not PII
destinations (required)objectThe destination types of the notification.-Not PII
destinations.subscriptionsobject or nullThe configuration for subscription type notification.nullNot PII
destinations.subscriptions.defaultsobject or nullThe default configuration for subscription type notification.nullNot PII
destinations.subscriptions.defaults.archiveboolean or nullArchive the notification.trueNot PII
destinations.subscriptions.defaults.enabledboolean or nullEnable the notification.trueNot PII
destinations.subscriptions.defaults.notification_typearray of strings uniqueThe type of the notification. in_app, browser_push, or toastin_app]Not PII
destinations.subscriptions.recipients (required)array of objectsThere 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 stringsThe list of Flex users.-Not PII
destinations.subscriptions.recipients.notification_typearray of strings uniqueOverride the default notification type for the recipient. in_app, browser_push, or toast-Not PII
destinations.subscriptions.recipients.archiveboolean or nullOverride the default archive configuration for the recipient.nullNot PII
destinations.subscriptions.recipients.enabledboolean or nullOverride the default enabled configuration for the recipient.nullNot PII
destinations.webhooksobject or nullThe configuration for webhook type notification.nullNot PII
destinations.webhooks.defaultsobject or nullThe default configuration for webhook type notification.nullNot PII
destinations.webhooks.defaults.enabledboolean or nullEnable the notification.trueNot PII
destinations.webhooks.endpoints (required)array of objectsThere is a limit of one webhook endpoint per notification configuration.-Not PII
destinations.webhooks.endpoints.type (required)stringThe 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.enabledboolean or nullOverride the default enabled configuration for the webhook.nullNot PII
destinations.emailsobject or nullThe configuration for email type notification.nullNot PII
destinations.emails.defaultsobject or nullThe default configuration for email type notification.nullNot PII
destinations.emails.defaults.enabledboolean or nullEnable email notifications.trueNot PII
destinations.emails.email_recipientsarray of objectsThere 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
1
curl -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": false
24
}
25
]
26
},
27
"webhooks": {
28
"defaults": {
29
"enabled": true
30
},
31
"endpoints": [
32
{
33
"type": "slack",
34
"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",
35
"enabled": false
36
}
37
]
38
},
39
"emails": {
40
"defaults": {
41
"enabled": true
42
},
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": false
23
}
24
]
25
},
26
"webhooks": {
27
"defaults": {
28
"enabled": true
29
},
30
"endpoints": [
31
{
32
"type": "slack",
33
"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",
34
"enabled": false
35
}
36
]
37
},
38
"emails": {
39
"defaults": {
40
"enabled": true
41
},
42
"email_recipients": [
43
{
44
"email_address": "user@example.com"
45
}
46
]
47
}
48
}
49
}

Fetch a notification configuration for a Flex instance

fetch-a-notification-configuration-for-a-flex-instance page anchor

GET /v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}

Retrieve a notification configuration for a given Flex instance.

NameTypeDescriptionExamplePII?
InstanceSid (required)stringThe unique SID identifier for the Flex instance. 34 characters.GO00000000000000000000000000000001Not PII
NotificationConfigTTID (required)stringThe TTID of the notification configuration.flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8Not PII
NameTypeDescriptionExamplePII?
I-Twilio-Auth-Account (required)stringThe SID of the Flex account.AC00000000000000000000000000000000Not PII
1
curl -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": false
23
}
24
]
25
},
26
"webhooks": {
27
"defaults": {
28
"enabled": true
29
},
30
"endpoints": [
31
{
32
"type": "slack",
33
"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",
34
"enabled": false
35
}
36
]
37
},
38
"emails": {
39
"defaults": {
40
"enabled": true
41
},
42
"email_recipients": [
43
{
44
"email_address": "user@example.com"
45
}
46
]
47
}
48
}
49
}

Edit a notification configuration for a Flex instance

edit-a-notification-configuration-for-a-flex-instance page anchor

POST /v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}

Update an existing notification configuration for a Flex instance.

NameTypeDescriptionExamplePII?
InstanceSid (required)stringThe unique SID identifier for the Flex instance. 34 characters.GO00000000000000000000000000000001Not PII
NotificationConfigTTID (required)stringThe TTID of the notification configuration.flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8Not PII
NameTypeDescriptionExamplePII?
I-Twilio-Auth-Account (required)stringThe SID of the Flex account.AC00000000000000000000000000000000Not PII

The request body must be in application/json format. This is used to update the notification configuration.

NameTypeDescriptionExamplePII?
Destinations (required)objectThe destination types of the notification.subscriptions, webhooks, or emailsNot 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": false
21
}
22
]
23
},
24
"webhooks": {
25
"defaults": {
26
"enabled": true
27
},
28
"endpoints": [
29
{
30
"type": "slack",
31
"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",
32
"enabled": false
33
}
34
]
35
},
36
"emails": {
37
"defaults": {
38
"enabled": true
39
},
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": false
23
}
24
]
25
},
26
"webhooks": {
27
"defaults": {
28
"enabled": true
29
},
30
"endpoints": [
31
{
32
"type": "slack",
33
"url": "https://hooks.xyz.com/services/T0XX/B0XX/XXX",
34
"enabled": false
35
}
36
]
37
},
38
"emails": {
39
"defaults": {
40
"enabled": true
41
},
42
"email_recipients": [
43
{
44
"email_address": "user@example.com"
45
}
46
]
47
}
48
}
49
}

Delete a notification configuration for a Flex instance

delete-a-notification-configuration-for-a-flex-instance page anchor

DELETE /v1/Instances/{instanceSid}/NotificationConfigurations/{notificationConfigTTID}

Delete a specific notification configuration for a given Flex instance.

NameTypeDescriptionExamplePII?
InstanceSid (required)stringThe unique SID identifier for the Flex instance. 34 characters.GO00000000000000000000000000000001Not PII
NotificationConfigTTID (required)stringThe TTID of the notification configuration.flex_notificationconfiguration_01jt2gntpafkt9671avqj50sq8Not PII
NameTypeDescriptionExamplePII?
I-Twilio-Auth-Account (required)stringThe SID of the Flex account.AC00000000000000000000000000000000Not PII
1
curl -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.