Update a webhook endpoint
PATCH
/v1/webhook-endpoints/{id}
const url = 'https://api.inboxcnx.com/v1/webhook-endpoints/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"events":["message.received","message.updated","grant.created"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.inboxcnx.com/v1/webhook-endpoints/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "events": [ "message.received", "message.updated", "grant.created" ] }'Changes a webhook endpoint’s URL, subscribed events or description. Removing an event type cancels the endpoint’s open deliveries of that type. Adding one delivers the events of that type that no endpoint has received yet, from the last 7 days, at once.
Requires the write:webhooks scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Body
Section titled “Request Body”Media typeapplication/json
object
url
string format: uri
events
Array<string>
description
string | null
Example
{ "events": [ "message.received", "message.updated", "grant.created" ]}Responses
Section titled “Responses”The updated endpoint
Media typeapplication/json
object
id
required
string
url
required
string
description
required
string | null
events
required
Array<string>
createdAt
required
string
updatedAt
required
string
secret
string
Example generated
{ "id": "example", "url": "example", "description": "example", "events": [ "example" ], "createdAt": "example", "updatedAt": "example", "secret": "example"}Invalid body, or invalid_webhook_target: the URL must be https and must not point at a private address or an internal hostname
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}The credential lacks the write:webhooks scope
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}No such endpoint for the caller’s application
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}Another endpoint already takes message.enrich
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}