> ## Documentation Index
> Fetch the complete documentation index at: https://scaleup-c34c4386.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH /api/v1/webhook-endpoints/:id

> Atualiza as configurações de um endpoint de webhook

Atualiza um endpoint de webhook existente. Apenas os campos enviados serão modificados.

## Autenticação

> [!NOTE]
>
> Requer um token de acesso válido (`CHARGEFY_ACCESS_TOKEN`) no header `Authorization`.

## Parâmetros de Path

| Parâmetro | Tipo | Obrigatório | Descrição |
| - | - | - | - |
| `id` | `string` | Sim | ID do endpoint |

## Parâmetros do Body

| Parâmetro | Tipo | Obrigatório | Descrição |
| - | - | - | - |
| `url` | `string` | Não | Nova URL do endpoint |
| `events` | `array` | Não | Nova lista de eventos |
| `status` | `string` | Não | Novo status (`active`, `disabled`) |

## Campos da Resposta

Retorna o objeto completo do endpoint atualizado.

## Exemplo de Requisição

```bash cURL theme={null}
curl -X PATCH "https://api.chargefy.io/api/v1/webhook-endpoints/we_abc123" \
  -H "Authorization: Bearer $CHARGEFY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "events": ["subscription.created", "subscription.canceled", "refund.created", "refund.updated"],
    "status": "active"
  }'
```

```typescript SDK theme={null}
import { Chargefy } from '@chargefy/sdk';

const chargefy = new Chargefy({
  accessToken: process.env.CHARGEFY_ACCESS_TOKEN,
});

const endpoint = await chargefy.webhookEndpoints.update('we_abc123', {
  events: ['subscription.created', 'subscription.canceled', 'refund.created', 'refund.updated'],
  status: 'active',
});
```

## Exemplo de Resposta

```json theme={null}
{
  "id": "we_abc123",
  "url": "https://meusite.com.br/webhooks/chargefy",
  "events": ["subscription.created", "subscription.canceled", "refund.created", "refund.updated"],
  "secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "status": "active",
  "organizationId": "org_abc",
  "createdAt": "2026-03-12T10:00:00Z"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.