Skip to main content
The API key belongs to a tenant and manages that tenant’s apps, upstreams, and users. The bootstrap token belongs to the server and covers the few actions that no tenant owns. An endpoint accepts only its own kind of credential.

Use an API key

Send the key after the word Bearer and a space.
A missing or unknown API key gets 401 with WWW-Authenticate: Bearer. When pgw can’t check the key, for example because the database doesn’t answer, the request gets 500. POST /api/v1/bootstrap creates the first tenant and returns its API key in api_key. pgw stores only a SHA-256 hash of the key and can’t show it again, so keep the key in a secret store.

Use the bootstrap token

The bootstrap token is the value that PGW_BOOTSTRAP_TOKEN had when pgw started. It is at least 32 characters long. Send it after the word Bootstrap and a space.
To use these endpoints on a gateway that started without the token, set PGW_BOOTSTRAP_TOKEN and restart pgw.

Next steps

Handle errors

Look up what each status code means, and read the error body.

Security

Keep the API key, the bootstrap token, and the admin listener safe.