Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
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 friends@segment.com 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 Tokens(link takes you to an external page)Manage access tokens
Source Catalog(link takes you to an external page)Get info about all event and cloud sources
Destination Catalog(link takes you to an external page)Get info about all destinations
Workspaces(link takes you to an external page)Get info about workspaces
Sources(link takes you to an external page)Manage workspace sources
Destinations(link takes you to an external page)Manage workspace destinations
Tracking Plans(link takes you to an external page)Manage workspace tracking plans
Event Delivery Metrics(link takes you to an external page)Get event delivery metrics for cloud-mode destinations
Destination Filters(link takes you to an external page)Manage destination filters
IAM(link takes you to an external page)Manage workspace users and roles
Functions(link takes you to an external page)Manage Functions

To see all the API methods and models see the Segment Config API Reference(link takes you to an external page).

At this time there are no language-specific clients. However the API Reference(link takes you to an external page) also contains example code snippets for cURL, Go, Node, Python, and more.


Quick start

quick-start page anchor

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

$ brew install curl

Access tokens

access-tokens page anchor

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 API(link takes you to an external page) 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 Reference(link takes you to an external page).