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

# Update webhooks

> Update an existing webhook's status, URL, shared secret, or authorisation header.

Update an existing webhook's status, URL, shared secret, or authorisation header.

## Update a webhook

<Note>
  **PATCH** `v2/webhooks/{webhookId}?accountId={accountId}`
</Note>

### Request

Use this request to update an existing webhook. Set the `enabled` field to `true` to make it available or `false` to make it unavailable.

If you have a user-level API key, you need to specify an `accountId` to use this request.
If you have a product-level API key, you can choose to update this across all accounts by omitting the `accountId` query parameter.

<CodeGroup>
  ```bash Sample request theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/webhooks/d7d34e0f-c6e9-4cea-8c25-baaffa81714f?accountId=F12345' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "enabled": true,
      "authorizationHeader": "Basic BXVubzpwQDU1dzByYM==",
    }'
  ```

  ```bash Request structure theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/webhooks/{webhookId}?accountId={accountId}' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "enabled": true,
      "authorizationHeader": "string",
    }'
  ```
</CodeGroup>

#### Path parameters

<ParamField body="webhookId" type="string" required>
  The ID of the webhook that you want to update.

  Allowable values: An existing `webhookId` (≤ 36 characters)
</ParamField>

#### Query parameters

<ParamField body="accountId" type="string">
  The account ID to filter the response with. This is required if you have a user-level API key.

  Allowable values: An existing `accountId` (≤ 36 characters)
</ParamField>

#### Request body schema

<ParamField body="sharedSecret" type="string (uuid)">
  When provided, we use this to generate a hash-based message authentication code (HMAC) using the SHA-256 algorithm. We Base64 encode this signature. Every event notification you receive for this webhook will include an `x-em-signature` header, if a shared secret has been provided. You can use this to verify the integrity and authenticity of the message.

  Allowable values: ≤ 36 characters
</ParamField>

<ParamField body="enabled" type="boolean" required>
  Whether or not the webhook should be enabled.

  Allowable values: `true`, `false`
</ParamField>

<ParamField body="url" type="string" required>
  The URL of your webhook endpoint.

  Allowable values: ≤ 512 characters
</ParamField>

<ParamField body="authorizationHeader" type="string or null">
  The authorisation header content for the webhook.

  Allowable values: ≤ 512 characters
</ParamField>

### Response

If your request is successful, you'll receive a `200` response.

<CodeGroup>
  ```json Sample response theme={null}
  {
    "sharedSecret": "123e4567-e89b-12d3-a456-426614174000",
    "enabled": true,
    "accountId": "F12345",
    "webhookEventTypeId": "da91434a-4026-42ea-84b8-d0317b64af9c",
    "url": "https://api.exampleurl.com",
    "authorizationHeader": "Basic AXVubzpwQDU1dzByYM==",
    "id": "d7d34e0f-c6e9-4cea-8c25-baaffa81714f",
    "productId": "911db6db-ef58-4992-87cd-2fe2cfde05f9",
    "webhookEventTypeName": "OrderCreated",
    "createdAt": "2023-01-30T08:30:00Z",
    "updatedAt": "2023-01-30T08:30:00Z"
  }
  ```

  ```json Response structure theme={null}
  {
    "sharedSecret": "string",
    "enabled": boolean,
    "accountId": "string",
    "webhookEventTypeId": "string",
    "url": "string",
    "authorizationHeader": "string",
    "id": "string",
    "productId": "string",
    "webhookEventTypeName": "string",
    "createdAt": "string",
    "updatedAt": "string"
  }
  ```
</CodeGroup>

For more detailed information about this request and its response, [see the API reference](/api-reference/webhooks/update-a-webhook).
