Skip to main content

Generate Auth URL

Create login intent and get authentication URL.

Endpoint

POST /api/oauth/generate-auth-url?clientId={clientId}

Headers

X-API-Key: your-api-key
Content-Type: application/json

Parameters

Query:

  • clientId (string, required) - Your application's client ID

Body:

{
"redirectUri": "https://your-app.com/callback",
"state": "random-state-string"
}
FieldTypeRequiredDescription
redirectUristringYesRegistered redirect URI
statestringYesCSRF protection (1-500 chars)

Response

{
"status": true,
"message": "Auth URL generated successfully",
"data": {
"authUrl": "https://dev.reeng.xyz/?intent=550e8400-e29b-41d4-a716-446655440000",
"loginIntentId": "550e8400-e29b-41d4-a716-446655440000"
}
}

Errors

StatusMessage
400Validation failed / Client ID mismatch / Invalid redirect URI
401Invalid API key

Example

curl -X POST "https://api.reeng.xyz/api/oauth/generate-auth-url?clientId=your-client-id" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"redirectUri": "https://your-app.com/callback",
"state": "random-state-123"
}'

Notes

  • Login intent expires in 30 minutes
  • clientId must match API key's application
  • redirectUri must be registered
  • Use random state for CSRF protection