Add people to a manual segment
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_ids 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.
- Type: integerFormat: int32segment
_id requiredThe 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.
- Type: stringenumid
_type The type of
idsyou want to use. All of the values in theidsarray must be of this type. If you don't provide this parameter, we assume that theidsarray containsidvalues.values- id
- email
- cio
_id
The IDs of people you want to add to the segment.
- Type: array string[] 1…1000idsrequired
The customer IDs you want to add to the segment. The type of value you pass in the array corresponds to the
id_typequery parameter—id,email, orcio_id. Entries in the array that don't match theid_typeare ignored.
- 200
A successful request returns an empty object response.
- application/json
- 401
Unauthorized request. Make sure that you provided the right credentials.
curl 'https://track.customer.io/api/v1/segments/1/add_customers?id_type=id' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic username:password' \
--data '{
"ids": [
"customer_id1",
"customer_id2"
]
}'
A successful request returns an empty object response.