Initiate the OAuth 2.0 authorization code flow. This endpoint is used for web applications that need to authenticate users.
Query Parameters
Your application’s client ID
The URI to redirect to after authorization (must match registered URIs)
Space-separated list of requested scopes
Random string to prevent CSRF attacks
PKCE code challenge (recommended)
PKCE challenge method (e.g. “S256”)
Response
Upon successful authorization, the user will be redirected to the redirect_uri with:
- An authorization code (
code) parameter
- The original
state parameter (if provided)
curl --request GET \
--url "https://api.example.com/oauth/authorize?client_id=your_client_id&redirect_uri=https://your-app.com/callback&response_type=code&scope=read write&state=random_state_string&code_challenge=challenge&code_challenge_method=S256" \
--header 'Accept: application/json'
{
"error": "invalid_request",
"error_description": "Client authentication failed or missing parameters"
}