/v1/management/campaign-audiencesBehavior
POST is a bounded read for audience filters, not a send or consent change. Follow the opaque nextCursor to read more candidates, retaining the original filters. Select explicit profile IDs for preview; the preview applies current eligibility again.
Authentication
ManagementCredential
Credential rules
One server-only owner-issued wbm_ API key can carry both management and integration permissions. Additional permissions require an explicit owner-issued grant. GET /v1/management returns the management discovery view, which may be empty for a booking-only key. For credentials with appointments:read, this discovery view omits whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write to preserve calendar-client compatibility. Discover these grants through GET /v1/management/messaging-capabilities. Template/profile command authorization still uses the stored grants. Server-only owner-issued Management authority with explicit application permissions. Calling this API does not expand a credential's grants. contacts:read/write/block/sync/fields:read/fields:write are separate approvals for canonical business contacts; fields also require current typed owner grants. contacts:record remains contact recording/recovery only. These grants create no customer phone proof, booking authority, messaging consent or automatic synchronization. Hours/blocks retain their independent resource grants. booking-policy:read/write separately delegate whole-business booking settings, without schedule/provider grants; write requires read. They preserve existing appointments and create no duration-rewrite authority. Provider duration policy additionally requires explicit provider-booking-policy:read/write and exact current providerIds; booking-duration:rewrite is separately approved and does not itself grant policy read/write. Service catalogue requires explicit services:read/write, independent of provider/calendar/schedule resources; write requires read. These operations do not expand an existing credential's grants. Public presentation and reviewed service selection require explicit website-content:read/write; write requires read, independently from services:* and provider resources. Existing provider metadata/activity/assignment additionally requires providers:read/write and a nonempty explicit current providerIds grant; write requires read. This grants no provider creation, deletion, login, invitation or schedule authority. WhatsApp template/profile management requires separate whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write application scopes. Write requires its matching read scope. These grants require explicit owner approval; Meta OAuth permissions remain separate.
Required application permissions
campaigns:read
An owner must separately grant campaign access to the whole business or selected active providers. Calendar and customer grants do not imply campaign access. A provider-scoped campaign uses one granted provider and appointment customers. Keep this Management key on your backend.
Request
Request body · required
application/json · BusinessCampaignAudienceQuery
Read-only candidate page. For segment.notSentBefore, supply templateName. Preserve the exact query and principal/resource selection while following nextCursor. Scoped credentials support appointment audiences for one currently active granted provider only.
-
providerIdanyOf (string | null)OptionalAt least one of these variants must match.
View nested fields
-
anyOf 1string · uuidSchema branch -
anyOf 2nullSchema branch
-
-
audienceoneOf (object | object | object)RequiredExactly one of these variants must match.
View nested fields
-
oneOf 1 · kind = "contacts"objectSchema branchView branch fields and rules
-
kindstringRequired in this branchValue:
"contacts" -
additionalPropertiesno value allowedSchema rule
-
-
oneOf 2 · kind = "appointments"objectSchema branchView branch fields and rules
-
kindstringRequired in this branchValue:
"appointments" -
fromstring · date-timeRequired in this branch -
tostring · date-timeRequired in this branch -
statusesarrayOptional in this branchDefaults to PENDING, CONFIRMED and NOW. Instants must satisfy from < to.
maxItems:3minItems:1View nested fields
-
[]stringArray itemAllowed values:
["PENDING","CONFIRMED","NOW"]
-
-
additionalPropertiesno value allowedSchema rule
-
-
oneOf 3 · kind = "segment"objectSchema branchView branch fields and rules
-
kindstringRequired in this branchValue:
"segment" -
filtersobjectRequired in this branchdependentRequired:{"visitedFrom":["visitedTo"],"visitedTo":["visitedFrom"]}View nested fields
-
awaystringOptional in this branchAllowed values:
["3w","1m","2m","3m"] -
visitsstringOptional in this branchAllowed values:
["none","one","recentRegular","regular"] -
backToBackstringOptional in this branchAllowed values:
["once","repeated"] -
lateRegularbooleanOptional in this branchValue:
true -
noUpcomingbooleanOptional in this branchValue:
true -
recentMissedbooleanOptional in this branchValue:
true -
newCustomersbooleanOptional in this branchValue:
true -
languagestringOptional in this branchAllowed values:
["he","ar","en"] -
notSentBeforebooleanOptional in this branchValue:
true -
lastVisitstringOptional in this branchAllowed values:
["within30","notSince60","notSince90"] -
overduebooleanOptional in this branchValue:
true -
missedbooleanOptional in this branchValue:
true -
providerIdstring · uuidOptional in this branch -
visitedFromstring · dateOptional in this branch -
visitedTostring · dateOptional in this branch -
additionalPropertiesno value allowedSchema rule
-
-
providerNameanyOf (string | null)Optional in this branchAt least one of these variants must match.
View nested fields
-
anyOf 1stringSchema branchAt most 160 JavaScript UTF-16 units in the submitted value and 80 Unicode codepoints after trimming. Blank becomes null.
maxLength:160pattern:"^\\s*[\\s\\S]{0,80}\\s*$" -
anyOf 2nullSchema branch
-
-
additionalPropertiesno value allowedSchema rule
-
-
-
searchstringOptionalmaxLength:200default:"" -
templateNameanyOf (string | null)OptionalAt least one of these variants must match.
View nested fields
-
anyOf 1stringSchema branchpattern:"^[a-z0-9_]{1,512}$" -
anyOf 2nullSchema branch
-
-
limitintegerOptionalminimum:1maximum:100default:50 -
cursoranyOf (string | null)OptionalAt least one of these variants must match.
View nested fields
-
anyOf 1stringSchema branchmaxLength:4096pattern:"^[A-Za-z0-9_-]+$" -
anyOf 2nullSchema branch
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"providerId": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
]
},
"audience": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"const": "contacts"
}
},
"required": [
"kind"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"const": "appointments"
},
"from": {
"type": "string",
"format": "date-time"
},
"to": {
"type": "string",
"format": "date-time"
},
"statuses": {
"type": "array",
"items": {
"type": "string",
"enum": [
"PENDING",
"CONFIRMED",
"NOW"
]
},
"maxItems": 3,
"minItems": 1,
"description": "Defaults to PENDING, CONFIRMED and NOW. Instants must satisfy from < to."
}
},
"required": [
"kind",
"from",
"to"
]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"kind": {
"const": "segment"
},
"filters": {
"type": "object",
"additionalProperties": false,
"properties": {
"away": {
"type": "string",
"enum": [
"3w",
"1m",
"2m",
"3m"
]
},
"visits": {
"type": "string",
"enum": [
"none",
"one",
"recentRegular",
"regular"
]
},
"backToBack": {
"type": "string",
"enum": [
"once",
"repeated"
]
},
"lateRegular": {
"const": true
},
"noUpcoming": {
"const": true
},
"recentMissed": {
"const": true
},
"newCustomers": {
"const": true
},
"language": {
"type": "string",
"enum": [
"he",
"ar",
"en"
]
},
"notSentBefore": {
"const": true
},
"lastVisit": {
"type": "string",
"enum": [
"within30",
"notSince60",
"notSince90"
]
},
"overdue": {
"const": true
},
"missed": {
"const": true
},
"providerId": {
"type": "string",
"format": "uuid"
},
"visitedFrom": {
"type": "string",
"format": "date"
},
"visitedTo": {
"type": "string",
"format": "date"
}
},
"required": [],
"dependentRequired": {
"visitedFrom": [
"visitedTo"
],
"visitedTo": [
"visitedFrom"
]
}
},
"providerName": {
"anyOf": [
{
"type": "string",
"maxLength": 160,
"pattern": "^\\s*[\\s\\S]{0,80}\\s*$",
"description": "At most 160 JavaScript UTF-16 units in the submitted value and 80 Unicode codepoints after trimming. Blank becomes null."
},
{
"type": "null"
}
]
}
},
"required": [
"kind",
"filters"
]
}
]
},
"search": {
"type": "string",
"maxLength": 200,
"default": ""
},
"templateName": {
"anyOf": [
{
"type": "string",
"pattern": "^[a-z0-9_]{1,512}$"
},
{
"type": "null"
}
]
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"anyOf": [
{
"type": "string",
"maxLength": 4096,
"pattern": "^[A-Za-z0-9_-]+$"
},
{
"type": "null"
}
]
}
},
"required": [
"audience"
],
"description": "Read-only candidate page. For segment.notSentBefore, supply templateName. Preserve the exact query and principal/resource selection while following nextCursor. Scoped credentials support appointment audiences for one currently active granted provider only."
} Successful responses
200 · BusinessCampaignAudiencePage
Current authorized result.
Cache-Control
{
"const": "no-store"
} application/json · BusinessCampaignAudiencePage
-
itemsarrayRequiredmaxItems:100View nested fields
-
[]objectArray itemView nested fields
-
profileIdstring · uuidRequired -
fullNameanyOf (string | null)RequiredAt least one of these variants must match.
View nested fields
-
anyOf 1stringSchema branchmaxLength:1024 -
anyOf 2nullSchema branch
-
-
phoneNumberstringRequiredmaxLength:64 -
languagestringRequiredmaxLength:16 -
additionalPropertiesno value allowedSchema rule
-
-
-
nextCursoranyOf (string | null)RequiredAt least one of these variants must match.
View nested fields
-
anyOf 1stringSchema branchmaxLength:4096pattern:"^[A-Za-z0-9_-]+$" -
anyOf 2nullSchema branch
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"profileId": {
"type": "string",
"format": "uuid"
},
"fullName": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "null"
}
]
},
"phoneNumber": {
"type": "string",
"maxLength": 64
},
"language": {
"type": "string",
"maxLength": 16
}
},
"required": [
"profileId",
"fullName",
"phoneNumber",
"language"
]
},
"maxItems": 100
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"maxLength": 4096,
"pattern": "^[A-Za-z0-9_-]+$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
]
} Errors and recovery
Input validation
413REQUEST_TOO_LARGEThe JSON request body exceeds 8,192 bytes.
415JSON_REQUIREDSend Content-Type: application/json.
Error responses declared in the contract (8)
The preview contract shares generic error definitions across operations. This list is not an exhaustive list of runtime errors.
401 · Missing, invalid or expired Management credential.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 403 · Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 405 · Unsupported method.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 413 · JSON body exceeds 8,192 bytes.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 415 · application/json is required.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 422 · Invalid request, UUID, query, cursor or precondition format.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 429 · Request rate limit; honor Retry-After.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
} 503 · Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.
application/json · Error
-
errorobjectRequiredView nested fields
-
codestringRequired -
requestIdstring · uuidRequired -
retryAfterintegerOptionalminimum:1 -
additionalPropertiesno value allowedSchema rule
-
-
additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
{
"type": "object",
"additionalProperties": false,
"properties": {
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"requestId": {
"type": "string",
"format": "uuid"
},
"retryAfter": {
"type": "integer",
"minimum": 1
}
},
"required": [
"code",
"requestId"
]
}
},
"required": [
"error"
]
}