API overview

Base URL, authentication and the conventions every AutoTally REST call follows.


The AutoTally REST API reads and writes Tally companies over plain HTTP and JSON.

curl -s https://relay.autotally.ai/v1/companies \
  -H "authorization: Bearer $AUTOTALLY_TOKEN"

There is no SDK. Use any HTTP client. Download the contract from /openapi.json for Postman or code generation.

Base URL

https://relay.autotally.ai

Every route below sits under /v1. GET /health needs no credential and tells you the API is up.

Authentication

Send an API key as a bearer token on every request:

Authorization: Bearer tapi_...

A missing, wrong or revoked key gets 401 unauthorized.

Calls must come from a server. The API does not allow browser calls from other sites, so a call from your web page fails its preflight. Never put a key in a browser or a mobile app.

Addressing a company

A key's reads cover every company in the workspace. Its writes go to its bridge. Get names and GUIDs from GET /v1/companies, which returns a plain array.

Where Parameter Value
Reads and reports ?company= The exact, case-sensitive name
Writes companyGuid in the body The company's guid
Deleting a voucher ?companyGuid= The company's guid
Document list ?company= The company's guid, not its name

If a workspace has one company you can leave ?company= off most reads. With several you get 400 bad_request. Trial balance, profit and loss, and balance sheet always need it. URL-encode names: Sharma%20%26%20Sons.

Dates

YYYY-MM-DD everywhere. from and to on /v1/vouchers filter the voucher's date, not when it was changed.

Amounts

Positive is debit, negative is credit, and a voucher's entries must net to zero. The same sign applies to bill and cost-centre allocations, and they must sum to their ledger entry.

Numeric fields can arrive as strings on some reads. Parse defensively:

const amount = Number(voucher.amount ?? 0);

Pagination

Lists take page (default 1) and pageSize (default 100, maximum 1000). A larger pageSize is silently cut to 1000.

{ "page": 1, "pageSize": 100, "total": 412, "items": [] }

/v1/companies and /v1/outstandings are not paged. /v1/documents uses limit and a cursor instead.

Lists filter with search (a case-insensitive part of the name). Some add their own filters. See the reference.

Response headers

Reads carry X-Tally-Source and X-Tally-Synced-At. There are no others. Read Synced data and freshness, and call GET /v1/status when freshness matters.

Writes

Every write works the same way:

  1. Send it without commit. That is a dry run. It stores nothing, and answers 200 with "valid": true, or an error.
  2. Send it again with ?commit=true. You get 202 with intentId, state and deduped.
  3. Follow it with GET /v1/intents/<intentId> until the write is confirmed.
curl -s -X POST "https://relay.autotally.ai/v1/ledgers?commit=true" \
  -H "authorization: Bearer $AUTOTALLY_TOKEN" \
  -H "content-type: application/json" \
  -H "idempotency-key: customer-8841-ledger-v1" \
  -d '{
    "companyGuid": "a1b2c3d4-0000-0000-0000-000000000001",
    "ledger": { "name": "Mehta Retail", "group": "Sundry Debtors", "isBillWise": true }
  }'

The Idempotency-Key header is required on every write, dry runs included, or you get 400. Use one key per logical write, derive it from your own record id, and reuse it on retries. A failed or rejected write stays failed under its key: use a new key to try again. Keys are shared across your workspace and do not expire.

Masters are altered and deleted by name in the body, not in the path. A voucher is altered and deleted by guid in the path. An alter of a voucher replaces it whole.

A DELETE with a content-type: application/json header and no body is refused with 400. Leave the header off, as the voucher delete recipe does.

Read Write safety in full before you commit to a customer's books.

Limits

JSON bodies are limited to 1 MiB. Over that you get 413.

Poll responsibly, and be ready for 429: back off, and honour Retry-After if it is sent. See Errors.

Events

There are no webhooks, no change feed and no updatedSince. To learn about changes, poll. See Keeping data in sync, and follow writes with GET /v1/intents/:id.

Versioning

Every route is under /v1.

Reference

Page Covers
Companies and status Companies, status, whether Tally is reachable
Masters Ledgers, groups, stock items, units, godowns and the rest
Vouchers List, read, create, alter, delete
Write status Following and retracting a write
Reports Statements, GST, TDS, cost centres
Outstandings and analytics Bills, ageing, party and item analytics
Documents Uploading and reading bills
Rules and playbooks Reading the rules your workspace has taught

Also read Errors, Keeping data in sync, Integrate a CRM or SaaS and Recipes.