An endpoint accepts only its own kind of credential.
Use an API key
Send the key after the wordBearer and a space.
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 thatPGW_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.