Skip to content
Hayonix

API reference · Serverless

Replace the webhook signing secret (returned once)

POST/v1/serverless/endpoints/{endpoint_id}/rotate-webhook-secret
API keyserverless_endpoint:updateProject
TypeScript
client.serverless.rotateWebhookSecret()
Python
client.serverless.rotate_webhook_secret()
CLI
hayonix serverless rotate-webhook-secret

The old secret stops signing at once: every delivery sent afterwards, retries included, is signed with the new one only. Update your receiver right after rotating.

Project API key (Authorization: Bearer sk_…), or a console session. Requires the serverless_endpoint:update permission (a key's scope, or a role that includes it).

Examples

The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.

curl -sS -X POST "$API_BASE_URL/serverless/endpoints/sep_01jc5zq4m8k3v6x9t2w7r0b1e4/rotate-webhook-secret" \
  -H "Authorization: Bearer $API_KEY"

Request

Headers
HeaderRequiredDescription
AuthorizationyesBearer and your API key. The key implies its project.
X-Project-Idsession onlyThe project to act in, for console sessions. Requests with an API key leave it out.

Path parameters

  • endpoint_idstringrequired

    ID of the endpoint

    ID with prefix sep_

Response

200 ServerlessWebhookSecret — The new secret

  • objectstringrequired

    Always `webhook_secret`: the type of this object

    One ofwebhook_secret

  • endpoint_idstringrequired

    ID of the endpoint

  • webhook_secretstringrequired

    The new signing secret. Every delivery sent from now on, retries of earlier ones included, is signed with it alone. Returned only here; store it now.

Example response
Example response
{
  "object": "webhook_secret",
  "endpoint_id": "string",
  "webhook_secret": "string"
}

Errors

Errors use the standard envelope. What this operation can answer:

Errors
StatusTypeWhen
400invalid_request_errorA parameter or body field is missing or not allowed; param names it.
401authentication_errorThe key or session is missing, revoked or expired.
403permission_errorThe credential lacks the permission this needs, or the organization is suspended.
404not_found_errorNo such resource in this project (an ID from another project is answered the same way).
409conflict_errorThe resource's current state does not allow this.
429rate_limit_error rate_limitedToo many requests; retry after retry-after seconds.