The first step to use Segmentation studio is to access the API documentation on the link: https://dev-api.thingsolver.com/solver-segmentation-studio and it looks something like this:
On the left side, you can choose the name of the API endpoint that is referenced in this document.
Leaflets in segments
Leaflets are an important part of the segment API and there can be more of them.
Get all leaflets in segments
You can see the list of touchpoints by calling the endpoint:
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/leaflets
And the response will return a list of all created leaflets in segments.
{
"offset": 0,
"limit": 10,
"count": 4,
"leaflets": [
"leaflet-current",
"leaflet-test-10-products-c",
"leaflet-test-10-products-e",
"leaflet-test"
]
}
Get items on leaflet in segment
You can see the list of items on leaflet by calling the endpoint and passing leaflet-name from previous request:
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/leaflets/{leaflet-name}/items
Response is:
{
"offset":0,
"limit":10,
"count":383,
"items":[
{
"item_id":"SKU-ID_36256",
"item_url":"https://www.shop.com/SKU_35946",
"item_name":"SKU_35946",
"is_active":true,
"product_price":114.4,
"original_price":88.03,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35946.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_36257",
"product_url":"https://www.shop.com/SKU_35947",
"item_name":"SKU_35947",
"is_active":true,
"product_price":11.25,
"original_price":94.42,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35947.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_36258",
"product_url":"https://www.shop.com/SKU_35948",
"item_name":"SKU_35948",
"is_active":true,
"product_price":75.66,
"original_price":115.23,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35948.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24219",
"product_url":"https://www.shop.com/SKU_24094",
"item_name":"SKU_24094",
"is_active":true,
"product_price":26.98,
"original_price":99.78,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24094.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24220",
"product_url":"https://www.shop.com/SKU_24095",
"item_name":"SKU_24095",
"is_active":true,
"product_price":82.16,
"original_price":77.34,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24095.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24216",
"product_url":"https://www.shop.com/SKU_24091",
"item_name":"SKU_24091",
"is_active":true,
"product_price":16.54,
"original_price":48.56,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24091.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24217",
"product_url":"https://www.shop.com/SKU_24092",
"item_name":"SKU_24092",
"is_active":true,
"product_price":23.07,
"original_price":95.47,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24092.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24218",
"product_url":"https://www.shop.com/SKU_24093",
"item_name":"SKU_24093",
"is_active":true,
"product_price":31.65,
"original_price":73.52,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24093.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_36259",
"product_url":"https://www.shop.com/SKU_35949",
"item_name":"SKU_35949",
"is_active":true,
"product_price":22.48,
"original_price":82.44,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35949.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24209",
"product_url":"https://www.shop.com/SKU_24084",
"item_name":"SKU_24084",
"is_active":true,
"product_price":10.71,
"original_price":47.56,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24084.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
}
]
}
{
"offset":0,
"limit":10,
"count":383,
"items":[
{
"item_id":"SKU-ID_36256",
"item_url":"https://www.shop.com/SKU_35946",
"item_name":"SKU_35946",
"is_active":true,
"product_price":114.4,
"original_price":88.03,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35946.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_36257",
"product_url":"https://www.shop.com/SKU_35947",
"item_name":"SKU_35947",
"is_active":true,
"product_price":11.25,
"original_price":94.42,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35947.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_36258",
"product_url":"https://www.shop.com/SKU_35948",
"item_name":"SKU_35948",
"is_active":true,
"product_price":75.66,
"original_price":115.23,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35948.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24219",
"product_url":"https://www.shop.com/SKU_24094",
"item_name":"SKU_24094",
"is_active":true,
"product_price":26.98,
"original_price":99.78,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24094.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24220",
"product_url":"https://www.shop.com/SKU_24095",
"item_name":"SKU_24095",
"is_active":true,
"product_price":82.16,
"original_price":77.34,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24095.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24216",
"product_url":"https://www.shop.com/SKU_24091",
"item_name":"SKU_24091",
"is_active":true,
"product_price":16.54,
"original_price":48.56,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24091.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24217",
"product_url":"https://www.shop.com/SKU_24092",
"item_name":"SKU_24092",
"is_active":true,
"product_price":23.07,
"original_price":95.47,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24092.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24218",
"product_url":"https://www.shop.com/SKU_24093",
"item_name":"SKU_24093",
"is_active":true,
"product_price":31.65,
"original_price":73.52,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24093.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_36259",
"product_url":"https://www.shop.com/SKU_35949",
"item_name":"SKU_35949",
"is_active":true,
"product_price":22.48,
"original_price":82.44,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_35949.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
},
{
"item_id":"SKU-ID_24209",
"product_url":"https://www.shop.com/SKU_24084",
"item_name":"SKU_24084",
"is_active":true,
"product_price":10.71,
"original_price":47.56,
"date_added":"2021-11-26T09:00:00",
"images":[
],
"main_image":"SKU_24084.jpg",
"currency":"EUR",
"descriptions":[
],
"categories":null,
"custom":null,
"attributes":null
}
]
}
Segment CRUD
Get all segments
You can retrieve all segments by calling:
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments
And the response will return a list of all segments. We will display only one in this example but we give you several options out of the box.
{
"offset": 0,
"limit": 1,
"segments": [
{
"segment_id": "all_customers",
"segment_name": "all_customers",
"segment_type": "customers",
"source": "integration",
"author": "default",
"status": "created",
"is_dynamic": false,
"recommendations_export": {
"export_type": "recommender",
"recommendations_type": "default",
"number_of_recommendations": 10
},
"filter_groups": [],
"is_ready": null,
"segment_size": 719303,
"date_created": "2024-02-23T11:32:26",
"date_modified": "2024-02-23T11:32:26",
"column_names": []
}
],
"count": 14
}
Get specific segment
If you call an endpoint with specific segment, response will be similar:
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/Rfmt_6
Response is:
{
"segment_id": "Rfmt_6",
"segment_name": "Rfmt_6",
"segment_type": "customers",
"source": "integration",
"author": "default",
"status": "created",
"is_dynamic": false,
"recommendations_export": {
"export_type": "recommender",
"recommendations_type": "default",
"number_of_recommendations": 10
},
"filter_groups": [
{
"filter_group_order": 0,
"next_group_connector": "AND",
"values_connector": "AND",
"filters": [
{
"filter_order": 0,
"filter_group": "basic",
"filter_type": "categorical_filter",
"filter_name": "rfmt_segment_id",
"filter_entity": "",
"filter_option": "",
"values_operator": "equal",
"values_range": {
"min_value": "0",
"max_value": "0",
"date_from": "1900-01-01T00:00:00",
"date_to": "2024-02-09T11:50:58.162147"
},
"values": [
"6"
]
}
]
}
],
"is_ready": null,
"segment_size": 1062,
"date_created": "2024-02-09T13:45:31",
"date_modified": "2024-02-09T13:45:31",
"column_names": []
}
Create segment
You can create new segment with next request:
POST https://dev.thingsolver.com/api/latest/segmentation-studio/segments
Let’s create one segment with people between 37-45 years or having gender in male, female. When creating a segment, users can choose between static and dynamic segments. Dynamic segment is recalculating each time the user wants - with the same filters.
{
"segment_name": "New Segmentation segment 1409",
"author": "Violeta",
"status": "created",
"is_dynamic": false,
"segment_type": "customers",
"recommendations_export": {
"export_type": "recommender",
"recommendations_type": "default",
"number_of_recommendations": 10
},
"filter_groups": [
{
"filter_group_order": 0,
"next_group_connector": "OR",
"values_connector": "OR",
"filters": [
{
"filter_order": 0,
"filter_group": "basic",
"filter_type": "numerical_filter",
"filter_name": "age",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "between",
"values_range": {
"min_value": "37",
"max_value": "45",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": []
}
]
},
{
"filter_group_order": 1,
"next_group_connector": "OR",
"values_connector": "OR",
"filters": [
{
"filter_order": 0,
"filter_group": "basic",
"filter_type": "categorical_filter",
"filter_name": "gender",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "is_in",
"values_range": {
"min_value": "0",
"max_value": "0",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": [
"female",
"male"
]
}
]
}
]
}
You will get next response:
{
"segment_id": "segment-id-1efcfc3e16e94cd39f91ba07fd84eb09",
"segment_name": "New Segmentation segment 1409",
"segment_type": "customers",
"source": "segmentation",
"author": "Violeta",
"status": "created",
"is_dynamic": false,
"recommendations_export": {
"export_type": "recommender",
"recommendations_type": "default",
"number_of_recommendations": 10
},
"filter_groups": [
{
"filter_group_order": 0,
"next_group_connector": "OR",
"values_connector": "OR",
"filters": [
{
"filter_order": 0,
"filter_group": "basic",
"filter_type": "numerical_filter",
"filter_name": "age",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "between",
"values_range": {
"min_value": "37",
"max_value": "45",
"date_from": "2023-01-01T00:00:00",
"date_to": "2023-12-31T00:00:00"
},
"values": []
}
]
},
{
"filter_group_order": 1,
"next_group_connector": "OR",
"values_connector": "OR",
"filters": [
{
"filter_order": 0,
"filter_group": "basic",
"filter_type": "categorical_filter",
"filter_name": "gender",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "is_in",
"values_range": {
"min_value": "0",
"max_value": "0",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": [
"female",
"male"
]
}
]
}
],
"is_ready": null,
"segment_size": 583864,
"date_created": "2024-03-04T10:26:45",
"date_modified": "2024-03-04T10:26:45",
"column_names": []
}
Delete segment
Segment can be deleted with simple DELETE request.
Response:
{
"detail":"Segment deleted successfully!"
}
Segment config CRUD
Get all segment configs
You can retrieve all segments by calling:
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/segment-config
And the response will return a list of all segments. We will display only one in this example but we give you several options out of the box.
{
"offset": 0,
"limit": 10,
"count": 7,
"configs": [
{
"config_name": "export_meta_filters",
"config_value": "rfmt, recommender, customer_lifetime_value",
"predefined_config": false
}
]
}
Get specific segment config
If you call endpoint with specific segment, response will be similar:
Response is:
{
"config_value": "rfmt,customer_lifetime_value,recommender",
"predefined_config": true,
"config_name": "export_meta_filters"
}
Create segment config
You can create new segment config with next request:
POST https://dev.thingsolver.com/api/latest/segmentation-studio/segments/segment-config
Payload is:
{
"config_value": "rfmt,customer_lifetime_value,recommender",
"predefined_config": false,
"config_name": "meta_filters"
}
And response is:
{
"config_value": "rfmt,customer_lifetime_value,recommender",
"predefined_config": false,
"config_name": "meta_filters"
}
Update segment config
Only config_value can be changed with update segment config.
PUT https://dev.thingsolver.com/api/latest/segmentation-studio/segments/segment-config/meta_filters
{
"config_value": "customer_lifetime_value,recommender"
}
And response is:
{
"config_value": "customer_lifetime_value,recommender",
"predefined_config": false,
"config_name": "meta_filters"
}
Delete segment config
Segment config can be deleted with simple DELETE request
Note: Predefined config can’t be deleted.
DELETE https://dev.thingsolver.com/api/latest/segmentation-studio/segments/segment-config/meta_filters
Response:
{
"detail":"Segment config deleted successfully!"
}
Other endpoints used
Get list of available filters
If you call an endpoint with all available filter groups for a specific type of segment. Also, you can specify which only top_n_columns you want to retrieve with query param top_n_columns.
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/filters
You will get response:
{
"filters": [
{
"segment_type": "customers",
"available_filter_groups": {
"behavioural": {
"purchased": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "item | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
},
"not_purchased": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "item | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
},
"first_purchase": {
"filter_type": "time_range_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "customers",
"values": []
},
"last_purchase": {
"filter_type": "time_range_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "customers",
"values": []
},
"purchases": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
},
"total_spent": {
"filter_type": "time_range_value_filter",
"filter_option": "avg | min | max | sum",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
},
"order_value": {
"filter_type": "time_range_value_filter",
"filter_option": "avg | min | max | sum",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
},
"order_size": {
"filter_type": "time_range_value_filter",
"filter_option": "avg | min | max | sum",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
},
"dominant_store": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "customers",
"values": [
"GET /segmentation-studio/segments/filters/customers/behavioural/dominant_store"
]
}
},
"interactions": {
"visited": {
"filter_type": "time_range_value_filter",
"filter_option": "equal | contains",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "item | item_url | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /segmentation-studio/segments/filters/customers/interactions/visited",
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
},
"first_visit": {
"filter_type": "time_range_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "customers",
"values": []
},
"last_visit": {
"filter_type": "time_range_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "customers",
"values": []
},
"pageviews": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
},
"session": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
},
"session_duration": {
"filter_type": "time_range_value_filter",
"filter_option": "avg | min | max | sum",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": []
}
},
"advanced": {
"recommended": {
"filter_type": "recommended_filter",
"filter_option": "time-based | smart-recommender | time-based-leaflet | history-based-leaflet | smart-recommender-leaflet | community-based | community-based-leaflet | history-based | best-sellers | best-sellers-leaflet",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "item | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
},
"customer_lifetime_value": {
"filter_type": "numerical_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": [
"0.0",
"34309.6"
]
},
"most_loyal": {
"filter_type": "loyalty_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "item | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
},
"least_loyal": {
"filter_type": "loyalty_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "item | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
}
},
"basic": {
"gender": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "customers",
"values": [
"GET /segmentation-studio/segments/filters/customers/basic/gender"
]
},
"city": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "customers",
"values": [
"GET /segmentation-studio/segments/filters/customers/basic/city"
]
},
"browser": {
"filter_type": "categorical_list_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "customers",
"values": [
"GET /segmentation-studio/segments/filters/customers/basic/browser"
]
},
"device": {
"filter_type": "categorical_list_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "customers",
"values": [
"GET /segmentation-studio/segments/filters/customers/basic/device"
]
},
"age": {
"filter_type": "numerical_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "customers",
"values": [
"-35",
"124"
]
},
"email": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"phone_number": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"email_consent": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"sms_consent": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"viber_consent": {
"filter_type": "categorical_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"attribute_is_bounced": {
"filter_type": "flag_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"attribute_thingsolver_employee": {
"filter_type": "flag_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"attribute_is_unsubscribed": {
"filter_type": "flag_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
},
"attribute_is_complaint": {
"filter_type": "flag_filter",
"filter_option": "",
"values_operator": "have | have_not",
"filter_entity": "customers",
"values": []
}
},
"intersect": {
"part_of": {
"filter_type": "intersect_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "segments",
"values": [
"GET /segmentation-studio/segments"
]
},
"not_part_of": {
"filter_type": "intersect_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "segments",
"values": [
"GET /segmentation-studio/segments"
]
}
}
}
},
{
"segment_type": "visitors",
"available_filter_groups": {
"behavioural": null,
"interactions": {
"visited": {
"filter_type": "time_range_value_filter",
"filter_option": "equal | contains",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "item | item_url | attribute_author | attribute_gender | attribute_color | attribute_collection | attribute_brand | attribute_script | attribute_season | attribute_material | attribute_publisher | attribute_sport | attribute_genre | attribute_type | attribute_year_of_publication | attribute_format | attribute_supplier | attribute_cover | attribute_action | attribute_number_of_pages | attribute_price_range | category_level_1 | category_level_3 | category_level_4 | category_level_2 | category_level_0",
"values": [
"GET /segmentation-studio/segments/filters/customers/interactions/visited",
"GET /foundation/items/all",
"GET /foundation/items/categories"
]
},
"first_visit": {
"filter_type": "time_range_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "visitors",
"values": []
},
"last_visit": {
"filter_type": "time_range_filter",
"filter_option": "",
"values_operator": "",
"filter_entity": "visitors",
"values": []
},
"pageviews": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "visitors",
"values": []
},
"session": {
"filter_type": "time_range_value_filter",
"filter_option": "",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "visitors",
"values": []
},
"session_duration": {
"filter_type": "time_range_value_filter",
"filter_option": "avg | min | max | sum",
"values_operator": "equal | more_than | less_than | at_least | at_most | between",
"filter_entity": "visitors",
"values": []
}
},
"advanced": null,
"basic": {
"browser": {
"filter_type": "categorical_list_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "visitors",
"values": [
"GET /segmentation-studio/segments/filters/visitors/basic/browser"
]
},
"device": {
"filter_type": "categorical_list_filter",
"filter_option": "",
"values_operator": "equal | is_in | is_not_in | contains",
"filter_entity": "visitors",
"values": [
"GET /segmentation-studio/segments/filters/visitors/basic/device"
]
}
},
"intersect": null
}
}
]
}
Count segment
This endpoint is used when creating segments with filter_groups. This endpoint can have next query parameters:
- segment_breakdown (optional, boolean): Boolean flag can be passed as a query parameter to indicate if the segment should only be divided by RFMT segments. Defaults to false if not specified
- customers (optional, boolean): Boolean flag can be passed as a query parameter to indicate if the segment should be included in the preview. Defaults to false if not specified
- export (optional, boolean): Boolean flag can be passed as a query parameter to indicate if the segment should only be exported. Defaults to false if not specified
Payload is:
{
"filter_groups": [
{
"filter_group_order": 0,
"next_group_connector": "OR",
"values_connector": "AND",
"filters": [
{
"filter_order": 2,
"filter_group": "advanced",
"filter_type": "numerical_filter",
"filter_name": "customer_lifetime_value",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "more_than",
"values_range": {
"min_value": "5",
"max_value": "inf",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": []
},
{
"filter_order": 3,
"filter_group": "advanced",
"filter_type": "recommended_filter",
"filter_name": "recommended",
"filter_entity": "item",
"filter_option": "community-based",
"values_operator": "between",
"values_range": {
"min_value": "5",
"max_value": "100",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": [
"i_2186"
]
},
{
"filter_order": 1,
"filter_group": "basic",
"filter_type": "categorical_filter",
"filter_name": "gender",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "is_in",
"values_range": {
"min_value": "0",
"max_value": "0",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": [
"female",
"male"
]
},
{
"filter_order": 0,
"filter_group": "basic",
"filter_type": "numerical_filter",
"filter_name": "age",
"filter_entity": "customers",
"filter_option": "",
"values_operator": "between",
"values_range": {
"min_value": "37",
"max_value": "45",
"date_from": "2023-01-01 00:00:00",
"date_to": "2023-12-31 00:00:00"
},
"values": []
}
]
}
]
}
Response is:
{
"count": 14,
"segments": null,
"customers": null,
"export": false,
"export_location": "Export not requested"
}
Upload segment
Segment upload is a special feature that allows users to add customers from the database. Data can be in .csv or .xlsx format.
Upload route:
POST https://dev.thingsolver.com/api/latest/segmentation-studio/segments/upload-custom
Request body should be in form-data type so you can upload file:
curl -X POST "http://example.com/api/upload-custom" \
-H "Content-Type: multipart/form-data" \
-F "segment_name=New Customer Segment" \
-F "author=JohnDoe" \
-F "file=@/path/to/segment.csv"
Response is:
{
"detail": "Custom segment successfully uploaded",
"segment_id": segment_id
}
Intersect segment
This feature allows the user to perform basic set operations on two segments:
- union
- intersection
- difference
- symmetric difference.
POST https://dev.thingsolver.com/api/latest/segmentation-studio/segments/intersect
{
"author":"Violeta",
"segment_id_1":"segment-id-f438cb8e765348c9a7fcede121093fbe",
"segment_id_2":"segment-id-a487568a2e524f7987dfb67b5c78de13",
"intersect_operation":"intersection",
"new_segment_name":"Intersected segment 1309"
}
And response:
{
"detail":"Segment with ID: segment-id-7150ffb3d49147f79cd1b5c3e70a8bee has been created using intersection."
}
Here is the new segment:
Top N segment
Top N feature allows users to create a new segment with sorting and getting the exact number of customers the user wants. Export_only is a flag if the user only wants to export the segment, not to save it.
Note: the only columns used are those in the `/filters` route with the `top_n_columns` parameter set to `True`.
POST https://dev.thingsolver.com/api/latest/segmentation-studio/segments/top-n?export_only=false
{
"source_segment_id":"all_customers",
"author":"Violeta",
"new_segment_count":400,
"new_segment_name":"Top N 1309",
"sorting":[
{
"sort_by":"age",
"sort_order":"ascending"
}
]
}
Response is:
{
"detail":"Segment with ID: segment-id-ca9e8476de664a4fbff73ed38dff0bc8 has been created."
}
Here is the new segment:
Lookalike segment
With this feature, the user is able to expand the segment that is most similar to the chosen one, according to the characteristics that are most important.
Following options are available:
- Expand existing segment and keep both of them
- as new segment
- update existing segment
- Expand existing segment and keep just newly created
Options for feature selection - users can choose between the most critical attributes for comparison. For example, lookalike segments as X segments by these attributes: frequency of buying, lifestyle flag, recency, average basket value, etc.
POST https://dev.thingsolver.com/api/latest/segmentation-studio/segments/lookalike
{
"author":"Violeta",
"similarity_attributes":[
"total_website_visits_in_the_last_7_days",
"has_online_transactions_in_the_last_30_days",
"has_online_transactions_in_the_last_180_days",
"average_number_of_items_per_basket_in_the_last_30_days"
],
"target_number_of_customers":113,
"source_segment_id":"segment-id-f438cb8e765348c9a7fcede121093fbe",
"pull_segment_id":"segment-id-ca9e8476de664a4fbff73ed38dff0bc8",
"keep_base":true,
"boost_base":true,
"boost_base_segment_name":"Lookalike Base 1309",
"keep_incremental":true,
"keep_incremental_segment_name":"Lookalike Incremental 1309"
}
Response is:
{
"detail":"segment-id-f438cb8e765348c9a7fcede121093fbe - segment is expanding at the moment. This may take a while .. "
}
After calculation is finished, we can see new segments present in the list of segments:
Get customers lists (preview customers)
This method allows you to collect info about created segments with details including: customers first, last name, address, city, customer lifetime value, segment or even recommended products.
Request is:
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/Rfmt_3/customers
And response:
{
"offset":0,
"limit":10,
"count":139399,
"customers":[
{
"customer_id":"cu_28794",
"first_name":"Darlene",
"last_name":"Burgess",
"phone_number":null,
"email":null,
"gender":"female",
"age":null,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":160.808,
"product_1":"i_16456",
"item_2":"itm_2301",
"item_3":"i_4820",
"item_4":"i_12339",
"item_5":"itm_14353",
"item_6":"it_2250",
"item_7":"itms_5335",
"item_8":"it_4571",
"item_9":"i_7979",
"item_10":"i_15430"
},
{
"customer_id":"cu_31845",
"first_name":"Amber",
"last_name":"Davis",
"phone_number":null,
"email":null,
"gender":"female",
"age":null,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":111.99200000000002,
"item_1":"i_2540",
"item_2":"i_14173",
"item_3":"i_76",
"item_4":"i_39",
"item_5":"i_326",
"item_6":"i_265",
"item_7":"i_16",
"item_8":"i_128",
"item_9":"i_658",
"item_10":"i_101"
},
{
"customer_id":"cu_33006",
"first_name":"Edward",
"last_name":"Barrera",
"phone_number":null,
"email":null,
"gender":"male",
"age":null,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":233.588,
"item_1":"i_803",
"item_2":"i_617",
"item_3":"i_14358",
"item_4":"i_637",
"item_5":"i_503",
"item_6":"i_1616",
"item_7":"i_464",
"item_8":"i_409",
"item_9":"i_171",
"item_10":"i_14435"
},
{
"customer_id":"cu_42425",
"first_name":"Travis",
"last_name":"Cook",
"phone_number":null,
"email":null,
"gender":"male",
"age":null,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":82.18400000000001,
"item_1":"i_1",
"item_2":"i_2540",
"item_3":"i_39",
"item_4":"i_32",
"item_5":"i_89",
"item_6":"i_5",
"item_7":"i_167",
"item_8":"i_658",
"item_9":"i_101",
"item_10":"i_90"
},
{
"customer_id":"cu_46685",
"first_name":"Kari",
"last_name":"Nelson",
"phone_number":null,
"email":null,
"gender":"female",
"age":null,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":103.984,
"item_1":"i_3135",
"item_2":"i_17223",
"item_3":"i_4659",
"item_4":"i_122",
"item_5":"i_209",
"item_6":"i_2652",
"item_7":"i_215",
"item_8":"i_658",
"item_9":"i_1241",
"item_10":"i_88"
},
{
"customer_id":"c_101160",
"first_name":"Leslie",
"last_name":"Fuentes",
"phone_number":null,
"email":null,
"gender":"mostly_female",
"age":50,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":167.99200000000002,
"item_1":"i_837",
"item_2":"i_37",
"item_3":"i_617",
"item_4":"i_409",
"item_5":"i_2654",
"item_6":"i_364",
"item_7":"i_2953",
"item_8":"i_338",
"item_9":"i_2148",
"item_10":"i_277"
},
{
"customer_id":"c_104186",
"first_name":"Jack",
"last_name":"Bowman",
"phone_number":null,
"email":null,
"gender":"male",
"age":53,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":45.592000000000006,
"item_1":"i_1",
"item_2":"i_4327",
"item_3":"i_803",
"item_4":"i_100",
"item_5":"i_902",
"item_6":"i_190",
"item_7":"i_41",
"item_8":"i_13547",
"item_9":"i_507",
"item_10":"i_630"
},
{
"customer_id":"c_11028",
"first_name":"Austin",
"last_name":"Cox",
"phone_number":null,
"email":null,
"gender":"male",
"age":43,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":79.992,
"item_1":"i_567",
"item_2":"i_17111",
"item_3":"i_15",
"item_4":"i_274",
"item_5":"i_1370",
"item_6":"i_4332",
"item_7":"i_213",
"item_8":"i_17222",
"item_9":"i_402",
"item_10":"i_6257"
},
{
"customer_id":"c_114079",
"first_name":"Wendy",
"last_name":"Jones",
"phone_number":null,
"email":null,
"gender":"female",
"age":35,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":95.984,
"item_1":"i_17223",
"item_2":"i_215",
"item_3":"i_690",
"item_4":"i_362",
"item_5":"i_17221",
"item_6":"i_540",
"item_7":"i_803",
"item_8":"i_742",
"item_9":"i_2267",
"item_10":"i_2652"
},
{
"customer_id":"c_117697",
"first_name":"Ashley",
"last_name":"Gray",
"phone_number":null,
"email":null,
"gender":"mostly_female",
"age":37,
"city":"Rebekahburgh",
"rfmt_segment_id":"3",
"rfmt_segment_name":"standard",
"clv_value":119.99200000000002,
"item_1":"i_61",
"item_2":"i_103",
"item_3":"i_338",
"item_4":"i_17111",
"item_5":"i_567",
"item_6":"i_56",
"item_7":"i_1160",
"item_8":"i_66",
"item_9":"i_111",
"item_10":"i_251"
}
]
}
Export segment
Export segment feature is similar to the previous one, just download customers from segment in .csv or .xlsx file. File is sent to your email address and you can download it from the link.
Request:
And response is:
{
"detail":"Segment will be in your email soon!"
}
Open your email and click to link:
* NOTE: You only have 6 minutes to download the segment, after that the link expires.
Excel preview of downloaded segment:
Segment breakdown
Segment breakdown is an endpoint used to get breakdown by RFMT segments for specific segments created.
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/segment-id-1/segment-breakdown
Response is:
{
"segments": {
"Rfmt_3": 231182,
"Rfmt_2": 207147,
"Rfmt_1": 168426,
"Rfmt_0": 90943,
"Rfmt_4": 16811,
"Rfmt_5": 3590,
"Rfmt_6": 1204
},
"count": 719303
}
Segments containing customer
This endpoint is used to get all segments by customers.
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/cu_148292/customer-segments
Response is:
{
"customer": "cu_148292",
"segments": [
{
"segment_id": "all_customers",
"segment_name": "all_customers",
"count": 57391,
"is_dynamic": false,
"date_created": "2023-04-04T17:41:34"
}
]
}
RFMT Segments
This endpoint is used to get all RFMT segments.
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/rfmt
Response is:
{
"rfmt": [
{
"rfmt_segment_id": "Rfmt_5",
"rfmt_segment_size": 10564
},
{
"rfmt_segment_id": "Rfmt_6",
"rfmt_segment_size": 877
},
{
"rfmt_segment_id": "Rfmt_1",
"rfmt_segment_size": 182494
},
{
"rfmt_segment_id": "Rfmt_3",
"rfmt_segment_size": 243488
},
{
"rfmt_segment_id": "Rfmt_0",
"rfmt_segment_size": 34546
},
{
"rfmt_segment_id": "Rfmt_4",
"rfmt_segment_size": 131415
},
{
"rfmt_segment_id": "Rfmt_2",
"rfmt_segment_size": 115919
}
]
}
RFMT Segment by segment ID
This endpoint is used to get a specific RFMT segment.
GET https://dev.thingsolver.com/api/latest/segmentation-studio/segments/rfmt/Rfmt_6
Response is:
{
"rfmt_segment_id": "Rfmt_6",
"rfmt_segment_size": 877,
"offset": 0,
"limit":10,
"customers": [
"cu_61718",
"cu_124081",
"cu_140191",
"c_162202",
"c_214057"
]
}
Comments
0 comments
Please sign in to leave a comment.