PUT
https://api.myidvirtual.com
/
webhooks
/
:id
Atualizar Webhook
curl --request PUT \
  --url https://api.myidvirtual.com/webhooks/:id \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "method": "<string>",
  "authorization": "<string>",
  "events": [
    {}
  ]
}
'
{
  "id": "webhook-id-123",
  "url": "https://novo-servidor.com/webhook",
  "method": "POST",
  "authorization": "Bearer novo-token",
  "events": ["payment.created"],
  "status": "active",
  "updatedAt": "2024-01-15T11:00:00.000Z"
}

Atualizar Webhook

Endpoint para atualizar as configurações de um webhook existente.

Autenticação

Authorization
string
required
Bearer token JWT do usuário autenticado

Parâmetros

id
string
required
ID do webhook

Request Body

url
string
Nova URL do webhook
method
string
Novo método HTTP
authorization
string
Novo token de autorização
events
array
Nova lista de eventos

Responses

{
  "id": "webhook-id-123",
  "url": "https://novo-servidor.com/webhook",
  "method": "POST",
  "authorization": "Bearer novo-token",
  "events": ["payment.created"],
  "status": "active",
  "updatedAt": "2024-01-15T11:00:00.000Z"
}

Exemplo de Requisição

curl --location --request PUT 'http://localhost:3333/webhooks/webhook-id-123' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data-raw '{
  "url": "https://novo-servidor.com/webhook",
  "events": ["payment.created"]
}'