Segment API

Create and manage dynamic contact segments to send targeted messages and automate tasks.

Authentication: All requests require an x-api-key header. Response: Successful requests return [200 OK] with the appropriate schema.

Endpoints

1. List/Search Segments

GET /v1/segments

Retrieve a list of available segments with optional filtering and search.

Query Parameters:

  • workspaceId (string, optional) – Filter by workspace ID

  • limit (string, optional) – Maximum number of results

  • page (string, optional) – Page number for pagination

  • searchText (string, optional) – Free text search

Response: [200 OK] – Array of Segment

2. Create a Segment

POST /v1/segments

Create a new dynamic segment.

Request Body: Segment (application/json) Response: [200 OK] – Segment

3. Get Segment by ID

GET /v1/segments/{segmentId}

Retrieve details of a specific segment by ID.

Path Parameters:

  • segmentId (string, required) – Unique segment ID

Response: [200 OK] – Segment

4. Delete Segment by ID

DELETE /v1/segments/{segmentId}

Delete a specific segment by ID.

Path Parameters:

  • segmentId (string, required) – Unique segment ID

Response: [200 OK] – DeleteResponse

Schemas

Segment Schema

SegmentsResponse Schema

DeleteResponse Schema

Last updated