Skip to content

Create a webhook endpoint

POST
/v1/webhook-endpoints
curl --request POST \
--url https://api.inboxcnx.com/v1/webhook-endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "https://hooks.example.com/inboxcnx", "events": [ "message.received", "grant.created" ], "description": "Production receiver" }'

Adds a URL that receives the subscribed webhook events of the caller application, signed with a secret returned only in this response. An application has at most 10 endpoints, and at most one of them subscribes to message.enrich. Events of a newly subscribed type that no endpoint has received yet, from the last 7 days, are delivered at once.

Requires the write:webhooks scope.

Media typeapplication/json
object
url
required
string format: uri
events
required
Array<string>
>= 1 items
Allowed values: message.received message.updated message.deleted message.enrich connection.error connection.restored grant.created grant.cap_reached grant.backfill_completed grant.revocation_scheduled grant.revoked usage.period.closed
description
string | null
<= 200 characters

Example

{
"url": "https://hooks.example.com/inboxcnx",
"events": [
"message.received",
"grant.created"
],
"description": "Production receiver"
}

The endpoint, with its signing secret (returned only here)

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"
}
}

The caller’s application no longer exists

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}

The endpoint limit is reached, another endpoint already takes message.enrich, or the organization is still being set up; retry in a few minutes

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example generated

{
"error": {
"code": "example",
"message": "example"
}
}