Skip to main content
POST
Use this endpoint from your backend to:
  • Exchange an authorization code using grant_type=authorization_code.
  • Refresh a token set using grant_type=refresh_token.
Authorization codes are short-lived and can be used only once. If the authorization request used PKCE, send the original code_verifier during the code exchange. A verifier is not used for the refresh-token grant. Refresh tokens are rotated on every refresh. Each successful refresh_token grant returns a new refresh_token and invalidates the one you sent, so always store the latest refresh token from the response and use it for the next refresh. Reusing an old refresh token returns an invalid_grant error.

Body

application/x-www-form-urlencoded
grant_type
enum<string>
required
Available options:
authorization_code
code
string
required

Short-lived, single-use code returned by /oauth2/authorize.

redirect_uri
string<uri>
required

Must exactly match the URI used in the authorization request.

client_id
string
required

Client identifier issued by Eka.

client_secret
string<password>
required

Client secret issued by Eka.

code_verifier
string

Original PKCE verifier. Required when the authorization request used PKCE.

Required string length: 43 - 128

Response

Token response.

access_token
string
required

Bearer token used to authorize Eka API requests.

token_type
string
required
Example:

"bearer"

expires_in
integer<int64>
required

Access-token lifetime in seconds.

scope
string

Space-separated scopes granted to the token.

refresh_token
string

Token used to obtain a new token set. A new refresh token is issued on every refresh and the previous one is invalidated, so replace the stored value with this one after each call.

id_token
string

OpenID Connect ID token returned when openid was granted.