Segments
You can use the API to get or set segment information. A segment is a collection of contacts, defined by a specific set of attributes, used to filter them in a marketing campaign. User segmentation is the process of separating leads into distinct groups, or segments, based on shared characteristics. A company might segment leads based on language preferences, product version, geographical region.
Source: https://developer.tiledesk.com/apis/rest-api/segments
The Segment Model
id
String
The unique identifier for the segment which is given by Tiledesk.
name
String
The segment name
match
String
all or any
createdAt
String
The time (ISO-8601 date string) when the segment was created.
filters
Array
createdBy
String
The unique identifier of the row creator
id_project
String
The unique identifier of the project
Get all segments
GET https://api.tiledesk.com/v3/:project_id/segments
Example:
curl -v -X GET -H 'Content-Type: application/json' -u [email protected]:123456 https://api.tiledesk.com/v3/5b55e806c93dde00143163dd/segmentsGet a segment by id
GET https://api.tiledesk.com/v3/:project_id/segments/:id
Fetches a segment by its segment ID.
Path parameters
id (string) — the segment identifier
project_id (string) — The project_id is a unique code assigned to your project when you create it in Tiledesk
Headers
Authorization (string) — Authorization token. Basic Auth or JWT. Minimum role: agent
Content-Type (string) — use "application/json" value
Example:
Create a new segment
POST https://api.tiledesk.com/v3/:project_id/segments
Allows adding a new segment.
Path parameters
project_id (string) — The project_id is a unique code assigned to your project when you create it in Tiledesk
Headers
Authorization (string) — Authorization token. Basic Auth or JWT. Minimum role: agent
Content-Type (string) — use "application/json" value
Request body
name (string) — The segment name
match (string) — The segment match type. All or Any
filters (array) — The segment filters
Example:
Update a segment by id
PUT https://api.tiledesk.com/v3/:project_id/segments/:id
Allows updating a segment.
Path parameters
project_id (string) — The project_id is a unique code assigned to your project when you create it in Tiledesk
id (string) — The id is the segment identifier
Headers
Authorization (string) — Authorization token. Basic Auth or JWT. Minimum role: agent
Content-Type (string) — use "application/json" value
Request body
name (string) — The segment name
match (string) — The segment match type. All or Any
filters (array) — The segment filters
Delete a segment by id
DELETE https://api.tiledesk.com/v3/:project_id/segments/:id
Allows deleting a segment.
Path parameters
project_id (string) — The project_id is a unique code assigned to your project when you create it in Tiledesk
id (string) — The id is the segment identifier
Headers
Authorization (string) — Authorization token. Basic Auth or JWT. Minimum role: agent
Related
Segments API root: https://developer.tiledesk.com/apis/rest-api/segments
Privacy policy referenced on source site: https://tiledesk.com/privacy.html
(Original curl examples and URLs preserved.)