Skip to content
Last updated

Authentication

The Acme Billing API authenticates every request with an API key. Send the key in the X-API-Key header:

curl https://acme-billing.redocly.app/_mock/apis/billing/invoices \
  -H "X-API-Key: YOUR_API_KEY"

A request without the header, or with a key that is not valid, gets a 401 response. See Errors.

Get an API key

  1. Sign in to the Acme Billing dashboard.
  2. Go to Settings > API keys.
  3. Select Create key, type a name for the key, and select Create.
  4. Copy the key. The dashboard shows it only once.

An API key gives full access to the data of your Acme Billing account. Keep it on your server, and do not put it in browser or mobile code. To stop a key from working, select Revoke next to it on the same page.

Sandbox

The sandbox accepts any key

The sandbox server, https://acme-billing.redocly.app/_mock/apis/billing, accepts any non-empty value in the X-API-Key header, for example X-API-Key: sandbox. The header must still be present, or the sandbox returns 401.

The sandbox returns mock data from the API reference examples. It does not change data, and it does not apply filters or pagination.