1. Docs
  2. API Reference
  3. Rotate a webhook subscription's signing secret

Rotate a webhook subscription's signing secret

POST/portal/v1/accounts/{accountSlug}/webhooks/{id}/rotate-secret

Generates a new signing secret for one account-scoped webhook subscription id, replacing the old one. The new secret is returned only in this response and is never retrievable again; existing deliveries signed with the prior secret will no longer validate. Returns 404 for an unknown subscription, writes a webhook.secret_rotated audit row, and requires webhook.manage.

Authentication

Bearer TokenAuthorization

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

Requires capability account_webhooks.manageAccount

Manage account-tier webhook subscriptions. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.

Path Parameters

idstring Required

Responses

application/json

  • dataWebhookSecretRotatedResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Errors

When the request can't be completed, the response body includes a stable error code you can branch on.

403account.capability_requiredForbidden
When it happens

The signed-in user's administrator roles do not grant the capability this endpoint requires.

Remediation

Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.

Returned object

Request
curl -X POST "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/webhooks/value/rotate-secret" \
  -H "Authorization: Bearer $CANOPY_TOKEN"
Response
{
  "data": {
    "id": "string",
    "url": "string",
    "secret": "string"
  }
}
Related endpoints
GETList webhook subscriptions
POSTCreate a webhook subscription
GETActive/inactive webhook counts for the environment
GETList subscribable webhook event types
GETList delivery attempts for a webhook
GETGet a webhook subscription
PATCHUpdate a webhook subscription
DELETEDelete a webhook subscription
Was this page helpful?

Tell us how we can improve this guide.