Add a webhook endpoint; the answer holds its signing secret, once.
POST
/api/v1/webhooks
const url = 'https://example.com/api/v1/webhooks';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"ops-pager","url":"https://hooks.example.com/kuben","events":["example"]}'};
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/api/v1/webhooks \ --header 'Content-Type: application/json' \ --data '{ "name": "ops-pager", "url": "https://hooks.example.com/kuben", "events": [ "example" ] }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
Example
ops-pagerurl
required
string
Example
https://hooks.example.com/kubenevents
required
Event types, or * for all.
Array<string>
Responses
Section titled “Responses”Media typeapplication/json
object
id
required
string format: uuid
name
required
string
url
required
string
events
required
Array<string>
createdBy
required
string
createdAt
required
string
disabledAt
string | null
failures
required
Deliveries given up in a row; the endpoint is disabled at 20.
integer format: int32
secret
The signing secret: shown once, when the endpoint is made.
string | null
Examplegenerated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "url": "example", "events": [ "example" ], "createdBy": "example", "createdAt": "example", "disabledAt": "example", "failures": 1, "secret": "example"}Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}The name is taken
Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}