Skip to main content

Segment API

Create and manage dynamic segments of contacts for targeted messaging and automation using the Segment API endpoints.


Endpoints

1. List/Search Segments

GET /v1/segments

  • Description: Retrieve a list of segments with optional filtering and search.
  • Authentication: Requires x-api-key header.

Query Parameters:

NameInTypeRequiredDescription
workspaceIdquerystringNoFilter by workspace ID
limitquerystringNoMax number of results
pagequerystringNoPage number for pagination
searchTextquerystringNoFree text search
x-api-keyheaderstringYesAPI authentication key

Response: [200 OK] - Array of Segment


2. Create a Segment

POST /v1/segments

  • Description: Create a new segment.
  • Authentication: Requires x-api-key header.

Request Body: Segment (application/json)

Response: [200 OK] - Segment


3. Get Segment by ID

GET /v1/segments/{segmentId}

  • Description: Retrieve a segment by its unique ID.
  • Authentication: Requires x-api-key header.

Path Parameters:

NameInTypeRequiredDescription
segmentIdpathstringYesSegment unique ID
x-api-keyheaderstringYesAPI authentication key

Response: [200 OK] - Segment


4. Delete Segment by ID

DELETE /v1/segments/{segmentId}

  • Description: Delete a segment by its unique ID.
  • Authentication: Requires x-api-key header.

Path Parameters:

NameInTypeRequiredDescription
segmentIdpathstringYesSegment unique ID
x-api-keyheaderstringYesAPI authentication key

Response: [200 OK] - DeleteResponse


Schemas

Segment Schema

{
"id": "string",
"name": "string",
"type": "string",
"status": "string",
"segments": [
{ "id": "string" }
],
"retargetBroadcast": {
"id": "string"
},
"retargetEngagementType": "string",
"scheduleDateTime": "string",
"startedAt": "string",
"completedAt": "string"
}

SegmentsResponse Schema

[
{ /* Segment object */ }
]

DeleteResponse Schema

{
"success": true
}