Docs
API 1.39
Status
Webhooks

Register a webhook endpoint; the secret is shown once

POST /v1/webhooks: Register a webhook endpoint; the secret is shown once

POST /v1/webhooks
Operation idcreateWebhook
Key scopeadmin: admin keys only
SectionWebhooks

#Request body

FieldTypeRequiredDescription
urlstring (uri)yes
eventsstringyesmin items 1 · max items 50
descriptionstringmax length 1000
mode"live", "test", "both"default "both"
format"standard", "discord", "slack"default "standard"

#Example request

curl -X POST "https://api.kaab.ist/v1/webhooks" \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://hooks.acme.test/kaab","events":["job.succeeded","job.*"],"description":"CI"}'

#Responses

#201

Webhook

FieldTypeRequiredDescription
idstringyespattern ^whk_[0-9a-hjkmnp-tv-z]{26}$
object"webhook"yes
urlstring (uri)yes
eventsstringyesmin items 1
mode"live", "test", "both"yes
format"standard", "discord", "slack"yes
status"active", "disabled"yes
descriptionstring or nullyes
disabled_reasonstring or nullyes
previous_secret_expires_atstring or null (date-time)yes
created_atstring (date-time)yes
secretstringyes

#Errors

Every error answers with the error envelope; its code is one of the error codes.

StatusWhen
400request_invalid: request validation failed
401Missing or invalid API key
402insufficient_credits: top up to continue
403The key's scope does not cover this operation
409Conflicting state (see error.code)
422Semantically invalid request (see error.code)
429Rate limited; see Retry-After
500internal: unexpected server error

Was this page helpful?