Create instance webhook REST API
POST
/api/admin/webhooks
const url = 'https://hitkeep.com/api/admin/webhooks';const options = { method: 'POST', headers: {cookie: 'hk_token=<hk_token>', 'Content-Type': 'application/json'}, body: '{"description":"example","enabled":true,"events":["example"],"name":"example","url":"https://example.com"}'};
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://hitkeep.com/api/admin/webhooks \ --header 'Content-Type: application/json' \ --cookie hk_token=<hk_token> \ --data '{ "description": "example", "enabled": true, "events": [ "example" ], "name": "example", "url": "https://example.com" }'Creates a webhook and returns its signing secret exactly once. Human dashboard session only.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
description
string
enabled
required
boolean
events
required
Array<string>
name
required
string
url
required
HTTPS destination. Loopback, private, link-local, multicast, and otherwise unsafe addresses are rejected unless development targets are explicitly enabled.
string format: uri
Examplegenerated
{ "description": "example", "enabled": true, "events": [ "example" ], "name": "example", "url": "https://example.com"}Responses
Section titled “Responses”Created webhook and one-time secret
Media typeapplication/json
object
secret
required
One-time signing secret. It is returned only on creation or rotation.
string
webhook
required
object
created_at
required
string format: date-time
description
required
string
enabled
required
boolean
events
required
Array<string>
id
required
string format: uuid
name
required
string
scope
required
string
site_id
string | null format: uuid
updated_at
required
string format: date-time
url
required
string format: uri
Example
{ "webhook": { "scope": "instance" }}Invalid event or destination
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}