Turnqey

API Playground

ByAllAccounts · Morningstar
← Back to docs

Generate authentication token

POST/v1/api/tokenNo auth

Exchanges your client credentials for a JWT bearer token. The lifetime is returned in expiresIn (seconds) and expiresOn; it is not fixed, so refresh from those values. Use the token in the Authorization header as "Bearer {token}".

View full reference for this endpoint →

Request body

clientIdstringrequired

Your Turnqey client ID.

clientSecretstringrequired

Your Turnqey client secret.

Response

result.tokenstring

JWT bearer token.

result.expiresInnumber

Seconds until the token expires.

result.expiresOnstring (date-time)

Absolute expiry timestamp.

Error responses

400Bad RequestMalformed request or missing/invalid parameter (for example a token body without clientId/clientSecret, or a checksum request without platform).
401UnauthorizedToken missing, expired, or invalid - request a new token.
404Not FoundNo active connection exists for the supplied accountId (balances and transactions only). Unknown collections and identities return 200 with an empty result.
409ConflictReserved: the account must be re-authorized before data can be served. Not enabled in production today; look at dataFreshness.status instead.
429Too Many RequestsRate limited per source IP - honour Retry-After and the X-RateLimit-* headers, then retry with jitter.
500Server ErrorUpstream or server failure - retry with backoff, then fail gracefully.

All errors share a standard envelope:

{
  "isError": true,
  "responseException": {
    "exceptionMessage": "Request denied. Unauthorized access."
  },
  "statusCode": 401
}