Campanhas
Pré-visualizar público da campanha
Aplica listas, segmentos e regras de envio e devolve quantos contatos receberiam.
Permissão: product:campaigns.
AuthorizationBearer <token>
Chave de API criada no painel (API e integrações). Prefixos: zz_live_, zz_test_ (e os antigos wl_live_/wl_test_).
In: header
requestPreviewCampaignAudienceRequest
billing?object
Não usado nesta operação.
deadlineMs?integer
Prazo máximo da operação em milissegundos.
Default
30000Range
1 <= value <= 30000Response Body
curl -X POST "https://api.zynzap.com.br/v1/rpc/PreviewCampaignAudience" \ -H "Authorization: Bearer $ZYNZAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "request": {}}'{
"preview": {
"matched": "string",
"eligible": "string",
"exclusions": [
{
"reason": "string",
"count": "string"
}
],
"sample": [
{
"contact_id": "string",
"name": "string",
"phone": "string",
"email": "string",
"comm_status": "string",
"temperature": "string",
"qualification": "string",
"owner_user_id": "string",
"added_at_unix_ms": "string",
"added_source": "string",
"excluded_reason": "string",
"sources": [
"string"
]
}
],
"sources": [
{
"ref": "string",
"kind": "string",
"id": "string",
"label": "string",
"matched": "string",
"eligible": "string"
}
],
"truncated": true
},
"recipients": [
{
"contact_id": "string",
"phone": "string",
"name": "string",
"email": "string",
"variables": {
"property1": "string",
"property2": "string"
}
}
],
"senders": [
{
"session_id": "string",
"name": "string",
"phone": "string",
"connected": true
}
],
"max_recipients": "string"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "Requisição inválida para esta operação.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "RPC_REQUEST_INVALID"
}
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Credencial de API ausente, inválida ou revogada.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "API_AUTH_REQUIRED"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Este endereço IP não está autorizado a usar esta chave de API.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "API_KEY_IP_FORBIDDEN"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Não encontramos o recurso solicitado.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6"
}
}{
"error": {
"code": "CONFLICT",
"message": "A cotação expirou. Revise os custos novamente.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "BILLING_QUOTE_EXPIRED"
}
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "Requisição inválida para esta operação.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "RPC_REQUEST_INVALID"
}
}{
"error": {
"code": "RATE_LIMITED",
"message": "Limite de requisições desta chave atingido. Aguarde um instante.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "API_KEY_RATE_LIMITED"
}
}{
"error": {
"code": "UNAVAILABLE",
"message": "Resultado incerto. Confira o estado antes de repetir a operação.",
"requestId": "7f3c1a9e-2b4d-4c6e-8f10-a1b2c3d4e5f6",
"reason": "OUTCOME_UNCERTAIN"
}
}