A valid request URL is required to generate request examples{
"id": "cmp-3f8a1c02-9d41-4c7b-8b12-6a0f5d7e2c33",
"name": "Soldes été 2026",
"channel": "email",
"segment": {
"segment": "champions",
"minMonetaryCents": 50000
},
"content": {
"subject": "Vos soldes en avant-première",
"body": "Profitez de -20% ce week-end."
},
"couponBatchRef": "SUMMER26",
"status": "draft",
"audienceCount": 0,
"recipientCount": 0,
"sentCount": 0,
"failedCount": 0,
"createdAt": "2026-07-28T09:00:00.000Z",
"updatedAt": "2026-07-28T09:00:00.000Z"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123,
"fieldErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}Author a marketing campaign (campagne)
Creates a campaign targeting a saved RFM segment over one channel. AUTHORING ONLY — nothing is sent here; call dryRunCampaign then sendCampaign for that. segment is the same predicate getCustomerSegmentation accepts (tier / minMonetaryCents / segment); an EMPTY object {} targets the whole base. You must supply either content (with a non-empty body; subject is email-only) or a pre-authored ESP templateId — sending neither is a 400. couponBatchRef attaches a coupon batch for redemption attribution. Omit scheduledAt to keep it a draft; supply an ISO-8601 instant to mark it scheduled. The id is minted server-side (cmp-<uuid>).
A valid request URL is required to generate request examples{
"id": "cmp-3f8a1c02-9d41-4c7b-8b12-6a0f5d7e2c33",
"name": "Soldes été 2026",
"channel": "email",
"segment": {
"segment": "champions",
"minMonetaryCents": 50000
},
"content": {
"subject": "Vos soldes en avant-première",
"body": "Profitez de -20% ce week-end."
},
"couponBatchRef": "SUMMER26",
"status": "draft",
"audienceCount": 0,
"recipientCount": 0,
"sentCount": 0,
"failedCount": 0,
"createdAt": "2026-07-28T09:00:00.000Z",
"updatedAt": "2026-07-28T09:00:00.000Z"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123,
"fieldErrors": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "<string>",
"statusCode": 123
}
}Authorizations
Authorization: Bearer <token>. Accepts EITHER a Keycloak access token (scopes-in-token) OR an opaque POS session token; both resolve to the same pos.* scope vocabulary the route guards enforce.
Body
1email, sms Show child attributes
Show child attributes
1Show child attributes
Show child attributes
1^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$Response
The authored campaign, with its server-minted id and zeroed counters.
The authored campaign, with its server-minted id and zeroed counters.
11email, sms Show child attributes
Show child attributes
draft, scheduled, sending, sent, failed 0 <= x <= 90071992547409910 <= x <= 90071992547409910 <= x <= 90071992547409910 <= x <= 9007199254740991^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$1Show child attributes
Show child attributes
1^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
