Flex Insights API General Usage


Before you start exporting data, you will need to have:

API Authentication

The procedure requires 2 API calls.

The first authenticates and returns an SST (Super Secured Token) using your login and password. Once the SST is available, a TT (Temporary Token) must be requested. The TT has to be included in any subsequent API calls.

In order to obtain the password for direct login, please contact the Flex Insights Support Team.

Loading Code Sample...

        Flex Insights - API Authentication

        SuperSecure Tokens (SST) have a default lifetime of two weeks.

        If you received a status code of 429, this means that you made too many invalid login requests. Check your credentials, and look for the Retry-After HTTP header in the response: this specifies the period (in seconds) after which you can attempt to log in again.

        Retrieving the Temporary Token

        You must have a valid Temporary Token (TT) for all subsequent calls to the API. To get a valid TT, use the following API:

        Loading Code Sample...

              Flex Insights - Get Temporary Token

              If you are using a REST client which supports cookies, on the initial login request you can set "verify_level": 0 and use the returned cookie called GDCAuthTT (which contains the Temporary Token) directly in subsequent API calls. This way, you don't need to adjust the Header manually.

              Temporary Token (TT) is valid for 10 minutes. Once the Temporary Token expires, you have to call the Token API to refresh it.

              Further Usage

              For any subsequent API calls, ensure that the TT is always passed in the headers as a cookie with the name GDCAuthTT

              Loading Code Sample...

                    Flex Insights - Usage Example

                    After successful authentication you can Export Data from Flex Insights via API.

                    Log out

                    After you performed all necessary operations, you should log out to invalidate the SST. For this, you need to know your profile ID which can be found in the API Authentication response. Note the {profile_id} is only the last part (the alphanumeric string) of the userLogin "profile" object: /gdc/account/profile/{profile_id}.

                    Loading Code Sample...

                          Flex Insights - API Log out

                          Delete a User Profile

                          If you no longer require access to the portal, you can delete your own profile from the Flex Insights Analytics Portal. After that, you will no longer be able to access the Analytics Portal and the Insights API with your direct credentials, and your user account will be removed from all workspaces. To get started, retrieve your profile_id from the profile link in the user login JSON response during authentication:


                          Run the following command to perform the deletion:

                          Loading Code Sample...

                                Flex Insights - API Delete a User Profile

                                Deleting a profile is only allowed for the currently logged in user. If you need to delete another user’s profile, please contact Twilio Support.

                                Rate this page:

                                Need some help?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Thank you for your feedback!

                                Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                Sending your feedback...
                                🎉 Thank you for your feedback!
                                Something went wrong. Please try again.

                                Thanks for your feedback!