Links API

On this page
Available since 1.28.0

This page contains the APIs that are used to manage Links that establish a relationship between a FusionAuth User and an Identity Provider.

This API is used to create a link between a FusionAuth User and a user in a 3rd party identity provider. This API may be useful when you already know the unique Id of a user in a 3rd party identity provider and the corresponding FusionAuth User.

Request#

Available since 1.43.0
API Key Authentication
Link a User
POST/api/identity-provider/link
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Request Body#

identityProviderLink.displayName
  • Type: String
  • Optional

An optional human readable name for this link such as an email address, username or given name. This value should be used to make it easier to identify the user this link represents in the remote identity provider.

Please note, that this value will always be overwritten during login to reflect the most current information from the identity provider. In most cases this value will be an email address or username.

identityProviderLink.identityProviderId
  • Type: UUID
  • Required

The Id of the identity provider that will be linked to the User.

identityProviderLink.identityProviderUserId
  • Type: String
  • Required

The Id for the user that is provided by the upstream identity provider. This is the value that will allow FusionAuth to link this User on future logins. This value is expected to be immutable.

identityProviderLink.userId
  • Type: UUID
  • Required

The unique Id of the FusionAuth User that is being linked to the identity provider.

identityProviderLink.token
  • Type: String
  • Optional

The token returned from the identity provider. This is treated as an opaque tokenA token whose value has no meaning to the client, such as a random string. Only the server that issued an opaque token can interpret the token. as the type varies by identity provider, this value may not be returned by all identity providers. When provided, this token is typically a long lived access or refresh token, but consult individual identity provider documentation for specifics.

Example Request JSON
{
  "identityProviderLink": {
    "displayName": "richard@piedpiper.com",
    "identityProviderId": "f50dbb83-4cc2-4e5e-aece-9efe068bddd9",
    "identityProviderUserId": "42",
    "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
}
Note

Deprecated in version 1.43.0

While this API is still functional, its usage is discouraged. When available please use the Link a User endpoint which takes a different request body.

API Key Authentication
Link a User
POST/api/identity-provider/link
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Request Body#

displayName
  • Type: String
  • Optional
  • Available since 1.28.1

An optional human readable name for this link such as an email address, username or given name. This value should be used to make it easier to identify the user this link represents in the remote identity provider.

Please note, that this value will always be overwritten during login to reflect the most current information from the identity provider. In most cases this value will be an email address or username.

identityProviderId
  • Type: UUID
  • Required

The Id of the identity provider.

identityProviderUserId
  • Type: String
  • Required

The Id for the User that is provided by the identity provider. This is the value that will allow FusionAuth to link this user on future logins. This value is expected to be immutable.

userId
  • Type: UUID
  • Required

The FusionAuth Id of the User that is being linked to the identity provider.

Example Request JSON
{
  "displayName": "richard@piedpiper.com",
  "identityProviderId": "f50dbb83-4cc2-4e5e-aece-9efe068bddd9",
  "identityProviderUserId": "42",
  "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
}

Response#

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
409FusionAuth found a conflict while processing the request.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.
504One or more webhook endpoints returned an invalid response or didn't respond. Because of the transaction configuration for the event, FusionAuth can't complete the request. FusionAuth logs a stack trace in the FusionAuth log files.

Response Body#

identityProviderLink.displayName
  • Type: String

An optional human-readable name for this Link, such as an email address, username, or given name. Use this value to identify the User that this Link represents in the remote Identity Provider.

FusionAuth always overwrites this value during login to reflect the most current information from the IdP. In most cases, this value is an email address or username.

identityProviderLink.identityProviderId
  • Type: UUID

The unique Id of the Identity Provider.

identityProviderLink.identityProviderName
  • Type: String
  • Available since 1.47.0

The name of the Identity Provider.

identityProviderLink.identityProviderType
  • Type: String

The type of the Identity Provider.

identityProviderLink.identityProviderUserId
  • Type: String

The User Id that the Identity Provider provides.

identityProviderLink.insertInstant
  • Type: Long

The instant when FusionAuth created the Link.

identityProviderLink.lastLoginInstant
  • Type: Long

The instant when the User last logged in with this Identity Provider using this Link.

identityProviderLink.tenantId
  • Type: UUID

The Id of the Tenant that the User belongs to.

identityProviderLink.token
  • Type: String

The token that the Identity Provider returns. FusionAuth treats the token as opaque, because the token type varies by IdP. Some IdPs don't return this value. When present, the token is typically a long-lived access or refresh token. For specifics, consult the documentation for the individual IdP.

identityProviderLink.userId
  • Type: UUID

The unique Id of the FusionAuth User that is linked to the Identity Provider.

Example Response JSON
{
  "identityProviderLink": {
    "displayName": "richard@piedpiper.com",
    "identityProviderId": "f50dbb83-4cc2-4e5e-aece-9efe068bddd9",
    "identityProviderName": "My OpenIDConnect Identity Provider",
    "identityProviderType": "OpenIDConnect",
    "identityProviderUserId": "42",
    "insertInstant": 1623183147998,
    "lastLoginInstant": 1623183152224,
    "tenantId": "30663132-6464-6665-3032-326466613934",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
    "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
  }
}

This API is used to complete a pending link. If an identity provider is configured with a linking strategy of Create a pending link, a pendingLinkId will be returned by the Identity Provider API (see the Complete the Login section for each respective IdP). This value can be used in the request below.

Request#

Available since 1.43.0
API Key Authentication
Complete a pending Link
POST/api/identity-provider/link
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Request Body#

pendingIdPLinkId
  • Type: String
  • Required

The pending identity provider link Id.

identityProviderLink.userId
  • Type: String
  • Required

The unique Id of the FusionAuth User that is being linked to the identity provider.

Example Request JSON
{
  "pendingIdPLinkId": "elY3lKxvCQvsH_kfEMmBNLIl6TmydtCrNjHpFgVdxb8",
  "identityProviderLink": {
    "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
  }
}
Note

Deprecated in version 1.43.0.

While this API is still functional, its usage is discouraged. When available please use the Complete a Pending Link which takes a different request body.

API Key Authentication
Complete a pending Link
POST/api/identity-provider/link
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Request Body#

pendingIdPLinkId
  • Type: String
  • Required

The pending identity provider link Id.

userId
  • Type: String
  • Required

The Id of the User that is being linked to the identity provider.

Example Request JSON
{
  "pendingIdPLinkId": "elY3lKxvCQvsH_kfEMmBNLIl6TmydtCrNjHpFgVdxb8",
  "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
}

Response#

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
409FusionAuth found a conflict while processing the request.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.
504One or more webhook endpoints returned an invalid response or didn't respond. Because of the transaction configuration for the event, FusionAuth can't complete the request. FusionAuth logs a stack trace in the FusionAuth log files.

Response Body#

identityProviderLink.displayName
  • Type: String

An optional human-readable name for this Link, such as an email address, username, or given name. Use this value to identify the User that this Link represents in the remote Identity Provider.

FusionAuth always overwrites this value during login to reflect the most current information from the IdP. In most cases, this value is an email address or username.

identityProviderLink.identityProviderId
  • Type: UUID

The unique Id of the Identity Provider.

identityProviderLink.identityProviderName
  • Type: String
  • Available since 1.47.0

The name of the Identity Provider.

identityProviderLink.identityProviderType
  • Type: String

The type of the Identity Provider.

identityProviderLink.identityProviderUserId
  • Type: String

The User Id that the Identity Provider provides.

identityProviderLink.insertInstant
  • Type: Long

The instant when FusionAuth created the Link.

identityProviderLink.lastLoginInstant
  • Type: Long

The instant when the User last logged in with this Identity Provider using this Link.

identityProviderLink.tenantId
  • Type: UUID

The Id of the Tenant that the User belongs to.

identityProviderLink.token
  • Type: String

The token that the Identity Provider returns. FusionAuth treats the token as opaque, because the token type varies by IdP. Some IdPs don't return this value. When present, the token is typically a long-lived access or refresh token. For specifics, consult the documentation for the individual IdP.

identityProviderLink.userId
  • Type: UUID

The unique Id of the FusionAuth User that is linked to the Identity Provider.

Example Response JSON
{
  "identityProviderLink": {
    "displayName": "richard@piedpiper.com",
    "identityProviderId": "f50dbb83-4cc2-4e5e-aece-9efe068bddd9",
    "identityProviderName": "My OpenIDConnect Identity Provider",
    "identityProviderType": "OpenIDConnect",
    "identityProviderUserId": "42",
    "insertInstant": 1623183147998,
    "lastLoginInstant": 1623183152224,
    "tenantId": "30663132-6464-6665-3032-326466613934",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
    "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
  }
}

This API is used to retrieve a single Link, all Links for a specific identity provider and user, or all Links for a user.

Request#

API Key Authentication
Retrieve a single link
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Query Parameters#

identityProviderId
  • Type: UUID
  • Required

The unique Id of the identity provider.

identityProviderUserId
  • Type: String
  • Required

The unique user Id in the 3rd party identity provider. Ideally this value never changes and will always uniquely identify the user in the 3rd party identity provider.

userId
  • Type: UUID
  • Optional

The FusionAuth User Id that is linked to the identity provider. When this value is provided, a 404 status code will be returned if the link does not exist, or the link exists but is linked to a different userId. If you wish to identify if any user is linked, omit this parameter.

API Key Authentication
Retrieve all links for a specific user by identity provider
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Query Parameters#

identityProviderId
  • Type: UUID
  • Required

The unique Id of the identity provider.

userId
  • Type: UUID
  • Required

The FusionAuth User Id that is linked to the identity provider.

API Key Authentication
Retrieve all links for a user
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Query Parameters#

userId
  • Type: UUID
  • Required

The FusionAuth User Id that is linked to the identity provider.

Response#

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.

Response Body#

The response body for this API contains either a single Link or an array of Links. When you call this API with identityProviderId, identityProviderUserId, and optionally userId, the response contains a single Link. When you call this API with userId and optionally identityProviderId, the response contains an array of Links. The following sections list the fields and an example response for each response type.

identityProviderLink.displayName
  • Type: String

An optional human-readable name for this Link, such as an email address, username, or given name. Use this value to identify the User that this Link represents in the remote Identity Provider.

FusionAuth always overwrites this value during login to reflect the most current information from the IdP. In most cases, this value is an email address or username.

identityProviderLink.identityProviderId
  • Type: UUID

The unique Id of the Identity Provider.

identityProviderLink.identityProviderName
  • Type: String
  • Available since 1.47.0

The name of the Identity Provider.

identityProviderLink.identityProviderType
  • Type: String
  • Available since 1.46.0

The type of the Identity Provider.

identityProviderLink.identityProviderUserId
  • Type: String

The unique User Id in the third-party Identity Provider. Ideally, this value never changes and always uniquely identifies the User in the third-party IdP.

identityProviderLink.insertInstant
  • Type: Long

The instant when FusionAuth created the Link.

identityProviderLink.lastLoginInstant
  • Type: Long

The instant when the User last logged in with this Identity Provider using this Link.

identityProviderLink.tenantId
  • Type: UUID

The Id of the Tenant that the User belongs to.

identityProviderLink.token
  • Type: String

The token that the Identity Provider returns. FusionAuth treats the token as opaque, because the token type varies by IdP. Some IdPs don't return this value. When present, the token is typically a long-lived access or refresh token. For specifics, consult the documentation for the individual IdP.

In versions before 1.28.0, you can retrieve this value from the registration.token field of the User Registration APIs.

identityProviderLink.userId
  • Type: UUID

The FusionAuth User Id that is linked to the Identity Provider.

Example Response JSON
{
  "identityProviderLink": {
    "displayName": "richard@piedpiper.com",
    "identityProviderId": "f50dbb83-4cc2-4e5e-aece-9efe068bddd9",
    "identityProviderName": "My OpenIDConnect Identity Provider",
    "identityProviderType": "OpenIDConnect",
    "identityProviderUserId": "42",
    "insertInstant": 1623183147998,
    "lastLoginInstant": 1623183152224,
    "tenantId": "30663132-6464-6665-3032-326466613934",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
    "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
  }
}

Response Body#

identityProviderLinks
  • Type: Array

The list of Link objects.

identityProviderLinks[x].displayName
  • Type: String

An optional human-readable name for this Link, such as an email address, username, or given name. Use this value to identify the User that this Link represents in the remote Identity Provider.

FusionAuth always overwrites this value during login to reflect the most current information from the IdP. In most cases, this value is an email address or username.

identityProviderLinks[x].identityProviderId
  • Type: UUID

The unique Id of the Identity Provider.

identityProviderLinks[x].identityProviderName
  • Type: String
  • Available since 1.47.0

The name of the Identity Provider.

identityProviderLinks[x].identityProviderType
  • Type: String
  • Available since 1.46.0

The type of the Identity Provider.

identityProviderLinks[x].identityProviderUserId
  • Type: String

The unique User Id in the third-party Identity Provider. Ideally, this value never changes and always uniquely identifies the User in the third-party IdP.

identityProviderLinks[x].insertInstant
  • Type: Long

The instant when FusionAuth created the Link.

identityProviderLinks[x].lastLoginInstant
  • Type: Long

The instant when the User last logged in with this Identity Provider using this Link.

identityProviderLinks[x].tenantId
  • Type: UUID

The Id of the Tenant that the User belongs to.

identityProviderLinks[x].token
  • Type: String

The token that the Identity Provider returns. FusionAuth treats the token as opaque, because the token type varies by IdP. Some IdPs don't return this value. When present, the token is typically a long-lived access or refresh token. For specifics, consult the documentation for the individual IdP.

In versions before 1.28.0, you can retrieve this value from the registration.token field of the User Registration APIs.

identityProviderLinks[x].userId
  • Type: UUID

The FusionAuth User Id that is linked to the Identity Provider.

Example Response JSON for a collection of Links
{
  "identityProviderLinks": [
    {
      "displayName": "richard@piedpiper.com",
      "identityProviderId": "f50dbb83-4cc2-4e5e-aece-9efe068bddd9",
      "identityProviderName": "My OpenIDConnect Identity Provider",
      "identityProviderType": "OpenIDConnect",
      "identityProviderUserId": "42",
      "insertInstant": 1623183147998,
      "lastLoginInstant": 1623183152224,
      "tenantId": "30663132-6464-6665-3032-326466613934",
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MiIsIm5hbWUiOiJSaWNoYXJkIiwiaWF0IjoxNTE2MjM5MDIyfQ.hFtOTx0nZ58YNJlYLI9kV2Tt0Jg1yxdW7Gy-43V4clc",
      "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
    },
    {
      "displayName": "richard@hooli.com",
      "identityProviderId": "363ae8d9-dd4d-4473-bdc6-3694f1d0329e",
      "identityProviderName": "Another OpenIDConnect Identity Provider",
      "identityProviderType": "OpenIDConnect",
      "identityProviderUserId": "9821123",
      "insertInstant": 1623183147998,
      "lastLoginInstant": 1623183152225,
      "tenantId": "30663132-6464-6665-3032-326466613934",
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI5ODIxMTIzIiwibmFtZSI6IlJpY2hhcmQiLCJpYXQiOjE1MTYyMzkwMjJ9.bGRRUQBhdg6kS4sjiWrR-7xrOa6A2MzI9QhWlDcNf-Y",
      "userId": "fbf0e652-b2b5-45eb-b9c9-d4640889740b"
    }
  ]
}
Available since 1.46.0

This API is used to retrieve a pending IdP Link. A pending IdP Link is created after a user completes login with an Identity Provider configured with a linking strategy of Create a Pending Link. This pending IdP link is then used to link a user in a 3rd party identity provider to a user in FusionAuth.

Retrieving this link may be useful if you are building your own login pages, and need to identify the Identity Provider or various meta-data associated with this pending link.

Request#

API Key Authentication
Retrieve a single pending link by Id
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Path Parameters#

pendingLinkId
  • Type: String
  • Required

The unique pending IdP Link Id.

Query Parameters#

userId
  • Type: UUID
  • Optional

The optional User Id that you intend to link using this pending IdP Link. When provided the user's current link count will be returned in the response body.

This can be useful if you are limiting the number of links a user may have to a single identity provider. This will help you understand if the link will succeed for this user.

Response#

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.

Response Body#

identityProviderTenantConfiguration.limitUserLinkCount.enabled
  • Type: Boolean

The Tenant configuration for Identity Provider linking. When true, FusionAuth enforces the maximumLinks value during linking. The response includes this field only when you configure a Tenant policy for this IdP.

identityProviderTenantConfiguration.limitUserLinkCount.maximumLinks
  • Type: Integer

The maximum number of Links a User can have to a single Identity Provider. The response includes this field only when you configure a Tenant policy for this IdP.

linkCount
  • Type: Integer

The number of Links the User has to this Identity Provider. The response includes this field only when the request includes a userId.

pendingIdPLink.displayName
  • Type: String

An optional human-readable name for this Link, such as an email address, username, or given name. Use this value to identify the User that this Link represents in the remote Identity Provider.

pendingIdPLink.email
  • Type: String

The optional email address from the Identity Provider. Whether this value is present depends on the IdP.

pendingIdPLink.identityProviderId
  • Type: UUID

The unique Id of the Identity Provider.

pendingIdPLink.identityProviderName
  • Type: String

The name of the Identity Provider.

pendingIdPLink.identityProviderType
  • Type: String

The type of the Identity Provider.

pendingIdPLink.identityProviderUserId
  • Type: String

The unique User Id in the third-party Identity Provider. Ideally, this value never changes and always uniquely identifies the User in the third-party IdP.

pendingIdPLink.username
  • Type: String

The optional username from the Identity Provider. Whether this value is present depends on the IdP.

Example Response JSON
{
  "identityProviderTenantConfiguration": {
    "limitUserLinkCount": {
      "enabled": false,
      "maximumLinks": 2
    }
  },
  "linkCount": 0,
  "pendingIdPLink": {
    "displayName": "richard@piedpiper.com",
    "email": "richard@piedpiper.com",
    "identityProviderId": "af53ab21-34c3-468a-8ba2-ecb3905f67f2",
    "identityProviderName": "Xbox",
    "identityProviderType": "Xbox",
    "identityProviderUserId": "42",
    "username": "richard"
  }
}

This API is used to remove a link between a FusionAuth User and a 3rd party identity provider.

Request#

API Key Authentication
Delete the Link with the given Id
OpenAPI Spec

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Query Parameters#

identityProviderId
  • Type: UUID
  • Required

The unique Id of the identity provider.

identityProviderUserId
  • Type: String
  • Required

The Id for the user that is provided by the upstream identity provider. This is the value that will allow FusionAuth to link this user on future logins. This value is expected to be immutable.

userId
  • Type: UUID
  • Required

The FusionAuth User Id that is linked to the identity provider.

Response#

This API does not return a JSON response body.

Response Codes
CodeDescription
200The request succeeded.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.