Skip to main content
POST
/
:projectId
/
api
/
v7
/
oauth
/
authorize
Authorize OAuth
curl --request POST \
  --url https://api.replyke.com/api/v6/:projectId/api/v7/oauth/authorize \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "<string>",
  "redirectAfterAuth": "<string>"
}
'
{
  "authorizationUrl": "<string>"
}
Initiates an OAuth 2.0 authorization flow for unauthenticated users (sign-in or sign-up). Returns a provider authorization URL that the client should redirect to. After the user authenticates with the provider, they are redirected back to the redirectAfterAuth URL with tokens in the URL fragment.
The OAuth provider must be configured and enabled in the Replyke dashboard before this endpoint can be used. The redirectAfterAuth URL must be in the provider’s allowed redirect URI list.

Body Parameters

provider
string
required
The OAuth provider to use. Must be one of: "google", "github", "apple", "facebook".
redirectAfterAuth
string
required
The URL to redirect the user to after authentication. Must be a valid URL and must be present in the provider’s configured allowed redirect URIs.

Response

authorizationUrl
string
The provider’s authorization URL. Redirect the user’s browser to this URL to begin the OAuth flow.

Callback

After the user authorizes with the provider, they are redirected to redirectAfterAuth with one of: On success — Tokens in the URL fragment:
https://yourapp.com/callback#accessToken=...&refreshToken=...
On error — Error details in query parameters:
https://yourapp.com/callback?error=access_denied&error_description=...

Error Responses

{
  "error": "OAuth provider 'google' is not configured or not enabled for this project",
  "code": "oauth/provider-not-configured"
}
{
  "error": "redirectAfterAuth is not in the allowed redirect URIs for this project",
  "code": "oauth/invalid-redirect-uri"
}

See Also