Triggers and webhooks
Get signed events on your server when something happens in a user's app or your project.
A webhook endpoint is a URL on your server. Dexby posts project events to it, signed with the Standard Webhooks scheme. A trigger listens for one event, such as a new Slack message, on one user's connection and forwards it to your webhooks.
Add a webhook endpoint
In the dashboard, open Configure → Webhooks, click Add endpoint, enter a public
https URL, and pick events. Copy the signing secret (whsec_...). It is shown once.
Verify each delivery
import { Webhook } from 'standardwebhooks'
const webhook = new Webhook(process.env.DEXBY_WEBHOOK_SECRET ?? '')
export async function POST(request: Request) {
const body = await request.text()
const event = webhook.verify(body, Object.fromEntries(request.headers)) // throws if forged
console.log(event)
return new Response(null, { status: 204 })
}Answer 2xx within 10 seconds. Anything else is retried for about two days. webhook-id stays the
same on every retry, so use it to drop duplicates.
Create a trigger
Connect a WooCommerce account for the user before creating this order.created trigger.
import { Dexby } from '@dexby.ai/sdk'
const dexby = new Dexby()
const trigger = await dexby.createTrigger({
connectionId: '<connection-id>',
event: 'order.created'
})
if (trigger.isErr()) throw new Error(trigger.error.message)<connection-id>: the user's connected WooCommerce account, from Operate → Connections → open the account → Connection ID, orGET /v1/connections?userId=user_123.event: an event the app supports (table below). Or create the trigger in Operate → Triggers → New trigger, which lists them.
Events then arrive as trigger.fired, with data.userId set to your user. Pass that id when
creating the agent's session so it uses that user's connected accounts.
Apps with triggers
| App | Events | Setup |
|---|---|---|
| ShipStation | track, fulfillment_shipped_v2, fulfillment_rejected_v2, batch | Automatic |
| Slack | message, app_mention, reaction_added | Manual |
| Telegram | message, edited_message, channel_post, callback_query | Automatic |
| WooCommerce | order.created, order.updated, product.created, product.updated, customer.created | Automatic |
Manual (Slack): pass secret (your Slack app's Signing secret). The response has a url,
shown once. Paste it as the Request URL under Event Subscriptions in your Slack app, and subscribe
to the bot event.
Events
| Event | When | data |
|---|---|---|
trigger.fired | A trigger received an event. | triggerId, connectorId, event, userId, connectionId, eventId, receivedAt, payload |
connection.created | A user connected an account. | connectionId, connectorId, userId, name |
connection.deleted | An account was removed and its credential erased. | connectionId, connectorId, userId |
connection.reauth_required | An account needs reconnecting. | connectionId, connectorId, userId |
execution.failed | A tool run failed. | toolId, connectorId, userId, errorCode |
mcp_server.tools_changed | An MCP server's tools changed. | server, toolCount |
For a global account, the connection.* events carry
"userId": null and "global": true.
Every delivery has the shape { "type", "timestamp", "data" }. Payloads never include tool input or
output, except the app's own payload in trigger.fired.