Guides
Overview
Connect workthin to your support chatbot. When a customer reports an issue, the chatbot checks workthin first. If matching knowledge exists, it resolves automatically — no human needed.
REST API Usage
async function handleCustomerMessage(message: string) {
// Search workthin for matching knowledge
const params = new URLSearchParams({
q: message,
scope: 'global',
detail: 'summary',
})
const res = await fetch(
`https://workthin.app/api/v1/search?${params}`,
{
headers: {
'Authorization': 'Bearer ' + process.env.WORKTHIN_API_KEY,
},
}
)
const data = await res.json()
if (data.data && data.data.length > 0) {
return {
resolved: true,
response: data.data[0].title + ': ' + data.data[0].body,
}
}
// No match — escalate to human agent
return {
resolved: false,
response: 'Connecting you with a support agent...',
}
}Escalation Flow
Customer message
→ workthin search (summary)
→ Match found → Return solution (auto-resolve)
→ No match → Escalate to human
→ Human solves
→ Create knowledge (vaccinate)Projected Results
Projects using this pattern report (projected):
| Metric | Before | After |
|---|---|---|
| Tickets escalated to humans | 100% | ~40% (projected) |
| Average resolution time | 4 hours | 12 seconds auto (projected) |
| Repeat issue rate | High | Decreasing weekly (projected) |
The more knowledge you create, the fewer tickets reach human agents.