Link Identity
POST
/api/auth/link-identity
const url = 'https://example.com/api/auth/link-identity';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"provider":"example","code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/auth/link-identity \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "provider": "example", "code": "example" }'Link an additional provider identity to the current user.
For the ‘email’ provider, supply the magic link code returned by verify. For future providers (Google, etc.), supply the appropriate credentials.
Body: provider: The provider to link (“email”, “slack”, “google”) code: Magic link code (for “email” provider)
Returns: {“linked”: true, “provider”: ”…”, “provider_user_id”: ”…”}
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Successful Response
Media type application/json
LinkIdentityResponse
Response from POST /auth/link-identity.
object
linked
required
Linked
boolean
provider
required
Provider
string
provider_user_id
required
Provider User Id
string
Example generated
{ "linked": true, "provider": "example", "provider_user_id": "example"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}