Give a webhook endpoint a new secret (admin)
const url = 'https://example.com/v1/orgs/example/webhooks/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate-secret';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/orgs/example/webhooks/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate-secret \ --header 'Authorization: Bearer <token>'Answers with the new secret, the only time it is shown. Deliveries are signed with the previous secret too for 24 hours (previous_secret_expires_at), so receivers can switch.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization (tenant) slug, e.g. alpenrobotik
Responses
Section titled “Responses”The endpoint, with the new secret
object
What the request body looks like and which hosts it may go to. It can’t change after create. webhook.formatUnavailable is no longer answered (an unknown format is request.invalid).
The scheme, the host and the last four characters of the path; never the URL
A language Affectra is available in
The extra header’s name; its value is never shown
Why it is off: an admin turned it off, the receiver answered 410 Gone, or every delivery failed for 3 days
After a rotation, deliveries are signed with the previous secret too until then
The user who created it
Whsec_ and 32 random bytes in base64, for Standard Webhooks signatures. Shown only in this answer.
Example
{ "format": "standard", "event_types": [ "finding.new" ], "locale": "en", "disabled_reason": "admin"}Auth.roleTooLow, or auth.csrfMissing
No such object in this organization, no such organization, or the caller does not belong to it
Over the operation’s rate-limit budget (x-affectra-budget): code request.rateLimited with params.budget. Wait Retry-After seconds before trying again.
Every error answer, Content-Type
application/problem+json. The web app and integrations translate code; detail is English,
for people reading curl output or CI logs, and may change wording at
any time. Match on code, never on detail.
object
The HTTP status
Stable error codes. A code is never renamed; new ones may be added, so
a client falls back to detail for a code it doesn’t know. Another
organization’s object answers notFound, the same as a missing one.
What went wrong
Values the code’s message needs, e.g. {“field”: “version”}. Only values the caller sent or may see. Empty when the message needs none.
object
Example
{ "code": "notFound"}Headers
Section titled “Headers”Seconds until a request would be allowed again, at least 1
Notifications.unavailable