Thanks to visit codestin.com
Credit goes to www.twilio.com

Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
Codestin Search App
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Config API Overview


(success)

The Segment Public API is available

Segment's Public API is available for Team and Business tier customers to use. You can use the Public API and Config APIs in parallel, but moving forward any API updates will come to the Public API exclusively. Please contact your account team or [email protected] with any questions.

The Config API lets you programmatically manage Segment workspaces, sources, destinations, and more.

With the Config API, you can:

  • List all your workspace sources and destinations to see how data flows through Segment.
  • Create new destinations - or delete them - with a few lines of code.
  • Create new users and assign them to scoped roles.
  • Configure, disable, or view sources and manage connected destinations.
  • Get a complete view of all the sources and destinations available in Segment's catalog.
  • Configure a Tracking Plan to see how data conforms to your expected schema.
  • Query Event Delivery metrics to build custom dashboards and alerts to monitor delivery of your events to destinations.
  • Filter entire events or individual fields from reaching specific destinations.

The Config API is a set of REST services under segmentapis.com:

ServiceDescription
Access TokensCodestin Search AppManage access tokens
Source CatalogCodestin Search AppGet info about all event and cloud sources
Destination CatalogCodestin Search AppGet info about all destinations
WorkspacesCodestin Search AppGet info about workspaces
SourcesCodestin Search AppManage workspace sources
DestinationsCodestin Search AppManage workspace destinations
Tracking PlansCodestin Search AppManage workspace tracking plans
Event Delivery MetricsCodestin Search AppGet event delivery metrics for cloud-mode destinations
Destination FiltersCodestin Search AppManage destination filters
IAMCodestin Search AppManage workspace users and roles
FunctionsCodestin Search AppManage Functions

To see all the API methods and models see the Segment Config API ReferenceCodestin Search App.

At this time there are no language-specific clients. However the API ReferenceCodestin Search App also contains example code snippets for cURL, Go, Node, Python, and more.


Quick start

Codestin Search App

You can call the API from the command line. First, install curl:

$ brew install curl

Access tokens

Codestin Search App

You can use the Config API with an access token to programmatically access Segment resources that the token can access. As of February 1, 2024, new Config API tokens cannot be created in the app as Segment moves toward exclusive support for the Public API. Migrate your implementation to the Public APICodestin Search App to access the latest features and available endpoints.

To create a new Config API token, contact Segment for support. These are currently only suitable for first party, trusted applications, such as your personal local scripts and server side programs. Partners should not prompt Segment users for their username and password and save an access token as a way to delegate access. See the Authentication doc for more information.

(warning)

Secret token

You can not retrieve the plain-text token later, so you should save it in a secret manager. If you lose the token you can generate a new one.

Now that you have an access token, you can use this token to access the rest of the Config API by setting it in the Authorization header of your requests, for example:

1
$ ACCESS_TOKEN=qiTgISif4zprgBb_5j4hXfp3qhDbxrntWwwOaHgAMr8.gg9ok4Bk7sWlP67rFyXeH3ABBsXyWqNuoXbXZPv1y2g
2
3
$ curl \
4
-X GET \
5
-H "Authorization: Bearer $ACCESS_TOKEN" \
6
https://platform.segmentapis.com/v1beta/workspaces

Example response:

1
{
2
"workspaces": [
3
{
4
"name": "workspaces/myworkspace",
5
"display_name": "My Space",
6
"id": "e5bdb0902b",
7
"create_time": "2018-08-08T13:24:02.651Z"
8
}
9
],
10
"next_page_token": ""
11
}

For an overview of the API's common design patterns and important information about versioning and compatibility, see the API Design document.

To see all the API methods and models see the Segment Config API ReferenceCodestin Search App.