Skip to main content

Authentication

TPX uses API key authentication for all GraphQL API requests.

API Key Format

EnvironmentPrefixExample
Productiontp_live_tp_live_1234567890abcdef...
Sandboxtp_sandbox_Coming Soon

Making Requests

Include your API key in the X-API-Key header:

Request
curl -X POST https://platform-api.tradepost.co/graphql \
-H "Content-Type: application/json" \
-H "X-API-Key: tp_live_your_api_key_here" \
-d '{ "query": "mutation { ... }" }'

Getting Your API Key

Generate API keys directly from Terminal under Settings → API Keys.

Security
  • Store keys in environment variables, never in code
  • Never commit keys to version control
  • Use HTTPS for all requests
  • Rotate keys periodically

Error Responses

StatusDescription
401 UnauthorizedInvalid or missing API key
403 ForbiddenAPI access not enabled for account
{
"detail": "Invalid or expired API key"
}