Skip to content

Build on TheBusinessApp.

A plain REST API over HTTPS with JSON in and out. Read and add customers, enquiries, jobs, quotes, invoices and more, download accounting export files, and get told the moment things change with signed webhooks.

  • Base URL

    https://api.thebusinessapp.co.uk/v1

  • Format

    JSON over HTTPS

  • Rate limit

    120 a minute

    per key

  • Spec

    OpenAPI 3.1

Authentication

An owner or admin creates keys in Settings → Developers. Each key belongs to one company, is shown once, and is stored only as a hash. Give each integration its own key so you can revoke one without breaking the others.

Send the key as a bearer token on every request:

curl
curl https://api.thebusinessapp.co.uk/v1/me \
  -H "Authorization: Bearer tba_live_XXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Scopes limit what a key can do. They come in pairs per resource, such as customers:read and customers:write; write includes read. Accounting exports use exports:read. A full-access key holds *. Calls outside a key’s scopes return 403 insufficient_scope.

The API can create draft quotes and invoices. It never sends documents to customers or takes payments; those stay in the app where someone can check them first. Staff records never include pay rates.

Keep keys on your server. Don’t put them in a web page or mobile app, where anyone can read them.

Resources

Every list endpoint takes limit (1–100, default 25), cursor, created_since and, where records have one, updated_since. Get a single record with GET /{resource}/{id}. Resources follow the modules you have switched on; a switched-off module returns 403 module_disabled.

PathScopeOperationsNotes
/customerscustomers:read / :writelist · get · create · updateFilters: email, status
/customers/{id}/contactscustomers:read / :writelist · createAlso GET /contacts?customer_id=
/customers/{id}/sitescustomers:read / :writelist · createSites and properties. Also GET /sites
/enquiriesenquiries:read / :writelist · get · createLeads land in your pipeline with source “api”
/quotesquotes:read / :writelist · get · create draftTotals are worked out for you. Sending stays in the app
/jobsjobs:read / :writelist · get · create · updatePATCH status to move a job on, e.g. done
/jobs/{id}/visitsjobs:read / :writelist · createPATCH /visits/{id} to change a visit’s status or time
/invoicesinvoices:read / :writelist · get · create draftNever sends, never takes payment
/paymentspayments:readlist · getRead only
/productsproducts:read / :writelist · get · create · updateYour price list
/staffstaff:readlist · getRead only. Pay rates are never included
/timesheetstimesheets:readlist · getRead only
/stock-itemsstock:readlist · getStock per product and location. Read only

Field names and types for every endpoint are in the OpenAPI spec. Import it into Postman, Insomnia or a code generator.

Accounting exports

The same export files the accountant hub produces, for scripts that send the books on a schedule. These endpoints are read-only and need the exports:read scope (a * key holds it too).

  • GET /exports lists each package, its datasets and import notes.
  • GET /exports/{target}/{dataset} returns the CSV as a file download. Optional from and to (YYYY-MM-DD) set the period. since_last_export=true leaves out records an earlier API export already returned. format=json wraps the file with row counts and totals; exports that produce more than one file always come back as JSON.
targetPackagedataset
xeroXerosales, bills, contacts, bank, payments
quickbooksQuickBooks Onlinesales, contacts, products, credits
sage50Sage 50 (UK)sales, bills, payments, contacts
sage_bcSage Business Cloudcontacts, products, sales, bills
freeagentFreeAgentcontacts, bank, sales
curl
curl "https://api.thebusinessapp.co.uk/v1/exports/xero/sales?from=2026-07-01&to=2026-09-30&since_last_export=true" \
  -H "Authorization: Bearer $TBA_KEY" -o xero-sales.csv

Files are laid out for each package’s own import screen. Check the first import with your accountant before relying on it.

Lists and pagination

Lists are newest first. When has_more is true, pass next_cursor back as cursor to get the next page. Cursors are stable while records are added, so you won’t skip or repeat rows.

request
curl "https://api.thebusinessapp.co.uk/v1/customers?limit=50&updated_since=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer $TBA_KEY"
response
{
  "object": "list",
  "data": [
    { "id": "6e48692e-69f2-4d1c-86f9-8047000df7e2", "object": "customer",
      "name": "Jane Smith", "email": "jane@example.com", "postcode": "BS1 4DJ",
      "status": "active", "tags": ["landlord"],
      "created_at": "2026-10-17T09:00:00Z", "updated_at": "2026-10-17T09:30:00Z" }
  ],
  "has_more": true,
  "next_cursor": "eyJjIjoiMjAyNi0xMC0xN1QwOTowMDowMFoiLCJpIjoiNmU0OC4uLiJ9"
}

For a nightly sync, store the time you started and pass it as updated_since next time:

javascript
// Node 18+: fetch every customer changed since the last sync
let cursor = null, all = []
do {
  const url = new URL('https://api.thebusinessapp.co.uk/v1/customers')
  url.searchParams.set('limit', '100')
  url.searchParams.set('updated_since', lastSync)
  if (cursor) url.searchParams.set('cursor', cursor)
  const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.TBA_KEY}` } })
  if (res.status === 429) { await new Promise((r) => setTimeout(r, Number(res.headers.get('Retry-After')) * 1000)); continue }
  const page = await res.json()
  all.push(...page.data)
  cursor = page.next_cursor
} while (cursor)

Creating and updating

Send JSON with Content-Type: application/json. Create returns 201 with the new record; update (PATCH) changes only the fields you send. Unknown fields are rejected so typos show up straight away. Ids you link to, such as customer_id, must belong to your company.

create an enquiry
curl https://api.thebusinessapp.co.uk/v1/enquiries \
  -H "Authorization: Bearer $TBA_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: website-form-81723" \
  -d '{
    "name": "Sam Patel",
    "email": "sam@example.com",
    "phone": "07700 900123",
    "service": "Boiler service",
    "message": "Combi losing pressure, can you take a look this week?"
  }'
create a draft quote
curl https://api.thebusinessapp.co.uk/v1/quotes \
  -H "Authorization: Bearer $TBA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "6e48692e-69f2-4d1c-86f9-8047000df7e2",
    "title": "Bathroom refit",
    "items": [
      { "description": "Labour", "quantity": 8, "unit_price": 45, "vat_rate": 20 },
      { "description": "Thermostatic shower valve", "quantity": 1, "unit_price": 185, "vat_rate": 20 }
    ]
  }'
complete a job
curl -X PATCH https://api.thebusinessapp.co.uk/v1/jobs/2ce27819-cc51-48c5-ad61-14161d5f2dd6 \
  -H "Authorization: Bearer $TBA_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "done" }'

Idempotency

Add an Idempotency-Key header (any unique string up to 255 characters) to a POST or PATCH and you can retry it safely after a timeout. For 24 hours, repeating the same request with the same key returns the first response with Idempotent-Replayed: true instead of creating a duplicate. Reusing a key with a different body returns 422 idempotency_conflict.

Errors

Every error has the same shape. Branch on error.code, never on the message, which may change. Each response carries an X-Request-Id header.

example
HTTP/2 403
X-Request-Id: req_6938fce94a9a4a29becc

{
  "error": {
    "type": "permission_error",
    "code": "insufficient_scope",
    "message": "This API key lacks the `invoices:read` scope",
    "request_id": "req_6938fce94a9a4a29becc",
    "details": { "required_scope": "invoices:read" }
  }
}
StatusCodeMeaning
400validation_failed / invalid_cursorBody isn’t a JSON object, or the cursor was changed
401unauthenticated / invalid_api_keyNo key, a malformed key, or a revoked key
403insufficient_scopeThe key doesn’t hold the scope the endpoint needs (details.required_scope)
403module_disabledThat area of the app is switched off in Settings → Modules
404not_foundNo record with that id in your organisation
405method_not_allowedThe resource doesn’t support that method
409idempotency_in_progressThe first request with this Idempotency-Key is still running
422validation_faileddetails.fields lists each bad field
422idempotency_conflictYou reused an Idempotency-Key with a different body
429rate_limitedOver the per-key limit; wait for Retry-After seconds
500internal_errorOur fault. Quote the request_id if you contact us

Rate limits

Each key gets 120 requests a minute. Responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix seconds). Over the limit you get 429 with Retry-After. Need more? Get in touch.

Versioning

The version is in the path (/v1). Within v1 we only add things: new endpoints, new optional fields, new event types. Breaking changes would come as /v2, with notice.

Connect your other tools to one business app.

14 days free, no card. Bring your customers and price list across from a CSV, switch on what you need, and invite the team when you’re ready.

No card. Monthly, no contract. Cancel any time and take your data with you.