Skip to main content
POST
/
api
/
webhooks
Configurar webhook da conta
curl --request POST \
  --url https://api.avista.global/api/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "https://api.example.com/webhooks/pix",
  "eventType": "cash_in",
  "headers": [
    {
      "key": "Authorization",
      "value": "Bearer token123"
    },
    {
      "key": "X-Webhook-Secret",
      "value": "abc123"
    }
  ]
}
'
{
  "success": true,
  "message": "Webhook configurado com sucesso"
}

Authorizations

Authorization
string
header
required

Enter JWT token

Body

application/json
url
string<uri>
required

URL HTTPS do endpoint que receberá os webhooks. Deve usar protocolo HTTPS.

Example:

"https://api.example.com/webhooks/pix"

eventType
enum<string>
required

Tipo de evento para receber notificações

Available options:
cash_in,
cash_out,
refund_in,
refund_out
Example:

"cash_in"

headers
object[]

Headers customizados para autenticação (máximo 5). Headers bloqueados: host, content-length, connection, transfer-encoding, content-type, user-agent

Maximum array length: 5
Example:
[
{
"key": "Authorization",
"value": "Bearer token123"
},
{
"key": "X-Webhook-Secret",
"value": "abc123"
}
]

Response

Webhook configurado com sucesso

success
boolean
required

Indica se a operação foi bem-sucedida

Example:

true

message
string
required

Mensagem descritiva do resultado

Example:

"Webhook configurado com sucesso"