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:
Name | In | Type | Required | Description |
---|---|---|---|---|
workspaceId | query | string | No | Filter by workspace ID |
limit | query | string | No | Max number of results |
page | query | string | No | Page number for pagination |
searchText | query | string | No | Free text search |
x-api-key | header | string | Yes | API 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:
Name | In | Type | Required | Description |
---|---|---|---|---|
segmentId | path | string | Yes | Segment unique ID |
x-api-key | header | string | Yes | API 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:
Name | In | Type | Required | Description |
---|---|---|---|---|
segmentId | path | string | Yes | Segment unique ID |
x-api-key | header | string | Yes | API 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
}