Customer.io Track Segments API

Manual segments are lists of people that you incorporate using the API or by uploading CSVs. You can add people to, or remove people from, manual segments with these endpoints. These endpoints do _not_ let you modify data-driven segments. **NOTE**: These endpoints do not yet support workspaces that use both `email` and `id` as identifiers. A segment must exist before you can add people to it. You can create manual segments using the [App API `/segments` endpoints](/api/#operation/createManSegment).

Business capability
Customer Segmentation Management BC-420.20

Operations 2

POST /api/v1/segments/{segment_id}/add_customers Add people to a manual segment #
POST /api/v1/segments/{segment_id}/remove_customers Remove people from a manual segment #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/customer-io-track-segments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

customer-io-track-segments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.0.0
  title: Customer.io Track Track Segments API
  description: '# Overview


    Our Track API provides ways to send real-time customer data to your Customer.io workspace including customer identification and event tracking.'
servers:
- url: https://track.customer.io
  description: The base URL for the Track API. Track endpoints use basic authentication with your Site ID as the user name and your secret key as the password.
- url: https://track-eu.customer.io
  description: The base URL for the Track API (EU region). Track endpoints use basic authentication with your Site ID as the user name and your secret key as the password.
tags:
- name: Track Segments
  x-displayName: Segments
  description: 'Manual segments are lists of people that you incorporate using the API or by uploading CSVs. You can add people to, or remove people from, manual segments with these endpoints. These endpoints do _not_ let you modify data-driven segments.


    **NOTE**: These endpoints do not yet support workspaces that use both `email` and `id` as identifiers.


    A segment must exist before you can add people to it. You can create manual segments using the App API `/segments` endpoints.'
paths:
  /api/v1/segments/{segment_id}/add_customers:
    parameters:
    - $ref: '#/components/parameters/segment_id'
    - $ref: '#/components/parameters/id_type_segment'
    post:
      tags:
      - Track Segments
      operationId: add_to_segment
      summary: Add people to a manual segment
      description: 'Add people to a manual segment by ID. You are limited to 1000 customer IDs per request.


        This endpoint lets you add people to manual segments, but a segment must exist before you can add people to it. You can create and find manual segments using the App API.


        When you call this API, you can pass an `id_type` query parameter determining the type of identifier you want to use, `id`, `email`, or `cio_id`; If you don''t pass this parameter, it defaults to `id`. The request body always uses `ids`, even though it''ll accept either IDs, emails, or `cio_id`s depending on the query parameter. Everybody in the payload must use the same kind of identifier; we''ll ignore values in the `ids` array that don''t match the `id_type` parameter.


        **NOTE**: You cannot add people to data-driven segments using the API. See our documentation on segments for more information about segments.'
      servers:
      - url: https://track.customer.io
        description: This endpoint is a part of the Track API. Track endpoints use basic authentication with your Site ID as the user name and your secret key as the password.
      security:
      - Tracking-API-Key: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: The IDs of people you want to add to the segment.
              required:
              - ids
              properties:
                ids:
                  type: array
                  description: The customer IDs you want to add to the segment. The type of value you pass in the array corresponds to the `id_type` query parameter—`id`, `email`, or `cio_id`. Entries in the array that don't match the `id_type` are ignored.
                  maxItems: 1000
                  minItems: 1
                  items:
                    description: The customer IDs you want to add to the segment.
                    type: string
            example:
              ids:
              - customer_id1
              - customer_id2
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
      x-codeSamples:
      - lang: json
        label: JSON
        source: "{\n  \"ids\": [\n    \"customer_id1\",\n    \"customer_id2\"\n  ]\n}"
  /api/v1/segments/{segment_id}/remove_customers:
    parameters:
    - $ref: '#/components/parameters/segment_id'
    - $ref: '#/components/parameters/id_type_segment'
    post:
      tags:
      - Track Segments
      operationId: remove_from_segment
      summary: Remove people from a manual segment
      description: 'You can remove users from a manual segment by ID. You are limited to 1000 customer IDs per request.


        This endpoint requires people to have `id` attributes. If your workspace does not use `id` as an identifier, or you have not assigned people `id` values, you cannot remove people from manual segments using the API. Our user interface does not have this limitation. You can remove people from manual segments through the UI as a part of a campaign workflow.


        **NOTE**: You cannot remove people from data-driven segments using the API. See our documentation on segments for more information about segments.'
      servers:
      - url: https://track.customer.io
        description: This endpoint is a part of the Track API. Track endpoints use basic authentication with your Site ID as the user name and your secret key as the password.
      security:
      - Tracking-API-Key: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: The IDs of people you want to remove from the segment.
              required:
              - ids
              properties:
                ids:
                  type: array
                  description: The customer IDs you want to remove from the segment.
                  maxItems: 1000
                  minItems: 1
                  items:
                    description: The customer IDs you want to remove from the segment.
                    type: string
            example:
              ids:
              - customer_id1
              - customer_id2
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
      x-codeSamples:
      - lang: json
        label: JSON
        source: "{\n  \"ids\": [\n    \"customer_id1\",\n    \"customer_id2\"\n  ]\n}"
components:
  parameters:
    id_type_segment:
      name: id_type
      required: false
      in: query
      description: The type of `ids` you want to use. All of the values in the `ids` array must be of this type. If you don't provide this parameter, we assume that the `ids` array contains `id` values.
      schema:
        type: string
        enum:
        - id
        - email
        - cio_id
        default: id
    segment_id:
      name: segment_id
      in: path
      required: true
      description: The identifier for a segment. You can find your segment's ID on its page in the dashboard—go to *Segments*, select your segment, and find the ID under *Usage*. Or you can find your segment using the [App API](#tag/Segments).
      schema:
        type: integer
        format: int32
  responses:
    '401':
      description: Unauthorized request. Make sure that you provided the right credentials.
    '200':
      description: A successful request returns an empty object response.
    '400':
      description: Invalid or malformed request.
      content:
        application/json:
          schema:
            type: object
            properties:
              meta:
                type: object
                properties:
                  errors:
                    type: array
                    description: An array of errors.
                    items:
                      type: string
                      description: Error descriptions.
  securitySchemes:
    Tracking-API-Key:
      type: http
      scheme: basic
      description: 'The Track API uses a basic authentication scheme. Your credentials are your **Site ID** and your **API key**, **Base-64 encoded** in the format `site_id:api_key`.


        You can find your Site ID and API key on the [Track API Keys page](https://fly.customer.io/settings/api_credentials).

        '