# Retrieve the signing secret

GET /v1/webhooks/{webhook_id}/secret

Source: https://cherami.to/docs/api/webhooks/get-webhook-secret



{/* Generated from apps/web/openapi. Edit the contract, not this file. */}

`GET /v1/webhooks/{webhook_id}/secret`

Requires an [API key](https://cherami.to/docs/api#authentication): `Authorization: Bearer YOUR_CREDENTIAL`.

Returns the webhook's current signing secret. Secrets appear only here and in the creation and rotation responses. After a [rotation](https://cherami.to/docs/api/webhooks/rotate-webhook-secret), this returns the new secret.

## Parameters [#parameters]

| Parameter    | Location | Required | Type   | Meaning                                  |
| ------------ | -------- | -------- | ------ | ---------------------------------------- |
| `webhook_id` | path     | Yes      | string | Cherami resource ID returned by the API. |

## curl example [#curl-example]

Supply `CHERAMI_API_KEY` privately.

```sh
curl --silent --show-error --include --request GET \
  "https://cherami.to/v1/webhooks/WEBHOOK_ID/secret" \
  --header "Authorization: Bearer $CHERAMI_API_KEY"
```

## Responses [#responses]

### HTTP 200 [#http-200]

Success.

* `X-Request-ID`: Identifies this request; include it when reporting a problem.

Content type: `application/json`.

[WebhookSecret](#schema-webhooksecret)

```json
{
  "id": "55555555-5555-4555-8555-555555555555",
  "secret": "whsec_EXAMPLE_NOT_A_REAL_SECRET"
}
```

### HTTP 401 [#http-401]

`unauthorized`: Send a valid API key as `Authorization: Bearer <key>`. If the key stopped working, get a new one through [recovery](https://cherami.to/docs/guides/recovery).

* `X-Request-ID`: Identifies this request; include it when reporting a problem.
* `WWW-Authenticate`: `"Bearer"`

Content type: `application/json`.

[Error](#schema-error)

### HTTP 404 [#http-404]

`not_found`: The resource does not exist or does not belong to this account. A reply or forward source must also be in the sending inbox.

* `X-Request-ID`: Identifies this request; include it when reporting a problem.

Content type: `application/json`.

[Error](#schema-error)

### HTTP 503 [#http-503]

`webhook_secret_unavailable`: The signing secret could not be read; retry the read later. When `error.details.webhook_id` is present the webhook was added: retrieve its secret rather than adding it again.

`webhooks_unavailable`: Webhook management failed. If it was a change, it may have been applied: list or read the webhooks before repeating it.

* `X-Request-ID`: Identifies this request; include it when reporting a problem.

Content type: `application/json`.

[Error](#schema-error)

## Schema: WebhookSecret [#schema-webhooksecret]

| Field    | Required | Type   | Meaning and constraints                                                                                            |
| -------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
| `id`     | Yes      | string | Cherami resource ID.                                                                                               |
| `secret` | Yes      | string | Signing secret for Standard Webhooks verification (whsec\_...). Returned only on creation, retrieval and rotation. |

## Schema: Error [#schema-error]

| Field   | Required | Type   | Meaning and constraints |
| ------- | -------- | ------ | ----------------------- |
| `error` | Yes      | object |                         |

### `error` fields [#error-fields]

| Field     | Required | Type   | Meaning and constraints                                               |
| --------- | -------- | ------ | --------------------------------------------------------------------- |
| `code`    | Yes      | string | Code to handle. Handle a code you don't recognize by its HTTP status. |
| `message` | Yes      | string | Explanation of this case; its wording can change.                     |

[Errors, limits and pagination](https://cherami.to/docs/api/errors) · [Download OpenAPI 3.1](https://cherami.to/openapi.json)
