Webhooks

You can use the webhooks to subscribe to some events in our system. When that related event happens in your workspace, you will get a post request on that defined webhook. Each Webhook has the following fields:

Attributes

Type

Description

id

string

The unique ID of the API key.

label

string

The label for this API key. It may be duplicated with other labels.

url

string

The webhook URL.

event

The related event. Valid values:

INCOMING_MESSAGE, OUTGOING_MESSAGE, ENDING_CONV, NEW_CLIENT, NEW_CONV, CLIENT_UPDATED, or ANY_EVENT.

createdAt

string

The timestamp when this instance was created.

Example
{ "workspaceId": 12, "id": "67642054b6cc2888638e4600", "url": "https://yourwebsite/crm/incoming-messages....", "label": "Incoming message webhooks", "event": "INCOMING_MESSAGE ", "createdAt": "2024-12-19T13:32:04.009Z", }

Webhook request payload

For conversation-related events

The payload that will be sent to the webhook URL will have the following fields:

Attributes

Type

Description

event

string

The related event. Valid values:

INCOMING_MESSAGE, OUTGOING_MESSAGE, ENDING_CONV, NEW_CONV.

workspaceId

number

The workspace ID

type

string

The type of the message. Valid values: text, image, audio, document, video, location, interactive, template

content

string

The content of the message

messageId

string

The message ID

integrationId

string

The message ID

isAgent

boolean

If the message is an agent message or a client message

conversationId

string

The conversation ID

clientId

string

The client ID

integrationType

string

The type of integration. Valid values: WHATSAPP, BCWEBCHAT, FACEBOOK, INSTAGRAM

externalClientId

string

The client's external ID is coming from the messaging platform

createdAt

string

The timestamp when this instance was created.

Example
{ "event": "INCOMING_MESSAGE", "type": "text", "content": "Hello", "messageId": "68875c39-01b8-42a5-9273-fcfd2f697600", "workspaceId": 12, "integrationId": "6743884f784839ad14770000", "isAgent": false, "conversationId": "6728c86bf893860f458e0000", "clientId": "6728c77dbba874b293e60000", "createdAt": "Sat, 04 Jan 2025 15:35:46 GMT", "integrationType": "WHATSAPP", "externalClientId": "905301749170", "debug": false }

For client-related events

The payload that will be sent to the webhook URL will have the following fields:

Attributes

Type

Description

event

string

The related event. Valid values:

NEW_CLIENT, CLIENT_UPDATED.

workspaceId

number

The workspace ID

id

string

The client ID

email

string

The client's email

name

string

The client's name

surname

string

The client's surname

phone

string

The client's phone

address

string

The client's address

city

string

The client’s city

country

string

The client’s country

externalClientId

string

The client's external ID comes from the messaging channel

tags

string[]

The tags used on the client

createdAt

string

The timestamp when this instance was created

patchedAt

string

The timestamp when this instance was updated last time

Example
{ "event": "CLIENT_UPDATED", "workspaceId": 12, "id": "67d09433594d52dd19817d60", "email": "test@test.com", "name": "Temp", "surname": "Client", "phone": "9055xxxxx371", "address": null, "city": "Istanbul", "country": "Turkey", "externalClientId": "9055xxxxx371", "tags": ["VIP"], "stageId": null, "createdAt": "2025-03-11T19:51:15.983Z", "patchedAt": "2025-03-11T23:01:34.372Z" }

You can check our playground to explore and interact with GraphQL APIs easily and intuitively with real-time documentation.

List Webhooks

This endpoint returns the Webhooks for a specific workspace. You can search for particular webhooks using a string pattern in the label field or filter by the event field.

Parameter

Type

Description

workspaceId

number

The workspace ID.

label

string

Label search pattern

event

string

The related event. Valid values:

INCOMING_MESSAGE, OUTGOING_MESSAGE or ENDING_CONV.

Request & Response

POST https://gateway.bcrumbs.net/core/gq
Example
query webhooks($input: WebhooksInput!) { webhooks(input: $input) { nodes { workspaceId id label url event createdAt } } } input WebhooksInput { workspaceId: Int! label: String event: WebhookEvent }

The query above returns JSON structured like this:

Example
{ "nodes": [ { "workspaceId": 12, "id": "67642054b6cc2888638e4600", "url": "https://yourwebsite/crm/incoming-messages....", "label": "Incoming message webhooks", "event": "INCOMING_MESSAGE ", "createdAt": "2024-12-19T13:32:04.009Z", }, ... ] }