v1.0.0
OpenAPI 3.1.0

Remove people from a manual segment

US region

Client Libraries

Remove people from a manual segment

​

You can remove users from a manual segment by ID. You are limited to 1000 customer IDs per request.

When you call this API, you can pass an id_type query parameter to set the type of identifier you want to use: id, email, cio_id, or phone. If you don't pass this parameter, it defaults to id. The request body always uses ids, whichever type you choose, and every value in ids must be of that type.

This endpoint doesn't check that the people in ids exist before it returns a response, and it doesn't create new profiles.

Your workspace must support email or phone as identifiers to support these values. These are on by default in new workspaces.

NOTE: You cannot remove people from data-driven segments using the API. See our documentation on segments for more information about segments.

Path Parameters
  • segment_id
    Type: integer Format: 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
  • id_type
    Type: string enum

    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.

    values
    • id
    • email
    • cio_id
    • phone
Body
application/json

The IDs of people you want to remove from the segment.

  • ids
    Type: array string[] 1…1000
    required

    The identifiers of the people you want to remove from the segment, all of the type you set in the id_type query parameter. Pass phone numbers in E.164 format, like +14165552368.

Responses
  • 200

    A successful request returns an empty object response.

  • application/json
  • 401

    Unauthorized request. Make sure that you provided the right credentials.

  • 403

    A public key (pk_) can't call this endpoint. Use a private key (sk_) or your legacy Site ID and Track API key.

Request Example for post/api/v1/segments/{segment_id}/remove_customers
{
  "ids": [
    "customer_id1",
    "customer_id2"
  ]
}
No Body