coal
coal

REST API

Coal's REST API lives at https://api.usecoal.xyz. Every endpoint accepts JSON, requires either a merchant API key (x-api-key) or a Privy bearer token (Authorization: Bearer …) depending on the route, and returns either a normal JSON response or a 402 / 4xx / 5xx error envelope.

For the full surface broken out by resource, jump to the page you need:

The full OpenAPI spec is at https://api.usecoal.xyz/api/docs.

Quick orientation

  • Base URL: https://api.usecoal.xyz
  • Auth: Either an x-api-key: coal_live_… header (server-to-server, generated under /console/keys) OR a Privy bearer token (front-of-house, set by the merchant console SDK)
  • Content-Type: All POST/PUT/PATCH bodies are application/json
  • Errors: Always a { error: { code, message, requestId } } envelope
  • Rate limits: 30 requests / minute / IP on public endpoints; 60 / minute / user on console endpoints; 60 / hour / payer address on settle endpoints

Versioning

The API is unversioned — Coal commits to additive, non-breaking changes. Field additions, new endpoints, and new optional parameters land continuously. If a true breaking change ever becomes necessary, it ships behind a header opt-in with at least 30 days of overlap on the old shape.