Skip to content

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 is POST with 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. priceUsdg is a decimal for display. priceUnits is the exact amount as a string, in USDG base units (six decimals). Use priceUnits for anything involving money.
  • Addresses are returned in lowercase.
  • Two ids. id is our database id, used for drafts. pressId is the onchain identity id, set when a press is minted, and used for payments and votes.

Who can call what

GroupAuth
Presses and stocksNone
PaymentsThe payment signature itself
VotesNone to record a vote; a session to read your history
PublishingA wallet session
Chain RPCNone

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/agent

Returns the network, token, endpoints and payment flow as one JSON document.

Health

bash
curl https://capitalpress.io/api/health
json
{ "ok": true, "payments": true, "auditEngine": "…", "onchainAudit": false }

payments is false while payments are switched off. auditEngine is "off" while publishing is closed.

Nothing published on Capital Press is investment advice.