Atualizar webhook endpoint
/v1/webhook-endpoints/{id}Atualiza url, events, description e/ou status. status: DISABLED grava disabledReason: MANUAL (sem evento nem e-mail; entregas pendentes terminam CANCELED). status: ACTIVE zera failureCount, disabledAt e disabledReason; o que não foi entregue no período não é reenviado (usar redeliver).
X-Merchant-Id é opcional: credencial de organização sem o header atua no escopo ORGANIZATION (organização e todos os merchants do tenant); com o header, no escopo MERCHANT daquele merchant. Credencial de merchant atua sempre no próprio merchant.
kodanoOAuth webhooks:endpoints:writeAuthorizationBearer <token>Token obtido no Zitadel do ambiente (POST /oauth/v2/token), fora do host da API, e enviado em Authorization: Bearer <access_token>.
- Sandbox:
https://kodano-uat-p55zt6.us1.zitadel.cloud/oauth/v2/token - Produção:
https://kodano-prod-qe8hbt.us1.zitadel.cloud/oauth/v2/token
Use sempre o tokenUrl devolvido na emissão da credencial. Duas variantes: private_key_jwt (preferida; grant urn:ietf:params:oauth:grant-type:jwt-bearer com assertion RS256 assinada pela chave da credencial, iss = sub = userId, aud = authority do Zitadel, kid = keyId) e client_secret (grant client_credentials). O OpenAPI só modela a segunda.
O parâmetro scope do token é OIDC, não os escopos da API: openid urn:zitadel:iam:org:project:id:<projectId da API>:aud urn:zitadel:iam:user:resourceowner. Sem o :aud a API responde 401 AUTH.TOKEN_INVALID; sem resourceowner, 403 AUTH.TENANT_MISMATCH.
Os 28 escopos abaixo são os entitlements concedidos à credencial pelos produtos de integração (produto:recurso:ação; write não implica read), avaliados a cada requisição; não são pedidos no token. O tenant vem da organização do token; o merchant, de X-Merchant-Id. Revogar a credencial nega os tokens já emitidos em até 60 s.
Scope: webhooks:endpoints:write
id*stringId do webhook endpoint (whe_…).
X-Merchant-Id?stringOpcional. Credencial de organização sem o header atua no nível da organização; com o header, no merchant indicado. Fora do tenant, inexistente ou diferente do merchant da credencial de merchant → 403 MERCHANT.FORBIDDEN.
^mrc_[0-9a-f]{32}$X-Correlation-Id?stringOpcional, sempre ecoado na resposta e repetido em correlationId do Problem. Ausente ou inválido → o serviço gera UUID v7.
^[A-Za-z0-9._-]{1,64}$application/json- body
Ao menos um de url, events, description, status; scope/merchantId → 422.
1 <= propertiesurl?stringurilength <= 500events?array<>1 <= items <= 20description?stringlength <= 255status?string"ACTIVE""DISABLED"Endpoint atualizado.
application/json- response
id*string^whe_url*stringhttps, porta 443 ou 8443, sem fragmento nem userinfo.
urilength <= 500description*|length <= 255events*array<>1 <= items <= 20status*string"ACTIVE""DISABLED"scope*stringImutável.
"ORGANIZATION""MERCHANT"merchantId*|mrc_… no escopo MERCHANT; null no ORGANIZATION; imutável.
failureCount*integerFalhas de entrega desde o último 2xx (exclui TEST).
lastSuccessAt*|date-timelastFailureAt*|date-timedisabledAt*|date-timedisabledReason*|"MANUAL""AUTO_FAILURES"nullpreviousSecretExpiresAt*|Fim da janela em que o segredo anterior ainda assina.
date-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PATCH 'https://api.sandbox.kodano.com.br/v1/webhook-endpoints/string' \ -H 'X-Merchant-Id: mrc_e3cc4727054da558273162251e310d29' \ -H 'X-Correlation-Id: erp-7f3a-0010' \ -H 'Content-Type: application/json' \ -d '{ "events": [ "payment.succeeded", "payment.failed", "payment.refunded", "chargeback.received" ], "description": "ERP financeiro v2"}'{ "id": "whe_zQ7EUbzgd8SsjEVUqldLn3OYxujoQHxr", "url": "https://hooks.parceiro.com.br/kodano", "description": "ERP financeiro v2", "events": [ "payment.succeeded", "payment.failed", "payment.refunded", "chargeback.received" ], "status": "ACTIVE", "scope": "MERCHANT", "merchantId": "mrc_e3cc4727054da558273162251e310d29", "failureCount": 0, "lastSuccessAt": "2026-10-16T13:02:12Z", "lastFailureAt": null, "disabledAt": null, "disabledReason": null, "previousSecretExpiresAt": null, "createdAt": "2026-10-16T12:40:00Z", "updatedAt": "2026-10-16T14:05:00Z"}