New Light partners with Amesto GlobalLight partners with Amesto Global Read the announcement

API/Getting started

Rate limits

Request limits per API user and company, batch sizes, and how to handle a 429.

Section
Getting started
Reading
5 min read
On this page
  1. 01Rate limit structure
  2. Requests per minute
  3. Daily limit
  4. 04Reading the headers
  5. 05Handling a 429
  6. Best practices
  7. Concurrent call limits
  8. 08Invoice and transaction batch limits
  9. 09Sandbox limits
  10. 10Need higher limits?

The Light API limits how many requests each integration can make, to keep it fast and fair for everyone. A request over the limit gets a 429 Too Many Requests response.

Rate limits apply to API keys, OAuth tokens and MCP tokens.

Rate limit structure

Two limits apply by default, and every request is checked against both. A request goes through only when both allow it. Light can agree different limits with your company.

Requests per minute

  • 300 requests per minute per API user.
  • The allowance refills continuously, at 5 requests a second with the default limit, rather than all at once at the top of each minute. When the allowance is full you can send a burst of up to 300 requests at once.
  • An API key uses its service account’s allowance. OAuth tokens issued to the same person share one allowance between them.

Daily limit

  • 100,000 REST API requests per day per organization.
  • REST requests and MCP tool calls count toward the same company total. MCP tool calls have additional headroom above the REST limit.
  • Resets at midnight UTC.

An accepted batch costs one request regardless of its size. Allow one more request per status poll and per page of results.

Reading the headers

When the API checks your request limits, the response includes these headers:

Header Meaning
X-RateLimit-Limit The size of the window the headers describe (300 or 100,000 by default)
X-RateLimit-Remaining Requests left in that window
X-RateLimit-Reset Unix timestamp, in seconds, when that window is back to full capacity

The three headers describe one window at a time: whichever of the two has fewer requests remaining. Normally that is the per-minute window. Once the daily count left drops below the per-minute count left, they switch to the daily window. The X-RateLimit-Limit value tells you which one you are looking at.

X-RateLimit-Reset is when the window is completely full again (the per-minute allowance fully refilled, or midnight UTC for the daily limit). It is not the moment the next single request would be accepted, which for the per-minute window is usually much sooner.

Handling a 429

When a request exceeds the minute or daily limit, the 429 has a flat { "type": "TOO_MANY_REQUESTS", "message": "Rate limit exceeded" } body, described with the other error shapes in Pagination, filtering and errors. It also carries a Retry-After header, which is only sent on a 429:

Header Meaning
Retry-After Whole seconds to wait before retrying

Retry-After is worked out from the same timestamp as X-RateLimit-Reset, so for the per-minute limit it is conservative and a retry may succeed sooner. A request refused by the minute or daily limit leaves both allowances intact.

Best practices

  1. Watch the headers on every response. Slow down as X-RateLimit-Remaining gets low, instead of waiting for a 429.
  2. Back off exponentially. Wait progressively longer between retries: 1s, 2s, 4s, 8s.
  3. Respect Retry-After. Always wait at least that long before retrying.
  4. Spread out scheduled jobs. Avoid running every batch operation at the same time.

Concurrent call limits

Separately from the rate limits, a few endpoints allow only a small number of calls in flight at once per API user. Card transaction imports allow two per API user on each server instance. Going over returns a 429 with the type CONCURRENCY_LIMIT_EXCEEDED. The concurrency check runs after the request-budget check. Its 429 has no Retry-After header, and the X-RateLimit headers still describe your request budget. Wait for one of your running calls to finish, or retry after a short pause.

The MCP server reports throttling differently, as an error inside a 200 response. See Using Light from an AI client.

Invoice and transaction batch limits

Endpoint Maximum per call Result
POST /v1/invoice-receivables/batch-create 1,000 invoices and 100,000 invoice lines in total 202 with a batch operation ID
POST /v1/customers/batch-create 1,000 customers 202 with a batch operation ID
POST /v1/customer-credits/batch-create 1,000 customer credits and 100,000 lines in total 202 with a batch operation ID
POST /v1/invoice-payables/batch-create 1,000 bills and 100,000 line items in total 202 with a batch operation ID
POST /v1/credit-notes/batch-create 1,000 vendor credit notes and 100,000 lines in total 202 with a batch operation ID
POST /v1/journal-entries/batch-create 1,000 journal entries and 100,000 lines in total 202 with a batch operation ID
POST /v1/bank-accounts/{bankAccountId}/bank-transactions 500 transactions for one bank account Returns only newly inserted transactions. Supply a stable, nonblank transactionId on every row so retries skip duplicates in that account.
POST /v1/card-transactions/import 100 transactions Returns CREATED, SKIPPED_DUPLICATE or FAILED for each row in input order. Supply the issuer's transaction ID as providerId so a retry can return the existing ID.
PATCH /v1/card-transactions/batch-update No limit 204 with an empty body. Updates run asynchronously. The response has no operation ID to poll.

If a batch-create call exceeds either the record count or the total line count, Light rejects the whole request with 400 Bad Request. Split the records into smaller batches that each fit both limits before submitting again.

A company can have 20,000 pending records across all of its batch-create calls. If a submission would exceed that limit, Light returns 429 with Retry-After: 60. For an accepted batch, follow Check the results of an invoice batch. The same steps apply to every batch-create endpoint.

Sandbox limits

The sandbox environment runs with much higher limits: 10,000 requests per minute and 1,000,000 per day. An integration tested only against the sandbox will not meet the production limits until it goes live. Test your handling against the header values rather than waiting to see a 429.

Need higher limits?

If your use case requires higher rate limits, contact Light support at help@light.inc to discuss custom limits for your organization.