For authentication setup and code examples, see the main Authentication guide.
Common Authentication Errors
”401 Unauthorized”
Your JWT token is missing, invalid, or expired. Check:- Is the token included in the
Authorization: Bearer <token>header? - Has the token expired? Tokens are typically valid for 180 seconds (3 minutes)
- Is the token format correct? Should be
Bearer eyJ... - Was the token issued by the correct Auth0 domain for your environment?
”403 Forbidden”
Your token is valid but doesn’t have the required scope for the endpoint. Check:- Decode your token at jwt.io to see which scopes you have
- Verify the endpoint requires a scope you have (see Authentication scopes)
- Scopes must be space-separated in the
scopeclaim (e.g.,"read:orders write:orders")
”invalid_client”
JWT signature verification failed when requesting an access token from Auth0. Causes:- Private key doesn’t match the public key registered with Polymarket
- Wrong private key file being used
- Private key file corrupted or invalid format
”invalid_client_assertion”
The client assertion JWT is malformed or has incorrect claims. Common causes:- Wrong
audclaim (must behttps://pmx-{env}.us.auth0.com/oauth/token, NOT the API URL) - Expired
expclaim (expiration in the past) - Missing required claims (
iss,sub,aud,iat,exp,jti) - Reused
jti(must be unique for each request) - Wrong signing algorithm (must be RS256)
Environment-Specific Issues
Using Wrong Environment Credentials
Problem: Using development credentials in production (or vice versa). Symptoms:invalid_clienterrors401 Unauthorizedon API calls- Token works in one environment but not another
- Separate key pairs (different public/private keys)
- Separate Client IDs
- Separate Auth0 domains
- Separate API audiences
Cannot Reuse Keys Across Environments
Environments are completely isolated. You cannot:- Use the same private key in multiple environments
- Use preprod credentials in production
- Transfer Client IDs between environments
Token Expiration Issues
Token Works Sometimes But Not Others
Cause: Token is expiring mid-session. Solution: Implement proactive token refresh:Token Expired Immediately After Creation
Cause: System clock is incorrect. Check: Is your system time synchronized?JWT Claim Issues
Wrong Audience Claim
Common mistake: Using API URL as theaud claim in the client assertion.
Incorrect:
Reused JTI
Problem: Using the samejti (JWT ID) for multiple requests.
Cause: jti is meant to prevent replay attacks and must be unique per request.
Solution: Generate a new UUID for each token request:
Verifying Token Claims
Decode your access token to check what scopes and claims you have:Authorization vs Authentication
Authentication proves who you are (which firm). Authorization determines what you can do (which accounts, which scopes). You may be authenticated but not authorized to:- Access specific trading accounts
- Call certain endpoints (missing scopes)
- Perform certain actions (insufficient permissions)
Missing or Incorrect x-participant-id
Errors on Trading, Positions, or Report Endpoints
Problem: Requests to account-scoped endpoints fail even though your access token is valid. Cause: Thex-participant-id header is missing or contains an incorrect value. This header is required for all account-scoped endpoints (trading, positions, reports) but is not required for market data, order book, or reference data endpoints.
Solution: Include the x-participant-id header in your requests:
Finding Your Participant ID
You are given your participant ID — there is no endpoint that discovers your first one, and you should not construct it yourself. Institutional traders (DMA) and market makers: Your participant ID is provided during onboarding, when your trading and drop copy users are provisioned. If you no longer have it, ask your Polymarket contact. Brokers/Partners: Participant IDs for your end users are returned once the user’s KYC reachesACCEPT — as participantId on the kyc.approved webhook, or from GET /v1/kyc/status. Provisioning is asynchronous, so participantId may be absent on the initial POST /v1/kyc/start response even for an instant approval; prefer the webhook and poll the status endpoint as a fallback.
Once you hold one valid participant ID, GET /v1/users lists the rest of your firm’s users. It is account-scoped and requires x-participant-id itself, so it can’t be your starting point.
See Accounts & Identity for more details.
Endpoints That Do NOT Require x-participant-id
These endpoints only require a valid access token with the appropriate scope:- Market data:
/v1/orderbook/*, market data streaming - Reference data:
/v1/refdata/* - Trade statistics:
/v1/report/trades/stats - Health check:
/v1/health
Cryptographic Issues
Wrong Key Format
Private keys must be in PEM format:Wrong Algorithm
You must use RS256 (RSA with SHA-256) to sign your JWT. Don’t use:- HS256 (HMAC - symmetric key)
- Other RSA variants (RS384, RS512, PS256, etc.)
Testing Authentication
Test your authentication setup: 1. Verify you can create a client assertion:Getting Help
If authentication issues persist:- Verify your credentials match your environment
- Decode and inspect your JWTs (client assertion and access token)
- Check system clock is synchronized
- Test with curl commands to isolate client code issues
- Contact support with:
- Environment (dev, preprod, prod)
- Client ID
- Error messages
- Decoded JWT claims (never share your private key!)