# Webhooks API reference

The Webhooks API reference covers 9 endpoints of the SkedCast social media REST API. Webhook endpoints and delivery logs.

## List webhook endpoints

`GET /webhooks`

Scope: `webhooks.read`

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `cursor` | string | query | no | Keyset cursor from a previous page. |
| `limit` | integer | query | no | Page size (1–100). |

Responses: 200, 400, 401, 403, 404, 422, 429

## Create a webhook endpoint

`POST /webhooks`

Scope: `webhooks.manage`

Register an outbound webhook endpoint for HMAC-signed event deliveries. `events` is any subset of the 47-event catalog (see the top-level `webhooks` object of this document for every event and its payload). The signing `secret` is returned ONCE. Requires the `webhooks.manage` scope and an `Idempotency-Key` header.

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | string | header | yes | A unique key (for example a UUID, up to 255 characters) for this request. Retry a 429, 502, 503 or 504, or a request that got no response, with the same Idempotency-Key: SkedCast runs it once or returns the first result. Every other answer, including a 500, is kept for 24 hours and returned again for that key, so send a new key to try again. |
| `url` | string (uri) | body | yes |  |
| `events` | array of enum: post.scheduled | post.published | post.failed | post.partially_published | post.missed | post.canceled | … | body | yes |  |

Responses: 201, 400, 401, 403, 404, 409, 422, 429

## Get a webhook endpoint

`GET /webhooks/{id}`

Scope: `webhooks.read`

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |

Responses: 200, 400, 401, 403, 404, 422, 429

## Update a webhook endpoint

`PATCH /webhooks/{id}`

Scope: `webhooks.manage`

Update a webhook endpoint's URL, subscribed events, or active flag. Requires the `webhooks.manage` scope and an `Idempotency-Key` header.

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |
| `Idempotency-Key` | string | header | yes | A unique key (for example a UUID, up to 255 characters) for this request. Retry a 429, 502, 503 or 504, or a request that got no response, with the same Idempotency-Key: SkedCast runs it once or returns the first result. Every other answer, including a 500, is kept for 24 hours and returned again for that key, so send a new key to try again. |
| `url` | string (uri) | body | no |  |
| `events` | array of string | body | no |  |
| `active` | boolean | body | no |  |

Responses: 200, 400, 401, 403, 404, 409, 422, 429

## Delete a webhook endpoint

`DELETE /webhooks/{id}`

Scope: `webhooks.delete`

Delete a webhook endpoint. Its delivery history is deleted with it. Requires the `webhooks.delete` scope.

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |
| `Idempotency-Key` | string | header | yes | A unique key (for example a UUID, up to 255 characters) for this request. Retry a 429, 502, 503 or 504, or a request that got no response, with the same Idempotency-Key: SkedCast runs it once or returns the first result. Every other answer, including a 500, is kept for 24 hours and returned again for that key, so send a new key to try again. |

Responses: 200, 400, 401, 403, 404, 409, 422, 429

## Send a test delivery

`POST /webhooks/{id}/test`

Scope: `webhooks.manage`

Send a signed test event to the endpoint to verify connectivity + signature handling. Requires the `webhooks.manage` scope.

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |
| `Idempotency-Key` | string | header | yes | A unique key (for example a UUID, up to 255 characters) for this request. Retry a 429, 502, 503 or 504, or a request that got no response, with the same Idempotency-Key: SkedCast runs it once or returns the first result. Every other answer, including a 500, is kept for 24 hours and returned again for that key, so send a new key to try again. |

Responses: 202, 400, 401, 403, 404, 409, 422, 429

## Rotate the signing secret

`POST /webhooks/{id}/rotate-secret`

Scope: `webhooks.manage`

Create a new signing secret for the endpoint. The response carries the new secret in full and it is never shown again, so store it before you discard the response. The previous secret keeps working for 24 hours, so a receiver can redeploy without dropping events. During that window `webhook-signature` and `X-SkedCast-Signature` each carry one entry per valid secret, and a receiver is correct if ANY entry matches. Requires the `webhooks.manage` scope.

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |
| `Idempotency-Key` | string | header | yes | A unique key (for example a UUID, up to 255 characters) for this request. Retry a 429, 502, 503 or 504, or a request that got no response, with the same Idempotency-Key: SkedCast runs it once or returns the first result. Every other answer, including a 500, is kept for 24 hours and returned again for that key, so send a new key to try again. |

Responses: 200, 400, 401, 403, 404, 409, 422, 429

## List webhook deliveries

`GET /webhooks/{id}/deliveries`

Scope: `webhooks.read`

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |
| `cursor` | string | query | no | Keyset cursor from a previous page. |
| `limit` | integer | query | no | Page size (1–100). |

Responses: 200, 400, 401, 403, 404, 422, 429

## List the tries of a webhook delivery

`GET /webhooks/{id}/deliveries/{deliveryId}/attempts`

Scope: `webhooks.read`

| Field | Type | In | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | string (uuid) | path | yes |  |
| `deliveryId` | string (uuid) | path | yes | The delivery id (from `GET /webhooks/{id}/deliveries`). |
| `cursor` | string | query | no | Keyset cursor from a previous page. |
| `limit` | integer | query | no | Page size (1–100). |

Responses: 200, 400, 401, 403, 404, 422, 429
