v1.0.0
OpenAPI 3.1.0

List customers in a segment

US region

Client Libraries

List customers in a segment

Returns customers in a segment. This endpoint returns an array of identifiers; each object in the array represents a person and contains the identifier values allowed in your workspace. In general, we recommend that you use identifiers rather than ids to find people, because it provides more information.

If your workspace does not use email as a unique identifier for people, identifiers does not contain email values. Go to your Workspace Settings to find out which identifiers your workspace supports.

The ids array only lists ID values for people in a segment; if your workspace uses both email and id as identifiers, it's possible that a member of your segment does not have an id value, resulting in an empty string in the ids array.

Path Parameters
  • segment_id
    Type: integerFormat: int32
    required

    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.

Query Parameters
  • start
    Type: string

    The token for the page of results you want to return. Responses contain a next property. Use this property as the start value to return the next page of results.

  • limit
    Type: integer
    max:  
    30000

    The maximum number of results you want to retrieve per page.

Responses
  • application/json
  • 404

    The segment_id does not exist.

  • 429

    Your request is over the 10-per-second limit.

Request Example for get/v1/segments/{segment_id}/membership
curl 'https://api.customer.io/v1/segments/1/membership?start=&limit=1000' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "segment_id": 7,
  "ids": [
    "string"
  ],
  "identifiers": [
    {
      "email": "test@example.com",
      "id": 2,
      "cio_id": "a3000001"
    }
  ],
  "next": "string"
}