Developers & AI
Connect Tonbab to your tools — and to your AI.
A REST API with scoped keys and signed webhooks, and an AI connector with 107 tools that brings your company data into Claude, ChatGPT or Gemini CLI — always within each person’s own permissions.
Included on every plan — Free is read-only.
AI connector (MCP)
Tonbab inside Claude, ChatGPT and Gemini CLI
Ask about sales, receivables, profit, stock, purchasing, customers, your sales pipeline and leave in plain Thai or English — in every company you tick. See what is waiting for your approval, log leads and work updates, and let the assistant prepare drafts, leave requests and expense claims for you to check. It uses your plan’s API quota, not AI credits.
- 1
Add Tonbab by URL
In Claude, ChatGPT or Gemini CLI, add a custom connector and paste this address:
https://api.tonbab.com/mcp - 2
Sign in and choose
Sign in with your Tonbab account, pick your default company, tick any other companies it may use, and choose what the assistant may see and do.
- 3
Ask in your own words
“Which customers are more than 30 days overdue?” · “Profit and loss this month?” · “Draft a purchase request for 200 cartons from our usual supplier.”
What it can read
- Your approvals inbox — what is waiting for you to approve, how long it has waited, and a link to decide it in Tonbab
- Accounting — sales summary, receivables and payables aging, profit and loss, trial balance, invoices, bills, payments
- Products and stock — levels, movements, lots, serials, valuation (cost-gated)
- Purchasing — PRs, POs, goods receipts
- Sales — orders and delivery notes
- CRM — customers, contacts, leads, deals, activities, and the pipeline report (forecast, win rate, lost reasons)
- People — my leave balance, leave requests, expense claims
- Manufacturing and service — work orders, job controls and their cost, BOMs, service jobs and schedule
- Docs — search pages, read database rows
- Lookups — company members, CRM pipelines and stages, units of measure, VAT and withholding-tax rates
What it can create — drafts and requests
- A purchase request, a stock count or your own expense claim (as drafts)
- A quotation, a stock adjustment, a stock transfer or a delivery note (as drafts — a person posts or issues them)
- New or edited products (with a product photo) and warehouses
- A leave request for yourself — your approver decides
- A CRM lead, deal, activity or work update
- Moving a deal you are responsible for to the next stage, or closing it won or lost
- A customer or vendor record
Creating works on every paid plan, from Starter; Free connections are read-only.
Drafts and requests, not decisions
The assistant can prepare drafts and requests. People still approve, post and pay — nothing is approved, posted or paid for you.
Never more than your role
A connection gets what you consented to and what your role allows — today. If you can't see costs, neither can your assistant.
Only the companies you tick
Belong to several companies? Tick the ones a connection may use. Each call is re-checked against your role in that company, and summaries across companies come back one company at a time.
Disconnect any time
Every connected app is listed in your API settings; disconnect it and its access ends.
REST API
Build on the same records your team uses
API keys with scopes
Admins create company keys limited to the scopes an integration needs. A key acts as its creator: if their permissions shrink, so does the key, and it stops when they leave the company.
Test keys that never save
A tnb_test_ key runs every check on write requests and returns the result — but saves nothing. Build against real data safely.
Signed webhooks
Subscribe to events. Each delivery carries a timestamped HMAC-SHA256 signature, and failed deliveries retry with backoff.
Events feed
Prefer polling? Read the same events from the events endpoint and pick up where you left off.
OpenAPI reference
Interactive docs generated from the same spec the API runs on — always in step with what ships.
Same rules as the app
Every call is checked against the same permissions as a person using Tonbab, and drafts and requests wait for the usual approvals.
Safe to retry
If a connection drops and the assistant sends the same request again, Tonbab saves it once and returns the first result.
curl https://api.tonbab.com/v1/products \
-H "Authorization: Bearer $TONBAB_API_KEY"Tonbab-Signature: t=<unix time>,v1=<hex HMAC-SHA256>
# v1 = HMAC-SHA256(secret, "<t>.<raw body>")Getting started
From zero to your first call in three steps
1 · Create a key
An admin creates a company key in Settings → API, choosing only the scopes the integration needs. Use a tnb_test_ key while you build — writes are validated but never saved.
export TONBAB_API_KEY=tnb_test_…2 · Call the REST API
Send the key as a Bearer token. Writes create drafts or requests for a person to review; add an Idempotency-Key so retries never duplicate.
curl https://api.tonbab.com/v1/products \ -H "Authorization: Bearer $TONBAB_API_KEY"3 · Connect an AI assistant (MCP)
MCP clients such as Claude, ChatGPT or Gemini CLI connect to the MCP endpoint and sign in with OAuth — the user ticks the companies and consents to scopes; every tool takes a company argument and access never exceeds their role there. Writes accept a client_request_id, so a retried call is saved once.
https://api.tonbab.com/mcp
Limits by plan
Per company, across the REST API and the AI connector together.
| Limit | Free | Starter | Standard | Business | Enterprise |
|---|---|---|---|---|---|
| Access | Read-only | Read + drafts and requests | Read + drafts and requests | Read + drafts and requests | Read + drafts and requests |
| API keys | 1 | 2 | 3 | 5 | Unlimited |
| Webhook endpoints | 1 | 1 | 2 | 3 | 20 |
| Requests per minute | 10 | 30 | 60 | 60 | 600 |
| Calls per day | 300 | 3,000 | 10,000 | 20,000 | 500,000 |