Check a rule against one person
const url = 'https://api.ebitex.io/audience/management/v1/audiences/check';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"predicate":"example","individualId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","behaviours":[{"id":"example","kind":"example","filter":"example","minCount":1,"days":1,"scope":"example","minMembers":1}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ebitex.io/audience/management/v1/audiences/check \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "predicate": "example", "individualId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "behaviours": [ { "id": "example", "kind": "example", "filter": "example", "minCount": 1, "days": 1, "scope": "example", "minMembers": 1 } ] }'Evaluates a rule, saved or not, against one real person and says why. Send { "predicate": { … }, "individualId": "…" }. The answer is the verdict (in, out, or depends when only the visit decides it), the person, and a trace of each group and condition with whether it held and the person’s own value in words. It changes nothing, so it needs only the read scope although it is a POST.
Key: an Audience management key with audience.management.read (write also needs read; erase needs both).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Examplegenerated
{ "predicate": "example", "individualId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "behaviours": [ { "id": "example", "kind": "example", "filter": "example", "minCount": 1, "days": 1, "scope": "example", "minMembers": 1 } ]}Responses
Section titled “ Responses ”{ "verdict", "person": { "id", "name" }, "trace": { … } }.
validation_failed: the rule is not a valid rule; errors names the part.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired, or it was not created from the Audience settings page.
payment_required: the organization’s subscription needs attention.
scope_denied: the key lacks this route’s scope. ip_denied: the caller’s address is outside the key’s allowed ranges. app_not_available: Audience is not enabled for the organization.
individual_not_found: no such person in this organization.
not_found: no such route.
rate_limited: the key spent its requests-per-minute budget; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.