Link a User Account
Link two user accounts together forming a primary and secondary relationship. On successful linking, the endpoint returns the new array of the primary account identities.
Note: There are two ways of invoking the endpoint:
-
With the authenticated primary account’s JWT in the Authorization header, which has the
update:current_user_identitiesscope:POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities Authorization: "Bearer PRIMARY_ACCOUNT_JWT" { "link_with": "SECONDARY_ACCOUNT_JWT" }In this case, only the
link_withparam is required in the body, which also contains the JWT obtained upon the secondary account’s authentication. -
With a token generated by the API V2 containing the
update:usersscope:POST /api/v2/users/PRIMARY_ACCOUNT_USER_ID/identities Authorization: "Bearer YOUR_API_V2_TOKEN" { "provider": "SECONDARY_ACCOUNT_PROVIDER", "connection_id": "SECONDARY_ACCOUNT_CONNECTION_ID(OPTIONAL)", "user_id": "SECONDARY_ACCOUNT_USER_ID" }In this case you need to send
provideranduser_idin the body. Optionally you can also send theconnection_idparam which is suitable for identifying a particular database connection for the ‘auth0’ provider.
Documentation Index
Fetch the complete documentation index at: https://docs-dev.auth0-mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the primary user account to link a second user account to.
Body
Identity provider of the secondary user account being linked.
ad, adfs, amazon, apple, dropbox, bitbucket, auth0-oidc, auth0, baidu, bitly, box, custom, daccount, dwolla, email, evernote-sandbox, evernote, exact, facebook, fitbit, github, google-apps, google-oauth2, instagram, ip, line, linkedin, oauth1, oauth2, office365, oidc, okta, paypal, paypal-sandbox, pingfederate, planningcenter, salesforce-community, salesforce-sandbox, salesforce, samlp, sharepoint, shopify, shop, sms, soundcloud, thirtysevensignals, twitter, untappd, vkontakte, waad, weibo, windowslive, wordpress, yahoo, yandex connection_id of the secondary user account being linked when more than one auth0 database provider exists.
^con_[A-Za-z0-9]{16}$user_id of the secondary user account being linked.
1JWT for the secondary account being linked. If sending this parameter, provider, user_id, and connection_id must not be sent.
Response
Identity successfully added.
Connection name of this identity.
user_id of this identity.
1Type of identity provider.
Whether the identity provider is a social provider (true) or not (false).
IDP access token returned if scope read:user_idp_tokens is defined.
IDP access token secret returned only if scope read:user_idp_tokens is defined.
IDP refresh token returned only if scope read:user_idp_tokens is defined.