For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/auth/exchange-api-key-token.md.
Exchange API key for tokens
Verify an ECDSA P-256 signature and issue JWT tokens. The client signs
the message {key_id}.{unix_timestamp} with their private key using ES256.
The timestamp must be within ±30 seconds of the server time.
A personal key returns an access token and a refresh token. An organization key
returns an access token only, with no refresh_token field: mint a new token from
the key before expires_in.
Rate limit: counts against the Sign-in verification limit, 30 a minute (per ip address, for every caller). See Rate limits.
application/json- body
key_id*stringThe API key ID
uuidtimestamp*integerCurrent Unix timestamp (must be within ±30s of server time)
int64signature*stringBase64url-encoded ECDSA P-256 signature of {key_id}.{timestamp}
Tokens issued successfully. A user key yields an access and refresh token; an organization key yields an access token only.
application/json- response
access_token*stringJWT access token
refresh_token*stringJWT refresh token
expires_in*stringAccess token expiration timestamp
date-timetoken_type*stringToken type (always "Bearer")
device_token?stringMarks this client as signed in to the inbox by email; send it back as X-Device-Token. Present only on an email sign-in.
turnkey_session?A Turnkey session on the public key a provider sign-in sent. Absent when none was asked for or none could be issued.
curl -X POST 'https://api.truemarkets.co/v1/auth/api-key/token' \ -H 'Content-Type: application/json' \ -d '{ "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", "timestamp": 0, "signature": "string"}'{ "access_token": "string", "refresh_token": "string", "expires_in": "2019-08-24T14:15:22Z", "token_type": "Bearer", "device_token": "string", "turnkey_session": { "expires_at": 0 }}Refresh access token POST
Exchange a valid refresh token for a new access/refresh token pair
Start an authorization request GET
The authorization endpoint (RFC 6749 4.1.1). A valid request is redirected to the consent screen with its parameters intact; the signed-in user's decision comes back through /oauth/consent.