Skip to main content
POST
/
:projectId
/
api
/
v7
/
oauth
/
link
Link OAuth Provider
curl --request POST \
  --url https://api.replyke.com/api/v6/:projectId/api/v7/oauth/link \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "<string>",
  "redirectAfterAuth": "<string>"
}
'
{
  "authorizationUrl": "<string>"
}
Initiates an OAuth 2.0 flow to link an additional provider to the currently authenticated user’s account. Requires a valid access token. The flow and callback behavior are identical to the Authorize OAuth endpoint. The authenticated user’s ID is taken from the access token — it cannot be specified in the request body.

Headers

Authorization
string
required
Bearer {accessToken} — a valid access token for the user linking the provider.

Body Parameters

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

Response

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

Callback

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

Error Responses

{
  "error": "OAuth provider 'github' 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