newBooking or existingBookingId must be provided (mutually exclusive)newBooking is provided, a new booking is created with the segmentation ruleexistingBookingId is provided, the segmentation rule is added to the existing bookingcurl --location --request POST 'https://prod.your-api-server.com/booking/segmentation-rule' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"segmentationRule": {
"name": "Premium Store Selection",
"rules": {
"rule": "and",
"filters": [
{
"rule": "and",
"filters": [
{
"rule": "and",
"filters": [
{
"property": "store-list",
"operator": "in",
"value": "123e4567-e89b-12d3-a456-426614174000",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
]
}
]
}
]
},
"targetAssetIds": [
"987fcdeb-51a2-43d1-9f12-345678901234"
]
},
"newBooking": {
"name": "Q1 2024 Campaign",
"assetIds": [
"987fcdeb-51a2-43d1-9f12-345678901234"
],
"startDate": "2024-01-01",
"endDate": "2024-03-31",
"status": "reserved"
},
"categoryFilters": [
"electronics",
"fashion"
]
}'{
"_id": "456e7890-e89b-12d3-a456-426614174000",
"name": "Q1 2024 Campaign",
"code": "BOOK-2024-001",
"assetIds": [
"987fcdeb-51a2-43d1-9f12-345678901234",
"111fcdeb-51a2-43d1-9f12-345678901234"
],
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-03-31T23:59:59.999Z",
"status": "reserved",
"campaignIds": [],
"tradingPeriodIds": [],
"categoryFilters": {
"123e4567-e89b-12d3-a456-426614174001": [
"electronics",
"fashion"
]
},
"unavailableAssetIds": [
{
"bookedAssetId": "111fcdeb-51a2-43d1-9f12-345678901234",
"unavailableAssetId": "222fcdeb-51a2-43d1-9f12-345678901234"
}
],
"segmentationRuleId": "seg-rule-uuid-123",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}