Settings
Every field in settings, with its type and default, and ready-made settings for common apps.
settings tells Dexbi how to behave for one request. Every field is optional: leave one out and its default applies, or leave out settings entirely. An unknown field is refused with a 400 that names it.
There's no dashboard card for the API. Each setting works like the deployment setting named in brackets, so you can read more in Deploy.
A key made by connecting Modmail from Deploy is the exception: Dexbi uses its deployment's settings and ignores settings. See Keys made by Modmail.
All settings
| Field | Type | Default | What it does |
|---|---|---|---|
agent | "ticket" or "public" | "ticket" | "ticket": one member's own conversation, like a Modmail thread. "public": a shared channel or chat. |
reply | "always", "smart" or "pings" | "always" | "always" answers every message (All messages). "pings" answers only directed messages (Only pings). "smart" with "public": answers what is said to Dexbi and anyone who needs help, and sends none for chatter (Smart reply). "smart" with "ticket": answers every member message, but when your staff replied last it first waits teamWaitMinutes for them. Send your staff's messages with author: "staff" so Dexbi knows. See Waiting for your staff. |
teamWaitMinutes | integer, 1 to 60, or "never" | 5 | With "smart" and "ticket": when your staff replied last, how many minutes Dexbi waits for them to reply before it answers the member (Wait for your team). "never": Dexbi doesn't take over. When your staff replied last, it answers only directed messages. |
whenUnsure | "say" or "quiet" | "say" | With "smart" and "public", when your documents don't have the answer: say so, or send none (Says so / Stays quiet). A "ticket" always says so. |
images | boolean | true | Include images from your documents in answers (Show images from the docs). |
ignoreTrolls | boolean | true | "public" agent only: a member who trolls three times, each within an hour of the last, is told once, then gets none except for a support question your documents answer (Ignore trolls). |
ignoreTrollsMinutes | 15, 60, 360 or 1440 | 60 | How long a troll is ignored in that conversation. |
escalation | boolean | true | Let your escalation rules escalate to staff. Off: never handover (Escalate to staff). |
afterEscalation | "quiet" or "open" | your workspace's | After a handover: answer only directed messages, or keep answering (After escalation). |
smartClose | boolean | true | Send close when the member is done (Smart close tickets). |
afterClose | "quiet" or "open" | your workspace's | "ticket" agent, after a close: send none for later messages, or keep answering (Go silent). |
suggestTitle | boolean | false | "ticket" agent: suggest a thread title in title once the issue is clear. Basic plan and up (Smart rename tickets). |
titleInstruction | string up to 500 characters, or null | null | How the title should be written. null uses Dexbi's default: one or two short lowercase words about the issue. |
On Free, suggestTitle doesn't fail: the request works and title stays null.
Your workspace's own setup always applies too: documents, guidance, escalation rules, the agent's name and bio from Personalize, and Access rules like the daily reply limit and Blocked. Documents and guidance set to All channels apply. To make one API-only, pick API in its Channels.
Recipes
Copy the one closest to your app, then adjust.
Support tickets: a Modmail plugin or your own ticket bot
One member, one private thread, staff ready to take over.
{
"conversation": "modmail-thread-8812",
"messageId": "1424571869923463198",
"member": { "id": "member-1042", "name": "Alex" },
"message": "I got charged twice this month and need a refund",
"settings": {
"agent": "ticket",
"reply": "smart",
"escalation": true,
"afterEscalation": "quiet",
"smartClose": true,
"afterClose": "quiet",
"suggestTitle": true
}
}Also send each of your staff's replies in the thread, with "author": "staff":
{
"conversation": "modmail-thread-8812",
"messageId": "1424571901112223344",
"member": { "id": "staff-77", "name": "Sam" },
"message": "Hi Alex, I've refunded the second charge.",
"author": "staff",
"settings": { "agent": "ticket" }
}With "reply": "smart", Dexbi answers every member message, and waits for your staff when they replied last, like Smart reply in a Discord ticket. Staff messages are free and always get none. See author and Waiting for your staff.
On handover, Dexbi answers only directed messages so your staff can reply. On close, it sends none for the rest of the thread. Use title to rename the thread.
Waiting for your staff
With "reply": "smart", when your staff's message is the latest reply to the member, Dexbi gives them time to answer:
- The member writes. Dexbi sends
nonewithteamWaitSeconds, like300. - Start a timer for that many seconds. If the member writes again, send it as usual. You get
noneagain, and the first timer keeps running. - If a staff message comes in, stop the timer. Your staff are on it.
- When the timer runs out, send everything the member wrote while you waited as one
message, with theirimages, and"teamWaitOver": true. Dexbi answers it.
{
"conversation": "modmail-thread-8812",
"messageId": "1424571925512345679",
"member": { "id": "member-1042", "name": "Alex" },
"message": "it's order 1234\nhello?",
"teamWaitOver": true,
"settings": { "agent": "ticket", "reply": "smart" }
}Once Dexbi has answered, it answers the member's next messages right away, until your staff write again. A message that starts with Dexbi's name, or has directed: true, is answered right away too. If your app loses the timer, for example on a restart, Dexbi answers the member's next message once the wait is over. Set the wait with teamWaitMinutes.
With "teamWaitMinutes": "never", Dexbi leaves the member to your staff once they have replied. It sends none with teamWaitSeconds: null, so there's no timer to start. It still answers a message that starts with its name, or has directed: true.
Running Modmail? The Dexbi Modmail plugin does all of this for you.
Website chat widget
One visitor, one chat, no thread to close.
{
"conversation": "website-chat-5f2c91",
"messageId": "msg_01J9ZQ4N7V",
"member": { "id": "visitor-5f2c91", "name": "Guest" },
"message": "Do you ship to Canada?",
"settings": {
"agent": "ticket",
"smartClose": false,
"escalation": true,
"afterEscalation": "open"
}
}Use your chat session id as conversation and a visitor id as member.id. Call the API from your server, never from the page: the browser must never see your key. On handover, show message and email or notify your team with staffNote. With "open", Dexbi keeps helping until someone joins.
Shared community channel
Many members in one place. Dexbi steps in only when it can help.
{
"conversation": "forum-general",
"messageId": "1424571869923463198",
"member": { "id": "member-1042", "name": "Alex" },
"message": "anyone know if the Max plan has priority support?",
"directed": false,
"settings": {
"agent": "public",
"reply": "smart",
"whenUnsure": "quiet",
"ignoreTrolls": true
}
}Dexbi answers questions its documents cover and members who need help, and sends none for chatter and for questions it can't answer. Set directed: true when someone pings or replies to your bot.
What the API doesn't do
Some ticket features act in Discord, so your app owns them instead:
- Auto-close. Dexbi doesn't close a conversation that went quiet. Close idle threads yourself.
- Transcripts. Save your own copy of the conversation if you need one.
- Escalation and close actions. Pinging a role, the escalation message, moving, renaming or deleting a channel. Dexbi only sends
handoverorclose; your app decides what to do. Go silent changes Dexbi's own replies, so it'safterClose. - Channels. Your app decides where Dexbi answers.
Conversations and retries
Keep a thread together with conversation, tell Dexbi who's talking, send the member's images, stop double-sends with messageId, and hand a conversation back to Dexbi.
Custom fields
Name your own fields in a request, like a department or a product, and Dexbi fills them in next to its answer. Route tickets without a second AI.
