Skip to main content
The Partners API uses OAuth 2.0 client credentials. There is no end-user login and no refresh token.

Obtain a token

POST /oauth/token accepts HTTP Basic (recommended) or client_id / client_secret in the form body. The only supported grant_type is client_credentials. The response is always JSON.
On success:
On a bad client id or secret, the token endpoint returns the standard OAuth error invalid_client, not the /v1 error envelope.

Use the token

Send it on every /v1 request:
The access token is an RS256 JWT, issued for this API (aud is inra-partners-api), and is valid for 15 minutes. Request a new one when it is close to expiry. Reusing an expired token returns 401 with the code unauthorized.

Verify a token (optional)

The signing keys are at GET /.well-known/jwks.json. The JWT header includes a kid:
  • Sandbox: sandbox-1
  • Production: prod-1
You do not have to verify the token in order to call the API — the server verifies it on every request — but a backend of your own that receives a token can check the signature, issuer, audience, and expiry.

Scopes

A token is issued with the scopes granted to your client. The current catalogue is: If your token is missing a scope, the API returns 403 with the code insufficient_scope. Email inraasth@inra.co.th if you need a scope that was not issued.

Rate limits

Limits are per client and per bucket, and can be agreed individually. The defaults for a new client are: When you exceed a limit the API returns 429 with the code rate_limited and a Retry-After header (seconds). Back off and retry.

Rotate a secret

There is no self-service rotation in v1. If a secret is lost, leaked, or due for a routine change, email inraasth@inra.co.th. We will issue a new secret and retire the old one. We will never ask you to paste an existing secret back to us, and these docs will never display one. Callback signing secrets are also issued by INRA when a callback URL is registered. See Callbacks.