Create a Flex instance programmatically
This page outlines how to authenticate and get started with the Flex Instances APIs. The Instances API lets you programmatically install Flex for existing Twilio accounts.
Twilio supports HTTP Basic authentication. Include the Basic Authentication header, using your API key SID as the username and your API key secret as the password. If a key is compromised or no longer used, revoke it to prevent unauthorized access.
For more information, see Twilio API requests.
https://flex-api.twilio.com
Create a Flex instance by sending a POST request to the following endpoint:
POST "https://flex-api.twilio.com/v2/Instances"
The following example shows a request to create a Flex instance:
1{2"conversations": {3"default": true4}5}
| Input | Type | Description |
|---|---|---|
conversations.default | Boolean | If true, the Flex conversation service created during provisioning is set as the account's default conversation service. |
A successful request returns a 201 Created status code and the following response:
1{2"flex_instance_sid": "GOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"status": "creation-in-progress",5"date_created": "2016-08-01T22:10:40Z",6"date_updated": "2016-08-01T22:10:40Z"7}
Fetch information about a Flex instance by sending a GET request to the following endpoint:
GET "https://flex-api.twilio.com/v2/Instances/INSTANCE_SID"
A successful request returns a 200 OK status code and the following response:
1{2"flex_instance_sid": "GOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"status": "ready",5"date_created": "2016-08-01T22:10:40Z",6"date_updated": "2016-08-01T22:10:40Z"7}