DesenvolvedoresReferência da APIWebhooks

Criar endpoint de webhook

POST
/webhook-endpoints

Cadastra um endpoint HTTPS público. A resposta traz o segredo de assinatura (secret) uma única vez: guarde-o para validar o cabeçalho webhook-signature dos envios.

Chave: Só chave secreta (chamada pelo servidor).

Escopo: webhooks:write.

Idempotência: aceita o cabeçalho Idempotency-Key.

Limite: 60 requisições a cada 1 h, além do limite geral de 600 por minuto por chave.

Autorização

chaveSecreta
headerAutorizaçãoBearer <chave de API>

Chave secreta (sk_…). Use só no servidor; requisições de navegador (com Origin) são recusadas.

Cabeçalhos

Idempotency-Key?string

De 1 a 255 caracteres visíveis. Repetir a chamada com a mesma chave devolve a mesma resposta por 24 horas.

Corpo da requisição

application/json
  1. body
url*string

URL HTTPS pública, sem usuário, senha ou fragmento.

Tamanholength <= 2048
description?string
Tamanholength <= 255
kind?string
Padrão"generic"
Value in"generic""fulfillment_service"
eventTypes*array<>
Itens1 <= items

Corpo da resposta

Criado.

application/json
  1. response
data*
meta*
curl -X POST 'https://minepag.com.br/api/v1/webhook-endpoints' \  -H 'Content-Type: application/json' \  -d '{  "url": "string",  "eventTypes": [    "order.created"  ]}'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "kind": "generic",    "status": "enabled",    "url": "string",    "description": "string",    "eventTypes": [      "order.created"    ],    "consecutiveFailures": -9007199254740991,    "lastSucceededAt": "2019-08-24T14:15:22Z",    "lastFailedAt": "2019-08-24T14:15:22Z",    "disabledReason": "string",    "previousSecretExpiresAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "secret": "string"  },  "meta": {    "requestId": "string"  }}