Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

OAuth Token Endpoint

POST/oauth/tokenOAuth Token Endpoint

OAuth 2.1 token endpoint (RFC 6749 §4.1.3, §6). Exchanges an authorization code with PKCE or a refresh token for an access/refresh token pair

Request body

application/x-www-form-urlencoded
object
client_idstring
codestring
code_verifierstring
grant_typestring
redirect_uristring
refresh_tokenstring
Example request
{
  "client_id": "string",
  "code": "string",
  "code_verifier": "string",
  "grant_type": "string",
  "redirect_uri": "string",
  "refresh_token": ""
}

Responses

200Token responseapplication/json
objectTokenResponse
access_tokenstring
expires_ininteger · int64
refresh_tokenstring
token_typestring
workspace_idstring
workspace_namestring
Example response
{
  "access_token": "",
  "expires_in": 0,
  "refresh_token": "",
  "token_type": "string",
  "workspace_id": "string",
  "workspace_name": "string"
}
400OAuth error (RFC 6749 §5.2)application/json
objectOAuthError
errorstring
error_descriptionstring
Example response
{
  "error": "string",
  "error_description": "string"
}
Documentation menu