Skip to content

/oauth2/authorize (POST)

POST
/oauth2/authorize
curl --request POST \
--url 'https://gymgym.club/api/auth/oauth2/authorize?client_id=example' \
--header 'Authorization: Bearer <token>'

Authorize an OAuth 2.1 request from query parameters or an application/x-www-form-urlencoded POST body

response_type
string

OAuth 2.1 response type (e.g., ‘code’)

client_id
required
string

OAuth 2.1 client ID

redirect_uri
string format: uri

OAuth 2.1 redirect URI

scope
string

OAuth 2.1 scopes (space-separated)

state
string

OAuth 2.1 state parameter

request_uri
string

Pushed Authorization Request URI referencing stored parameters

code_challenge
string

PKCE code challenge

code_challenge_method
string

PKCE code challenge method

nonce
string

OpenID Connect nonce

max_age
integer

Maximum authentication age in seconds; forces re-authentication when exceeded

resource
Array<string>

Requested protected resource(s) for the access token. May be supplied multiple times as repeated ‘resource’ query parameters (RFC 8707) or as an array of strings.

prompt
string

OAuth2 prompt parameter

Redirect to client with code or error

Location
string format: uri

Redirect URI with code or error

Invalid request

Media typeapplication/json
object
error
required
string
error_description
string
state
string
Examplegenerated
{
"error": "example",
"error_description": "example",
"state": "example"
}

Unauthorized. Due to missing or invalid authentication.

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Forbidden. You do not have permission to access this resource or to perform this action.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Not Found. The requested resource was not found.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Too Many Requests. You have exceeded the rate limit. Try again later.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}

Internal Server Error. This is a problem with the server that you cannot fix.

Media typeapplication/json
object
message
string
Examplegenerated
{
"message": "example"
}