> This page is for BaaS.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://en.docs.api.corpx.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://en.docs.api.corpx.com/_mcp/server.

# policy.violation

POST 

Uma regra de policy foi violada — recusa (BLOCK), aviso (NOTIFY_ONLY, ALLOW_AND_NOTIFY), devolução de PIX (AUTO_REFUND), valor travado (LOCK_BALANCE) ou saída cortada (BLOCK_ACCOUNT)

Uma regra de política configurada para a sua conta ou tenant foi violada. O evento cobre todas as seções de política — PIX out, recebimento, QR Code, chaves e estorno — e é enviado tanto quando a operação é **recusada** (`action: "BLOCK"`) quanto quando ela apenas **gera aviso** ou uma ação depois do crédito (`NOTIFY_ONLY`, `ALLOW_AND_NOTIFY`, `AUTO_REFUND`, `LOCK_BALANCE`, `BLOCK_ACCOUNT`). Use `blocked` para saber se a operação foi recusada. Num recebimento `blocked` é sempre `false`.

Reference: https://en.docs.api.corpx.com/baas/referencia/webhook-events/webhook-policy-violation

## Request

### Headers

- `X-Signature` (string, optional) — Present when the subscription uses `authType: HMAC`: `base64(HMAC_SHA256(secret, raw_request_body))` (standard Base64, with padding). Compare in constant time against your own computation over the raw body.

### Payload

- `id` (string, required) — Deterministic event id. Same `id` means the same event, possibly redelivered — deduplicate on it.
- `type` (enum, required) — Event type. Full list at `GET /v1/webhooks/events`.
  - Allowed values: `policy.violation`
- `occurredAt` (datetime, required) — RFC 3339, UTC with `Z`.
- `schemaVersion` (string, required) — `1.0` today; bumped only on breaking payload changes.
- `environment` (enum, required) — Environment that emitted the event.
  - Allowed values: `production`, `sandbox`
- `tenantId` (string, required) — Tenant the event belongs to.
- `data` (WebhooksWebhookPolicyViolationPayloadContentApplicationJsonSchemaData, required) — Event-specific payload. See each webhook.
- `accountId` (string, optional) — CorpX account where the event happened. Empty on cross-account events.

## Types

### WebhooksWebhookPolicyViolationPayloadContentApplicationJsonSchemaData

Event-specific payload. See each webhook.

- `phase` (string, optional)
- `action` (string, optional)
- `blocked` (boolean, optional)
- `paymentId` (string, optional)
- `accountId` (string, optional)
- `identifier` (string, optional)
- `mode` (string, optional)
- `amount` (double, optional)
- `violations` (list of WebhooksWebhookPolicyViolationPayloadContentApplicationJsonSchemaDataViolationsItems, optional)
- `counterparty` (WebhooksWebhookPolicyViolationPayloadContentApplicationJsonSchemaDataCounterparty, optional)

### WebhooksWebhookPolicyViolationPayloadContentApplicationJsonSchemaDataViolationsItems

- `rule` (string, optional)
- `message` (string, optional)

### WebhooksWebhookPolicyViolationPayloadContentApplicationJsonSchemaDataCounterparty

- `document` (string, optional)
- `name` (string, optional)