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.
Add fields to a request and Dexbi fills them in next to its answer: which team should take the ticket, which product it's about, whether the member wants a refund, a one-line summary. You get the labels and the reply from one request, so your app can route the ticket without asking another AI.
Example
{
"conversation": "ticket-4471",
"messageId": "msg-20931",
"member": { "id": "member-1042", "name": "Alex" },
"message": "I upgraded to the yearly plan yesterday and got charged twice. Can I get one of them back?",
"fields": {
"department": { "pick": ["billing", "technical", "sales"] },
"product": { "pick": ["Mobile app", "Website", "Desktop app"] },
"wantsRefund": { "yesNo": true, "description": "The member is asking for money back" },
"summary": { "text": "one short line about the issue" }
}
}The response has fields with the same names:
{
"action": "reply",
"message": "Sorry about the double charge! The duplicate payment is refunded automatically within 5 to 7 business days. If it hasn't come back by then, reply here and we'll sort it out.",
"staffNote": null,
"title": null,
"conversation": "ticket-4471",
"fields": {
"department": "billing",
"product": null,
"wantsRefund": true,
"summary": "Charged twice after upgrading to the yearly plan; wants one charge back"
}
}product is null because the message doesn't say which product it's about: Dexbi leaves a pick empty rather than guess.
You choose the names and the options in every request. Nothing is set up in the dashboard, and the fields never change what Dexbi says to the member.
The three kinds
Each field is exactly one kind.
| Kind | Write it as | You get back |
|---|---|---|
| Pick | { "pick": ["billing", "technical", "sales"] } | One of your options, exactly as you wrote it, or null when none fits. |
| Yes or no | { "yesNo": true } | true or false. |
| Text | { "text": "one short line about the issue" } | A short answer that follows your instruction, or null when the conversation doesn't say. |
Any field can also have a description that says what it means. Dexbi reads the field's name too, so a clear name like wantsRefund often needs none. Add a description when the name alone could be read two ways:
"urgent": { "yesNo": true, "description": "The member can't use the product at all right now" }A pick returns null rather than guess. "yo whats up" gets null for department and product, not a random team. Text answers are written in English unless your instruction asks for another language.
Limits
A request that breaks a limit gets a 400 that names the field, like fields.product.pick: Each option must be different.
| What | Limit |
|---|---|
| Fields per request | 10 |
| A field's name | Starts with a letter, then letters, digits or _. Up to 40 characters. |
Options in a pick | 1 to 20, all different |
| Each option | Up to 100 characters |
A text instruction or a description | Up to 200 characters |
A text answer | Up to 300 characters |
When a field is null
Fields are filled in whatever Dexbi decides: reply, handover, close, and none too. So you can route a ticket even when Dexbi stays quiet.
A field is null when Dexbi doesn't know:
- No option fits, or the conversation doesn't say yet. A
textfield isnullwhen the conversation doesn't answer it. - Dexbi didn't read the message: it had nothing to read (like an emoji on its own), it was sent with
reply: "pings"and notdirected, or the conversation was escalated to your staff and Dexbi is staying quiet. - The request never reached Dexbi's AI: the member is blocked or over their daily limit, or your workspace used its monthly AI replies.
- A brief outage on our side. The reply itself is unaffected.
yesNo fields are true or false whenever Dexbi read the message, and null only in the cases above.
Fields read the conversation: the latest message and what came before it in the same conversation. They don't read your documents. Every name you sent is always in fields, so check for null before you use one.
Recipe: route tickets
Ask for the team, the product and a summary with every message, then route on them.
const response = await fetch("https://api.dexbi.app/v1/messages", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.DEXBI_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
conversation: ticket.id,
messageId: message.id,
member: { id: message.authorId },
message: message.text,
fields: {
department: { pick: ["billing", "technical", "sales"] },
product: { pick: ["Mobile app", "Website", "Desktop app"] },
summary: { text: "one short line about the issue" },
},
}),
});
const answer = await response.json();
const { department, product, summary } = answer.fields;
// Route first: this works on every action, `none` included.
if (department) await moveTicket(ticket, department);
if (product) await tagTicket(ticket, product);
if (summary) await setTicketTopic(ticket, summary);
if (answer.message) await sendToMember(answer.message);
if (answer.action === "handover") await alertStaff(department ?? "support", answer.staffNote);moveTicket, tagTicket, setTicketTopic, sendToMember and alertStaff are your app's own functions.
Labels can change as the member explains more. Ask for them on every message and keep the latest one that isn't null.
Cost and speed
Fields cost nothing extra. They don't count as AI replies or as extra calls: a request with fields counts like one without.
pick and yesNo fields add almost no time. text fields can add about half a second, so ask for one only when you'll use it.
