/api/v1/locations/{id}/webhooks (POST)
POST
/api/v1/locations/{id}/webhooks
const url = 'https://example.com/api/v1/locations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/webhooks';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"url":"example","events":["thing.created"]}'};
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/locations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/webhooks \ --header 'Content-Type: application/json' \ --data '{ "url": "example", "events": [ "thing.created" ] }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
url
required
string
events
required
Array<string>
Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
webhook
required
object
id
required
string format: uuid
url
required
string
events
required
Array<string>
active
required
boolean
createdBy
required
object
id
required
string format: uuid
displayName
required
string
lastDelivery
rowVersion
required
integer
secret
required
string
Example
{ "webhook": { "events": [ "thing.created" ], "disabledReason": "creator_lost_role", "lastDelivery": { "status": "pending" } }}