Rotate a webhook subscription's signing secret
/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/webhooks/{id}/rotate-secretGenerates 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
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
env_webhooks.manageDeveloper ConsoleCreate, edit, rotate, and delete Environment 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
data *WebhookSecretRotatedResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Errors
When the request can't be completed, the response body includes a stable error code you can branch on.
account.capability_requiredForbiddenThe signed-in user's administrator roles do not grant the capability this endpoint requires.
Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.
Returned object
curl -X POST "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/webhooks/value/rotate-secret" \ -H "Authorization: Bearer $CANOPY_TOKEN"
{ "data": { "id": "string", "url": "string", "secret": "string" } }
Tell us how we can improve this guide.