Skip to main content
After you create a key, four calls take you to a first check: list your portfolios, see what one holds, check it at prices you supply, and read a refusal. Illustrative example. The figures are hypothetical, not a recommendation. Allocait states facts about your own rules. A result inside every range does not say a change is advisable. Allocait cannot approve, stop or place an order.

Before you start

You need an account with agent access, the holdings you want checked and at least one allocation band. If you haven’t set those up, follow the app quickstart first. A Read only key is enough here, because every call on this page only reads.
1

Create a key

In the app, open Settings > API keys and select Create API key. Enter a name, choose Read only, and select Create key. Copy the key before you select Done. Allocait shows a key once and stores only its hash.Keep the key in an environment variable. Every request sends it in the x-api-key header.
Authentication covers permissions and access levels.
2

List your portfolios

A new account starts with a Main Portfolio. Every list route returns data and has_more.
Copy portfolio_id. The next calls need it. Allocait supports US dollars only, so base_currency is always USD.
3

See what needs a price

The snapshot returns what you hold in shares and your rules. It returns no price of its own, so the total, the percentages, the exposure, the status and each non-cash value come back null. symbols_to_price lists the symbols you need to price. Cash needs no price. Neither does an option with a mark, the per-share premium you recorded for it, which Allocait counts as its price. This response is trimmed: rules, monitors, generated_at and some position fields are left out.
See Prices for why Allocait never fills a price in.
4

Run your first check

Get a price for each symbol in symbols_to_price from your own source, then send them with the same portfolio.
The values and the check now come from your prices. This response is trimmed the same way. exposure shows only its totals here; it also lists classes and holdings.
Read compliance.status:Here Commodities is 18.69% of the portfolio against a range of 4 to 13%. outside_by states how far: 5.69 percentage points above the maximum, or 5,690 dollars at your prices. It describes where the rule stands. It doesn’t say what to do.POST /compliance/check returns this compliance block on its own. It needs a price for every non-cash position, except a held option with a mark. scenario_id is optional: left out, the portfolio’s active scenario is used, and a portfolio with none set is refused. To ask about a change before you place it elsewhere, use Check a change.
5

Handle a refusal

Send /compliance/check a price map that leaves out two held symbols. The call uses the portfolio’s active scenario.
The call fails with 400. Every refusal a route produces uses this envelope.
Build your code around these rules:
  • Treat any non-2xx response as no result. It isn’t a pass and it isn’t a finding.
  • Branch on error_code, and show error to a person. Four answers carry no error_code, so branch on their status: 401, the 403 for an account with no agent access, the 403 for a key without read permission, and the 429 for the request budget.
  • Change the request before you retry a 400, 403, 404 or 409. The same request usually fails the same way.
  • Wait for Retry-After, then retry a request-budget 429. A 429 with error_code: DAILY_LIMIT_EXCEEDED has no Retry-After; don’t retry it on a timer.
  • Retry a 500 once only for a read, or for a write that is safe to repeat (see Idempotency). Quote its request_id when you contact support.
Every response that reaches a route carries X-RateLimit-Limit (60) and X-RateLimit-Remaining, the requests left in the rolling 60-second window. See API errors and Rate limits.

Next steps

  • Check a change: which of your rules a change puts outside range.
  • Update with an agent: set a holding to the share count you hold now. Writes need a key with Read and change access.
  • Idempotency: make a retried cash movement safe.
  • Endpoints by task: every task with its route and its MCP tool. Open Endpoints in the API reference sidebar for every operation with request and response examples.
  • Connect an agent: the same reads and checks as tools for an agent.