API overview
Base URL: https://capitalpress.io/api
Everything is JSON over HTTPS. There are no API keys.
Conventions
- Reads are
GET. Everything that changes something isPOSTwith a JSON body. - Paid endpoints never use URL parameters. The press id goes in the JSON body, and the same body is sent again with the payment.
- Errors are
{ "error": "A sentence you can show to a person." }with a fitting status code. - Amounts.
priceUsdgis a decimal for display.priceUnitsis the exact amount as a string, in USDG base units (six decimals). UsepriceUnitsfor anything involving money. - Addresses are returned in lowercase.
- Two ids.
idis our database id, used for drafts.pressIdis the onchain identity id, set when a press is minted, and used for payments and votes.
Who can call what
| Group | Auth |
|---|---|
| Presses and stocks | None |
| Payments | The payment signature itself |
| Votes | None to record a vote; a session to read your history |
| Publishing | A wallet session |
| Chain RPC | None |
A wallet session is a cookie set by signing in.
Cross-origin requests
Public and paid endpoints send Access-Control-Allow-Origin: * and expose the payment-required and payment-response headers. Credentials are never allowed cross-origin, so session endpoints only work from capitalpress.io.
Machine-readable guide
bash
curl https://capitalpress.io/api/agentReturns the network, token, endpoints and payment flow as one JSON document.
Health
bash
curl https://capitalpress.io/api/healthjson
{ "ok": true, "payments": true, "auditEngine": "…", "onchainAudit": false }payments is false while payments are switched off. auditEngine is "off" while publishing is closed.
