- Webhooks
- Atualizar webhook
Webhooks
Atualizar webhook
Altera a URL ou os eventos de um webhook
PUT
/webhooks/{id}
curl --request PUT \
--url https://api.treeunfe.com.br/api/v1/webhooks/{id} \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "<string>",
"eventTypes": "<value>"
}'
curl --request PUT \
--url https://api.treeunfe.com.br/api/v1/webhooks/{id} \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "<string>",
"eventTypes": "<value>"
}'Altera a URL, os eventos ou a autenticação de um webhook. O ID continua o mesmo. Os campos são os mesmos de Criar webhook.
Autenticação
x-api-key
required
string
API Key da empresa.
Parâmetros de rota
id
required
string
ID do webhook.
Body
application/json
url
string
URL que recebe os avisos.
eventTypes
string[]
Eventos que disparam o aviso.
Respostas
| Status | Descrição |
|---|---|
200 | Webhook atualizado. |
400 | Dados inválidos. |
401 | x-api-key ausente ou inválida. |
404 | Webhook não encontrado. |
curl -X PUT "https://api.treeunfe.com.br/api/v1/webhooks/ID" \
-H "x-api-key: SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eventTypes": ["NFSE_AUTHORIZED", "NFSE_CANCELED", "NFSE_REJECTED"]
}'
curl -X PUT "https://api.treeunfe.com.br/api/v1/webhooks/ID" \
-H "x-api-key: SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"eventTypes": ["NFSE_AUTHORIZED", "NFSE_CANCELED", "NFSE_REJECTED"]
}'
curl --request PUT \
--url https://api.treeunfe.com.br/api/v1/webhooks/{id} \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "<string>",
"eventTypes": "<value>"
}'
curl --request PUT \
--url https://api.treeunfe.com.br/api/v1/webhooks/{id} \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"url": "<string>",
"eventTypes": "<value>"
}'