# Get a webhook endpoint

> One endpoint, with its health: `consecutive_failures`, `last_success_at`, `last_failure_at`, and `enabled` with `disabled_reason` when the endpoint was switched off.

Source: https://docs.spicrawl.com/api-reference/webhooks/webhooks-get

## GET /v1/webhooks/{webhookID}

Operation ID: `webhooksGet`. API key scope: `webhooks`.

One endpoint, with its health: `consecutive_failures`, `last_success_at`, `last_failure_at`, and
`enabled` with `disabled_reason` when the endpoint was switched off. Scope `webhooks` (or `read`).

### Example

```bash
curl "https://api.spicrawl.com/v1/webhooks/{webhookID}" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY"
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `webhookID` | path | string | yes | The endpoint `id` returned by `POST /v1/webhooks`. An id of another organization answers 404. |

### Responses

#### 200

The endpoint.

Headers: `X-Request-Id`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Endpoint id. Use it in the `webhookID` path parameter and as `webhook_endpoint_id` on a batch. |
| `name` | string \| null | no |  |
| `url` | string (uri) | yes | HTTPS URL that receives the deliveries. |
| `events` | array of string: `batch.completed`, `batch.failed`, `monitor.changed`, `monitor.failed` (`WebhookEvent`) | yes |  |
| `format` | string: `json`, `slack`, `discord` | yes | Body shape. `json` is the signed JSON document. `slack` posts `{"text": summary}` and `discord` posts `{"content": summary}` (at most 2,000 characters) for incoming-webhook URLs. Signature headers are sent in every format. |
| `enabled` | boolean | yes | False once the endpoint was disabled, by a failure streak or by `enabled: false`. |
| `disabled_reason` | string \| null | no | Why the endpoint is disabled, when it is. Null while enabled. |
| `consecutive_failures` | integer | yes | Failed deliveries in a row. Reset by a success, and by re-enabling. At 100 the endpoint is disabled. |
| `last_success_at` | string \| null (date-time) | no |  |
| `last_failure_at` | string \| null (date-time) | no |  |
| `secret_version` | integer | yes | Starts at 1 and goes up by one on each rotation. Also the `kid` in signature headers. |
| `created_at` | string (date-time) | yes |  |
| `updated_at` | string (date-time) | yes |  |

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 404

No such resource for this key's organization.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
