Documentation Index
Fetch the complete documentation index at: https://docs.pcxpay.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
PCX supports two credential types — API keys for server-to-server integrations and JWTs for user-facing flows. Both use the same underlying mechanism: PCX’s API Gateway runs a custom Lambda Authorizer that inspects two headers on every request. Both headers must always be present. Whichever header is not being used for authentication must be sent with the literal string valueNONE. The authorizer ignores headers with the value NONE — it does not treat them as credentials.
| Header | API key flow | JWT flow |
|---|---|---|
Authorization | NONE (literal string) | Bearer <cognito_jwt> |
X-Api-Key | <your_api_key> | NONE (literal string) |
API key authentication (server-to-server)
Use this for backend integrations and automated workflows. Send your API key inX-Api-Key and set Authorization to the literal string NONE.
JWT authentication (user-facing flows)
Use this when an end user has authenticated through Cognito. Send the JWT as a Bearer token inAuthorization and set X-Api-Key to the literal string NONE.
Why both headers?
PCX’s API Gateway uses a custom Lambda Authorizer of typeREQUEST. Unlike a Cognito authorizer — which only inspects the Authorization header — a REQUEST authorizer receives the full set of request headers and decides which credential to validate based on what it finds.
Sending only one header causes the authorizer to reject the request with 401 because it cannot determine whether the missing header was intentionally omitted or accidentally dropped. The NONE value is a deliberate signal: it tells the authorizer the header is present but unused, allowing it to route cleanly to the correct validation path.
API playground note
Mintlify’s API playground sendsX-Api-Key as the auth header. When testing JWT flows in the playground, manually add both headers — set Authorization to Bearer <your_jwt> and X-Api-Key to NONE.
Errors
| Status | Meaning |
|---|---|
401 | Missing, invalid, or incomplete headers |
403 | Valid credentials but insufficient permissions |