# Update (https://docs.capy.ai/api-reference/webhooks/update)

`PATCH https://api.capy.ai/api/v1/webhooks/{id}`

Updates an outbound webhook endpoint's URL or description, or pauses and resumes it with enabled. A paused endpoint queues no events. Requires org admin.

## Authorization

Send an API key as a bearer token: `Authorization: Bearer $CAPY_API_KEY`. See https://docs.capy.ai/api-reference/authentication.md.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `url` | string | no | An https URL that resolves to a public address. Capy posts every event here. |
| `description` | string | no |  |
| `enabled` | boolean | no |  |

## Responses

- `200` WebhookEndpoint: `WebhookEndpointEncoded`
- `400` capy/InvalidRequest: `capy_InvalidRequestEncoded`
- `401` capy/Unauthorized: `capy_UnauthorizedEncoded`
- `403` capy/Forbidden: `capy_ForbiddenEncoded`
- `404` capy/WebhookEndpointNotFound: `capy_WebhookEndpointNotFoundEncoded`
- `429` capy/RateLimited: `capy_RateLimitedEncoded`

## Example

```bash
curl -X PATCH "https://api.capy.ai/api/v1/webhooks/{id}" \
  -H "Authorization: Bearer $CAPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Referenced schemas

```json
{
  "WebhookEndpointEncoded": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 15,
        "maxLength": 30,
        "pattern": "^whe_"
      },
      "url": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2048,
        "description": "An https URL that resolves to a public address. Capy posts every event here."
      },
      "description": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 255
          },
          {
            "type": "null"
          }
        ]
      },
      "enabled": {
        "type": "boolean"
      },
      "createdAt": {
        "type": "string"
      },
      "updatedAt": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "url",
      "description",
      "enabled",
      "createdAt",
      "updatedAt"
    ],
    "additionalProperties": false
  },
  "capy_InvalidRequestEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/InvalidRequest"
        ]
      },
      "message": {
        "type": "string"
      }
    },
    "required": [
      "_tag",
      "message"
    ],
    "additionalProperties": false
  },
  "capy_UnauthorizedEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/Unauthorized"
        ]
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_ForbiddenEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/Forbidden"
        ]
      },
      "mfaRequiredOrgId": {
        "type": "string"
      },
      "ssoRequired": {
        "type": "boolean"
      },
      "passkeyRequired": {
        "type": "boolean"
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_WebhookEndpointNotFoundEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/WebhookEndpointNotFound"
        ]
      },
      "webhookEndpointId": {
        "type": "string",
        "minLength": 15,
        "maxLength": 30,
        "pattern": "^whe_"
      }
    },
    "required": [
      "_tag",
      "webhookEndpointId"
    ],
    "additionalProperties": false
  },
  "capy_RateLimitedEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/RateLimited"
        ]
      },
      "retryAfterSeconds": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      }
    },
    "required": [
      "_tag",
      "retryAfterSeconds"
    ],
    "additionalProperties": false
  },
  "UpdateWebhookEndpointRequest": {
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2048,
        "description": "An https URL that resolves to a public address. Capy posts every event here."
      },
      "description": {
        "type": "string",
        "maxLength": 255
      },
      "enabled": {
        "type": "boolean"
      }
    },
    "additionalProperties": false
  }
}
```

Full document: https://docs.capy.ai/openapi.json