# Remove (https://docs.capy.ai/api-reference/webhooks/remove)

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

Deletes an outbound webhook endpoint together with its delivery records and returns the deleted endpoint. 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 |  |

## Responses

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

## Example

```bash
curl -X DELETE "https://api.capy.ai/api/v1/webhooks/{id}" \
  -H "Authorization: Bearer $CAPY_API_KEY"
```

## 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_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
  }
}
```

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