Quickstart

Send your first message to the Dexbi API and read Dexbi's answer, in two minutes.

The Dexbi API answers a member's message the way Dexbi answers in Discord: with your workspace's documents, guidance and escalation rules. You send one message. Dexbi sends back what to do and what to say. Your app does the rest.

Use it from a Modmail plugin, your own bot, or a chat widget on your website. It's on every plan, Free included.

1. Create an API key

In the dashboard, open Settings > API keys and click Create key. Copy the key right away: it's shown only once. Owners and admins can create keys.

Settings, API keys, with the Create key button highlighted

Keep the key on your server. Never put it in browser code, a Discord message or a public repository.

Keys made by Modmail

When you connect Modmail from Deploy (see Use Dexbi with Modmail), the plugin gets a key of its own. That key belongs to its Modmail deployment:

  • Dexbi uses the deployment's settings from the dashboard, and ignores the request's settings.
  • Each response also has a deployment object, with the deployment's id and name, replyAs ("bot" or "anonymous"), handoverRoleIds (the roles to ping on a handover) and paused (true while the deployment is paused: every message is answered none).
  • Each response also has branding: who the plugin shows as the reply's sender. On the Free plan it's Dexbi (name, iconUrl, and required: true, so even anonymous replies use it), and message already ends with a "Powered by dexbi.app" line. On a paid plan it's your server's Personalize profile, with Dexbi's name or picture for any part you didn't set.
  • It isn't listed under Settings > API keys, can't be deleted there, and doesn't count toward your key limit. Disconnect in the deployment, or deleting the deployment, stops it working.

Keys you create under Settings > API keys aren't tied to a deployment. They work as described on these pages.

2. Send a message

Replace dexbi_YOUR_KEY with your key and run one of these.

curl https://api.dexbi.app/v1/messages \
  -H "Authorization: Bearer dexbi_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "conversation": "thread-8812",
    "member": { "id": "member-1042" },
    "message": "How do I get a refund?"
  }'

The three fields are all you need:

  • conversation: your id for the thread. Use the same one for every message in it.
  • member.id: who wrote the message, like their Discord user id.
  • message: what they wrote.

An answer can take a few seconds, so allow up to a minute before timing out.

3. Read the answer

{
  "action": "reply",
  "message": "You can ask for a refund within 14 days from your order page.",
  "staffNote": null,
  "title": null,
  "conversation": "thread-8812",
  "attribution": { "text": "Powered by Dexbi", "url": "https://dexbi.app", "required": true }
}

On the Free plan, show "Powered by Dexbi", linked to dexbi.app, next to Dexbi's answers. See Show the Powered by Dexbi credit.

The text comes from your workspace's documents. If they don't cover the question, Dexbi says it doesn't have that.

Look at action and do what it says:

actionDo this
replySend message to the member.
handoverSend message to the member, and alert your staff with staffNote.
closeSend message, then close the thread.
noneNothing.

That's the whole API: one endpoint, four actions.

Next

The API is also described as an OpenAPI 3.1 document at https://api.dexbi.app/v1/openapi.json. Import it into Postman, Insomnia or a code generator.

On this page