@anafi-cc/anafi-sdk calls these routes for you. It also builds the sealed payloads and checks the replies. Use the routes directly when you do not use the SDK, or when you want to know what the SDK sends. See SDK overview.
Base URLs
Each network has its own host. A host serves only its own network. A request about an account on another network gets an answer about the same address on the network of the host.
The bank payout routes (tag “Bank payouts”) are served only on
polygon-amoy. On polygon and xlayer they answer 404. All other routes are served on all three networks. See Networks.
Authentication
No API key is necessary today. No route reads a cookie or a header for authority. Some routes need a proof from the owner instead:
All read routes answer anyone, about any account. Do not put private data in a route that you read for an account.
Limits of today
For the originhttps://app.ana.fi, a CORS preflight allows the methods GET and POST and the request header Content-Type.
Requests and responses
- Send a request body as JSON, with the header
Content-Type: application/json. Without this header, the route answers415. - A success body is JSON, except
GET /api/dsl/docs, which istext/markdown; charset=utf-8. - An error body is plain text or JSON, as each route defines. See Errors.
POST /api/dsl/generateand the bank payout routes accept a body of at most 2 MB. All otherPOSTroutes accept at most 512 KiB. A larger body gets413.- An unknown path answers
404with an empty body.
Value formats
Small counts are JSON integers:
bps, floorUsdCents, dslVersion, maxSendBatchRecipients, seconds.
Field names and enum values
- Most JSON bodies use camelCase keys, for example
accountKind,txHash,amountRaw. - These bodies use snake_case keys: the sealed envelope (
kem_pk,ct), the sealed reply (nonce,ct), the staging refusal (error,sealed_error), thebuildobject ofGET /health, and all plaintext payloads inside a seal. See Sealed requests. - Enum values are lowercase snake_case strings, for example
safe_module,in_progress,every_source_consulted. One exception: the token symbols keep their letter case. - A union is an object with a tag key. The tag key is
kindfor the outcomes of provisioning, receipts and email codes. It isstatefor the off-ramp handler and policy. nulland absent are different. A field that the reference marks as nullable is always present. A field that the reference marks as optional can be absent, for examplegasChargeon an activity row andgasin the fee terms.
Retries and idempotency
A sign-in for
recover and the email code request is valid for 5 minutes after its Issued At. An Issued At more than 60 seconds in the future is refused.
Caching
OnlyGET /api/dsl/docs sets a cache header: Cache-Control: public, max-age=3600. Do not cache the other responses. Fee terms, sponsorship and activity can change at each block.
All operations
Related pages
Errors
Error bodies, status codes and SDK error classes.
Sealed requests
How to seal a request to the engine and open its reply.
Flows
The order of API calls, signatures and transactions.
SDK errors
The error classes of the SDK.