Download OpenAPI specification:Download
The Customer Segment Service allows you to define segments for different customers so that you can prepare customer specific marketing campaigns, or prepare personalized content for different customers in each segment
Key Features:
Key Benefits:
Creates a new customer segment.
customersegment.segment_manage
- required to create a customer segmentCustomer segment was successfully created.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Conflict
{- "id": "628cd20c6e8b2432b6346ca6",
- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main"
}
{- "id": "628cd20c6e8b2432b6346ca6"
}
Retrieves all customer segments.
customersegment.segment_read
- allows you to retrieve all customer segmentscustomersegment.segment_read_own
- allows customers to retrieve customer segments which they are assigned toCustomer segments were successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "id": "628cd20c6e8b2432b6346ca6",
- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main",
- "metadata": {
- "createdAt": "2024-05-14T12:00:00.000Z",
- "modifiedAt": "2024-05-14T12:00:00.000Z",
- "version": 1
}
}, - {
- "id": "61ge81e13562e22001h6cf456",
- "name": {
- "en": "Platinum Segment"
}, - "description": {
- "en": "Platinum Segment"
}, - "validity": {
- "from": "2024-07-20T08:00:00.000Z",
- "to": "2025-07-20T08:00:00.000Z"
}, - "status": "INACTIVE",
- "siteCode": "main",
- "metadata": {
- "createdAt": "2024-05-14T12:00:00.000Z",
- "modifiedAt": "2024-05-14T12:00:00.000Z",
- "version": 1
}
}
]
Returns all customer segments that match provided criteria.
customersegment.segment_read
- allows you to retrieve all customer segmentscustomersegment.segment_read_own
- allows customers to retrieve customer segments which they are assigned toCustomer segments were successfully retrieved.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "q": "siteCode:main"
}
[- {
- "id": "628cd20c6e8b2432b6346ca6",
- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main",
- "metadata": {
- "createdAt": "2024-05-14T12:00:00.000Z",
- "modifiedAt": "2024-05-14T12:00:00.000Z",
- "version": 1
}
}, - {
- "id": "61ge81e13562e22001h6cf456",
- "name": {
- "en": "Platinum Segment"
}, - "description": {
- "en": "Platinum Segment"
}, - "validity": {
- "from": "2024-07-20T08:00:00.000Z",
- "to": "2025-07-20T08:00:00.000Z"
}, - "status": "INACTIVE",
- "siteCode": "main",
- "metadata": {
- "createdAt": "2024-05-14T12:00:00.000Z",
- "modifiedAt": "2024-05-14T12:00:00.000Z",
- "version": 1
}
}
]
Retrieves segment with specified ID.
customersegment.segment_read
- allows you to retrieve a customer segmentCustomer segment successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource not found
{- "id": "628cd20c6e8b2432b6346ca6",
- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main",
- "metadata": {
- "createdAt": "2024-05-14T12:00:00.000Z",
- "modifiedAt": "2024-05-14T12:00:00.000Z",
- "version": 1
}
}
Performs UPSERT
operation. If a segment with specified ID exists in the system, then it is updated. If it doesn't exist, a new customer segment is created.
customersegment.segment_manage
- required to update a customer segmentCustomer segment wasn't found. A new customer segment was successfully created.
Customer segment was successfully updated.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Conflict
{- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main",
- "metadata": {
- "version": 1
}
}
{- "id": "628cd20c6e8b2432b6346ca6"
}
Performs partial update of a segment.
The patch request consists of set of operation, that should be defined according to RFC-6902 standard.
customersegment.segment_manage
- required to update a customer segmentCustomer segment was successfully updated.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource not found
[- {
- "op": "replace",
- "path": "/status",
- "value": "INACTIVE"
}
]
{- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
Removes segment with specified ID.
Important: If you want to delete a segment that has items or customers assigned to it, you need to set the forceDelete
query parameter to true
. In this case, all items and customers assignments will be deleted as well.
customersegment.segment_manage
- required to delete a customer segmentCustomer segment was successfully deleted.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "fault": {
- "faultstring": "Invalid access token",
- "detail": {
- "errorcode": "oauth.v2.InvalidAccessToken"
}
}
}
Creates multiple customer segments.
customersegment.segment_manage
- required to create customer segmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "id": "628cd20c6e8b2432b6346ca6",
- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main"
}, - {
- "id": "61ge81e13562e22001h6cf456",
- "name": {
- "en": "Platinum Segment"
}, - "description": {
- "en": "Platinum Segment"
}, - "validity": {
- "from": "2024-07-20T08:00:00.000Z",
- "to": "2025-07-20T08:00:00.000Z"
}, - "status": "INACTIVE",
- "siteCode": "main"
}
]
[- {
- "index": 1,
- "id": "628cd20c6e8b2432b6346ca6",
- "code": 201,
- "status": "Created"
}, - {
- "index": 2,
- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
]
Performs UPSERT operation for multiple customer segments. If a segment with specified ID exists in the system, then it is updated. If it doesn't exist, a new customer segment is created.
customersegment.segment_manage
- required to update customer segmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "allOf": [
- {
- "id": "628cd20c6e8b2432b6346ca6"
}, - {
- "name": {
- "en": "Golden Segment"
}, - "description": {
- "en": "Golden Segment"
}, - "validity": {
- "from": "2024-04-17T08:00:00.000Z",
- "to": "2025-04-17T08:00:00.000Z"
}, - "status": "ACTIVE",
- "siteCode": "main",
- "metadata": {
- "version": 1
}
}
]
}, - {
- "id": "61ge81e13562e22001h6cf456",
- "name": {
- "en": "Platinum Segment"
}, - "description": {
- "en": "Platinum Segment"
}, - "validity": {
- "from": "2024-07-20T08:00:00.000Z",
- "to": "2025-07-20T08:00:00.000Z"
}, - "status": "INACTIVE",
- "siteCode": "main",
- "metadata": {
- "version": 2
}
}
]
[- {
- "index": 1,
- "id": "628cd20c6e8b2432b6346ca6",
- "code": 204,
- "status": "OK"
}, - {
- "index": 2,
- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
]
Removes multiple customer segments.
["firstId", "secondId", "thirdId"]
Important: If you want to delete a segment that has items or customers assigned to it, you need to set the forceDelete
query parameter to true
. In this case, all items and customers assignments will be deleted as well.
customersegment.segment_manage
- required to delete customer segmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "index": 1,
- "id": "628cd20c6e8b2432b6346ca6",
- "code": 204,
- "status": "OK"
}, - {
- "index": 2,
- "id": "61ge81e13562e22001h6cf456",
- "code": 204,
- "status": "OK"
}
]
Retrieves all customer assignments for a given customer segment.
customersegment.segment_read
- allows you to retrieve customer segment customerscustomersegment.segment_read_own
- allows customers to retrieve their own assignments to a customer segmentCustomer segment customers were successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "customer": {
- "id": "98029737",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john.doe@email.com"
}, - "legalEntity": {
- "id": "660af2af69babe3cf6e40771",
- "name": "SomeCompany"
}, - "assignmentType": "MANUAL",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}, - {
- "customer": {
- "customerId": "18249883",
- "firstName": "Jack",
- "lastName": "Smith",
- "email": "jack.smith@email.com"
}, - "legalEntity": {
- "id": "448gh29h1d0b5453g6346df6",
- "department": "AnotherCompany"
}, - "assignmentType": "MANUAL",
- "metadata": {
- "createdAt": "2024-10-16T12:00:00.000Z",
- "modifiedAt": "2024-10-16T12:00:00.000Z",
- "version": 1
}
}
]
Returns all customer assignments that match provided criteria.
customersegment.segment_read
- allows you to retrieve customer segment customerscustomersegment.segment_read_own
- allows customers to retrieve their own assignments to a customer segmentCustomer segment customers were successfully retrieved.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "q": "assignmentType:MANUAL"
}
[- {
- "customer": {
- "id": "98029737",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john.doe@email.com"
}, - "legalEntity": {
- "id": "660af2af69babe3cf6e40771",
- "name": "SomeCompany"
}, - "assignmentType": "MANUAL",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}, - {
- "customer": {
- "customerId": "18249883",
- "firstName": "Jack",
- "lastName": "Smith",
- "email": "jack.smith@email.com"
}, - "legalEntity": {
- "id": "448gh29h1d0b5453g6346df6",
- "department": "AnotherCompany"
}, - "assignmentType": "MANUAL",
- "metadata": {
- "createdAt": "2024-10-16T12:00:00.000Z",
- "modifiedAt": "2024-10-16T12:00:00.000Z",
- "version": 1
}
}
]
Retrieves a customer with specified customerId and companyId assigned to a customer segment.
customersegment.segment_read
- allows you to retrieve a customer segment customerCustomer segment customer was successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource not found
{- "customer": {
- "id": "98029737",
- "firstName": "John",
- "lastName": "Doe",
- "email": "john.doe@email.com"
}, - "legalEntity": {
- "id": "660af2af69babe3cf6e40771",
- "name": "SomeCompany"
}, - "assignmentType": "MANUAL",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}
Performs UPSERT
operation. Updates a customer assigned to a customer segment. A new customer assignment is created if it's not present in the system.
customersegment.segment_manage
- required to add and modify customer assignmentsA new customer assigment was successfully created.
Customer assignment was successfully updated.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Conflict
{- "mixins": {
- "someAdditionalAttribute": "someValue"
}, - "metadata": {
- "mixins": {
- "someAdditionalAttribute": "https://res.cloudinary.com/saas-ag/raw/upload/v1600077014/schemata/additionalAttribute.json"
}, - "version": 2
}
}
{- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
Removes customer assignment.
customersegment.segment_manage
- required to delete customer assignmentsCustomer assignment was successfully removed.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "fault": {
- "faultstring": "Invalid access token",
- "detail": {
- "errorcode": "oauth.v2.InvalidAccessToken"
}
}
}
Performs UPSERT
operation. Updates multiple customer assignments to a customer segment.
customersegment.segment_manage
- required to add and modify customer assignmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "allOf": [
- {
- "customerId": "98029737"
}, - {
- "legalEntityId": "660af2af69babe3cf6e40771"
}, - {
- "mixins": {
- "someAdditionalAttribute": "someValue"
}, - "metadata": {
- "mixins": {
- "someAdditionalAttribute": "https://res.cloudinary.com/saas-ag/raw/upload/v1600077014/schemata/additionalAttribute.json"
}, - "version": 2
}
}
]
}, - {
- "customerId": "18249883",
- "legalEntityId": "628cd20c6e8b2432b6346ca6",
- "metadata": {
- "version": 1
}
}
]
[- {
- "index": 1,
- "code": 204,
- "status": "OK"
}, - {
- "index": 2,
- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
]
Removes multiple customer assignments to a customer segment.
customerId
and legalEntityId
fields.[{"customerId": "firstCustomerId", "legalEntityId": "firstLegalEntityId"}, {"customerId": "secondCustomerId", "legalEntityId": "secondLegalEntityId"}, {"customerId": "thirdCustomerId", "legalEntityId": "thirdLegalEntityId"}]
customersegment.segment_manage
- required to delete customer assignmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "index": 1,
- "code": 204,
- "status": "OK"
}, - {
- "index": 2,
- "code": 204,
- "status": "OK"
}
]
Retrieves all item assignments for a given customer segment.
customersegment.segment_read
- allows you to retrieve all item assignmentsCustomer segment assignments were successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "item": {
- "id": "12468504",
- "code": "123",
- "name": {
- "en": "Hammer"
}
}, - "type": "PRODUCT",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}, - {
- "item": {
- "id": "12849186",
- "code": "456",
- "name": {
- "en": "Screwdriver"
}
}, - "type": "PRODUCT",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}
]
Retrieves all item assignments for a given customer segment.
customersegment.segment_read
- allows you to retrieve all item assignmentsCustomer segment assignments were successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "q": "type:PRODUCT"
}
[- {
- "item": {
- "id": "12468504",
- "code": "123",
- "name": {
- "en": "Hammer"
}
}, - "type": "PRODUCT",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}, - {
- "item": {
- "id": "12849186",
- "code": "456",
- "name": {
- "en": "Screwdriver"
}
}, - "type": "PRODUCT",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}
]
Retrieves an item assignment by specified ID for a given customer segment.
customersegment.segment_read
- allows you to retrieve an item assignmentCustomer segment item assignment was successfully retrieved.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Resource not found
{- "item": {
- "id": "12468504",
- "code": "123",
- "name": {
- "en": "Hammer"
}
}, - "type": "PRODUCT",
- "metadata": {
- "createdAt": "2024-10-12T12:00:00.000Z",
- "modifiedAt": "2024-10-12T12:00:00.000Z",
- "version": 1
}
}
Performs UPSERT
operation. Updates an item assignment to a customer segment. A new item assignment is created if it's not present in the system.
customersegment.segment_manage
- required to add and modify item assignmentsA new assigment was successfully created.
Item assignment was successfully updated.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
Conflict
{- "mixins": {
- "someAdditionalAttribute": "someValue"
}, - "metadata": {
- "mixins": {
- "someAdditionalAttribute": "https://res.cloudinary.com/saas-ag/raw/upload/v1600077014/schemata/additionalAttribute.json"
}, - "version": 1
}
}
{- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
Removes an item assignment.
customersegment.segment_manage
- required to delete item assignmentsItem assignment was successfully removed.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
{- "fault": {
- "faultstring": "Invalid access token",
- "detail": {
- "errorcode": "oauth.v2.InvalidAccessToken"
}
}
}
Performs UPSERT
operation. Updates multiple item assignments to a customer segments.
customersegment.segment_manage
- required to add and modify item assignmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "allOf": [
- {
- "id": "12468504"
}, - {
- "mixins": {
- "someAdditionalAttribute": "someValue"
}, - "metadata": {
- "mixins": {
- "someAdditionalAttribute": "https://res.cloudinary.com/saas-ag/raw/upload/v1600077014/schemata/additionalAttribute.json"
}, - "version": 1
}
}
]
}, - {
- "id": "12849186",
- "metadata": {
- "version": 2
}
}
]
[- {
- "index": 1,
- "code": 204,
- "status": "OK"
}, - {
- "index": 2,
- "code": 400,
- "status": "Bad Request",
- "message": "Validation problem with request body."
}
]
Removes multiple customer segments item assignments.
["firstItemId", "secondItemId", "thirdItemId"]
customersegment.segment_manage
- required to delete item assignmentsMulti-status response.
Bad request due to validation, incorrect parameters, etc.
Unauthorized
Access forbidden. The caller is not allowed to access this resource.
[- {
- "index": 1,
- "code": 204,
- "status": "OK"
}, - {
- "index": 2,
- "code": 204,
- "status": "OK"
}
]