Segmentation API

get
Get a Segment

https://api.customerglu.com/segment/v1/segment/:segmentId
Retrieve a segment detail from its id
Request
Response
Request
Path Parameters
segmentId
required
string
ID of the segment
Headers
Content-Type
required
string
application/json
Authentication
required
string
Authentication token(disabled for sandbox)
Response
200: OK
Cake successfully retrieved.
{
"succees": true,
"data": {
"id": "5fd385b22777090013c3374e",
"name": "Test Segment 43",
"description": "All the users in the test segment",
"filter": [],
"createdAt": "2020-12-11T14:44:02.146Z"
}
}
404: Not Found
Could not find a cake matching this query.
{
"success": false,
"error": {
"message": "Segment does not exist"
}
}

post
Create a Segment

https://api.customerglu.com/segment/v1/segment
Request
Response
Request
Headers
Content-Type
optional
string
application/json
Authentication
required
string
Body Parameters
description
optional
string
Details of the segment
filter
optional
array
Array of Glu Filter object(required only if using glu segmentation capability)
name
required
string
Name of the segment
Response
200: OK
{
"success": true,
"data": {
"id": "5fd385b22777090013c3374e",
"name": "Test Segment 43",
"description": "All the users in the test segment",
"filter": [],
"createdAt": "2020-12-11T14:44:02.146Z"
}
}

post
Add users to a Segment

https://api.customerglu.com/segment/v1/segment/:segmentId
Request
Response
Request
Headers
Content-Type
required
string
application
Body Parameters
users
required
string
Array of userIds to be added
segmentId
required
string
Segment Id to which users are to be added
Response
200: OK
{
"success": true,
"data": {
"users": [
"testuser1",
"testuser2"
],
"segmentId": "5fd34923c25a4768aa59e807",
"createdAt": "2020-12-11T14:45:06.867Z"
}
}

post
Remove users from Segment

https://api.customerglu.com/segment/v1/user/remove
Request
Response
Request
Headers
Content-Type
required
string
application
Body Parameters
segmentId
required
string
Segment Id to which users are to be removed
users
required
array
Array of userIds to be removed
Response
200: OK
{
"success": true,
"data": {
"users": [
"testuser1",
"testuser2"
],
"segmentId": "5fd34923c25a4768aa59e807",
"createdAt": "2020-12-11T14:45:06.867Z"
}
}

get
Retrieve segments for a user

https://api.customerglu.com/segment/v1/user/:userId
Request
Response
Request
Path Parameters
userId
required
string
userId of the user
Headers
Content-Type
required
string
application
Response
200: OK
{
"success": true,
"data": {
"userId": "testuser4",
"segments": [
"5ffef4444c390f7d4f1b9c8b",
"5ffef2ec4c390f7d4f1b9c86"
]
}
}