> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wepayout.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Update

> Update an existing webhook configuration

# Update Webhook URL

This endpoint allows updating the webhook URL associated with a specific event.

* The event parameter must be provided in the path
* The request body should include the new configuration values for the specified event's webhook URL

## Path Parameters

<ParamField path="event" type="string" required>
  The event type for which to update the webhook URL

  Example: `onboarding`
</ParamField>

## Request Body

<ParamField body="url" type="string" required>
  Endpoint URL that will receive the webhook notifications for the selected event.

  URL characters: `a-z`, `A-Z` characters

  Example: `https://my-url.requestcatcher.com/test`
</ParamField>

## Response

<ResponseField name="event" type="string">
  Type of event that was registered for the webhook

  Allowed values: `onboarding`
</ResponseField>

<ResponseField name="url" type="string">
  Endpoint URL that was registered to receive webhook notifications

  Example: `https://my-url.com/test`
</ResponseField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PUT \
    --url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/onboarding \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer {token}' \
    --header 'Content-Type: application/json' \
    --data '{
      "url": "https://my-url.requestcatcher.com/test"
    }'
  ```

  ```javascript JavaScript theme={null}
  const event = 'onboarding';

  const response = await fetch(`https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/${event}`, {
    method: 'PUT',
    headers: {
      'Accept': 'application/json',
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      url: 'https://my-url.requestcatcher.com/test'
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  event = 'onboarding'
  url = f'https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}'
  headers = {
      'Accept': 'application/json',
      'Authorization': 'Bearer YOUR_TOKEN',
      'Content-Type': 'application/json'
  }
  data = {
      'url': 'https://my-url.requestcatcher.com/test'
  }

  response = requests.put(url, json=data, headers=headers)
  print(response.json())
  ```
</CodeGroup>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "event": "onboarding",
    "url": "https://my-url.requestcatcher.com/test"
  }
  ```
</ResponseExample>
