KausateKausate Docs

Batch

Place many orders at once, receive their results by webhook and match each result back to the record in your system.

Follow these steps when you order data for many companies at once: screening a portfolio, onboarding a list of customers, or refreshing the reports you hold. You place each order asynchronously at low priority, receive the results by webhook as they complete, and match every result to the record it was for.

1. Set up a webhook

Register a webhook before you place the orders. Kausate then sends each result to your endpoint as soon as it completes, so you do not have to fetch hundreds of orders until they finish. Build the receiver as the Webhooks guide shows: verify the signature, store the delivery, answer 2xx at once and do the work later.

2. Place each order asynchronously, with batch=true

Use the asynchronous endpoint of each capability, such as POST /v2/companies/report, not its /sync sibling: a synchronous call ties up a connection for each company and answers HTTP 408 when a register is slow. See Sync and async.

Add batch=true to the query string. Batch orders run at a lower priority than your interactive ones, so a user waiting for a result is not queued behind a batch; batch changes nothing else. Every order endpoint takes it: company search, company report, documents and the document list, financials, shareholder graphs and their extensions, and beneficial owners.

Send your own reference for each order in customerReference, and any context you need back in metadata:

curl -X POST "https://api.kausate.com/v2/companies/report?batch=true" \
  -H "X-API-Key: $KAUSATE_API_KEY" \
  -H "Kausate-Version: 2026-08-01" \
  -H "Content-Type: application/json" \
  -d '{
  "kausateId": "co_zz_4O3wnpE5u1K5AXnkARuhp",
  "customerReference": "portfolio-2026-q4-0001",
  "metadata": {"portfolio": "2026-q4", "row": 1}
}'
import os

import requests

response = requests.post(
    "https://api.kausate.com/v2/companies/report",
    params={"batch": "true"},
    headers={
        "X-API-Key": os.environ["KAUSATE_API_KEY"],
        "Kausate-Version": "2026-08-01",
    },
    json={
        "kausateId": "co_zz_4O3wnpE5u1K5AXnkARuhp",
        "customerReference": "portfolio-2026-q4-0001",
        "metadata": {"portfolio": "2026-q4", "row": 1},
    },
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.kausate.com/v2/companies/report?batch=true", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.KAUSATE_API_KEY!,
    "Kausate-Version": "2026-08-01",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "kausateId": "co_zz_4O3wnpE5u1K5AXnkARuhp",
    "customerReference": "portfolio-2026-q4-0001",
    "metadata": { "portfolio": "2026-q4", "row": 1 }
  }),
});
if (!response.ok) {
  throw new Error(`${response.status}: ${await response.text()}`);
}
console.log(await response.json());

Each call answers at once with the orderId, your customerReference and metadata, and the resultUrl to fetch the result from, as in the Introduction. Store the orderId on your record. When you order for one of your own customers, also send X-Customer-Id, so that the charges are recorded against that customer (Authentication).

3. Match each result to your record

Every result carries the orderId, customerReference and metadata of its order, in the webhook delivery and in the order's GET response alike. Look the record up by orderId, or by customerReference when you have not stored the orderId yet.

FieldLimitUse it for
customerReferenceAt most 150 characters of ASCII letters, digits, - and _.The id of the record in your system.
metadataA JSON object of at most 4,096 bytes when serialized.Context you want back, such as a batch name or row number.

metadata cannot be searched or filtered. It is stored and logged as you send it, so never put credentials in it.

The same company ordered twice on the same UTC day, with the same endpoint, parameters and customer ID, returns the earlier order: the same orderId, with "cachedOrder": true, and no second charge. customerReference and metadata are not part of the comparison, so two records for one company share one order. The webhook then delivers the earlier result again, carrying the repeat request's customerReference and metadata, so each record still gets its own delivery; fetching the order returns the first request's reference. Set bypassCache to read the register again instead; that order is charged again.

4. Collect what did not arrive

A delivery your endpoint missed is not lost. For any record whose order has no result yet, fetch its resultUrl:

statusWhat to do
runningStill in progress. Check again later; waitingMessage says why an order is waiting, where it is.
completedThe result is in result.
failedThe order failed. Branch on its code (Errors).
canceledThe order was canceled.
terminatedThe order was terminated.
timedOutThe order took longer than its maximum time.

A failed order is never reused: ordering the same company again runs a new order. Recover missed deliveries covers resending results from the dashboard.

5. Stay within the limits

  • Request rate. Kausate sets no fixed request rate on your API key; your orders are queued fairly alongside other customers' orders. An HTTP 429 or 503 asks you to retry after its Retry-After interval; see Limits.
  • Time. Set globalTimeout on an order to give it a time budget in whole minutes, from 1 to 10,080. Fetching an order that ran out of it returns the code request.timeout.
  • Credits. Each order is charged once it has its result. When your organization runs out of credits or reaches its credit limit, new paid orders return HTTP 403 with code billing.credit_limit_exceeded, while orders already running finish. Check GET /v2/billing/balance before a large batch, and cap a shareholder graph's spend with maxCredits. See Credits.

Check that it worked

Every record in your batch has an orderId and, once its orders are done, a final status. Records with completed hold their result; records with failed hold a code you can act on. GET /v2/billing/ledger lists the charge for each order, with its customerReference, and filters by customerId.

Try the whole flow on sandbox companies first: their data calls are free, and a search for Acme returns hundreds of companies to order.

  • Webhooks: build the receiver for the results.
  • Sync and async: how asynchronous orders work, and how orders are reused within a day.
  • Limits: time, size and depth limits, and busy responses.
  • Credits: what is charged, and when.
  • Search: find the companies to order for.

Last updated on

On this page