Skip to main content
POST
/
users
/
{id}
/
identities
TypeScript
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.users.identities.link("id", {});
}
main();
[
  {
    "connection": "twitter",
    "user_id": "abc",
    "provider": "twitter",
    "profileData": {
      "email": "<string>",
      "email_verified": true,
      "name": "<string>",
      "username": "johndoe",
      "given_name": "<string>",
      "phone_number": "<string>",
      "phone_verified": true,
      "family_name": "<string>"
    },
    "isSocial": true,
    "access_token": "<string>",
    "access_token_secret": "<string>",
    "refresh_token": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID of the primary user account to link a second user account to.

Body

provider
enum<string>

Identity provider of the secondary user account being linked.

Available options:
ad,
adfs,
amazon,
apple,
dropbox,
bitbucket,
aol,
auth0-oidc,
auth0,
baidu,
bitly,
box,
custom,
daccount,
dwolla,
email,
evernote-sandbox,
evernote,
exact,
facebook,
fitbit,
flickr,
github,
google-apps,
google-oauth2,
instagram,
ip,
line,
linkedin,
miicard,
oauth1,
oauth2,
office365,
oidc,
okta,
paypal,
paypal-sandbox,
pingfederate,
planningcenter,
renren,
salesforce-community,
salesforce-sandbox,
salesforce,
samlp,
sharepoint,
shopify,
shop,
sms,
soundcloud,
thecity-sandbox,
thecity,
thirtysevensignals,
twitter,
untappd,
vkontakte,
waad,
weibo,
windowslive,
wordpress,
yahoo,
yammer,
yandex
connection_id
string

connection_id of the secondary user account being linked when more than one auth0 database provider exists.

Pattern: ^con_[A-Za-z0-9]{16}$
user_id
default:abc

user_id of the secondary user account being linked.

Minimum string length: 1

JWT 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
string
default:twitter
required

Connection name of this identity.

user_id
default:abc
required

user_id of this identity.

Minimum string length: 1
provider
string
default:twitter
required

Type of identity provider.

profileData
object
isSocial
boolean

Whether the identity provider is a social provider (true) or not (false).

access_token
string

IDP access token returned if scope read:user_idp_tokens is defined.

access_token_secret
string

IDP access token secret returned only if scope read:user_idp_tokens is defined.

refresh_token
string

IDP refresh token returned only if scope read:user_idp_tokens is defined.