User Linked Objects

The User Linked Objects API provides operations to manage User Linked Objects in your org. Use link value operations to assign Users to a relationship, represented by a pair of primary and associated links. See also the Linked Objects API.

For these operations, the examples use consistent IDs so that you can follow the operations more easily:

  • manager is the primary relationship and is assigned 00u5t60iloOHN9pBi0h7
  • subordinate is the associated relationship and is assigned to IDs 00u5zex6ztMbOZhF50h7 and 00u1tsf0nQKavLDUh0g5

Assign a linked object value for primary
CORS
OAuth 2.0: okta.users.manage

Assigns the first User as the associated and the second User as the primary for the specified relationship.

If the first User is already associated with a different primary for this relationship, the previous link is removed. A Linked Object relationship can specify only one primary User for an associated User.

Request
path Parameters
userIdOrLogin
required
string

If for the self link, the ID of the User for whom you want to get the primary User ID. If for the associated relation, the User ID or login value of the User assigned the associated relationship.

This can be me to represent the current session User.

Examples:
00u5zex6ztMbOZhF50h7
00u5zex6ztMbOZhF50h7
primaryRelationshipName
required
string

Name of the primary relationship being assigned

Example: manager
primaryUserId
required
string

User ID to be assigned to the primary relationship for the associated user

Responses
204

Success

403

Forbidden

404

Not Found

429

Too Many Requests

put/api/v1/users/{userIdOrLogin}/linkedObjects/{primaryRelationshipName}/{primaryUserId}
Request samples
Response samples
application/json
{
  • "errorCode": "E0000006",
  • "errorSummary": "You do not have permission to perform the requested action",
  • "errorLink": "E0000006",
  • "errorId": "sampleNUSD_8fdkFd8fs8SDBK",
  • "errorCauses": [ ]
}

List the primary or all of the associated linked object values
CORS
OAuth 2.0: okta.users.read

Lists either the self link for the primary User or all associated Users in the relationship specified by relationshipName. If the specified User isn't associated in any relationship, an empty array is returned.

Use me instead of id to specify the current session User.

Request
path Parameters
userIdOrLogin
required
string

If for the self link, the ID of the User for whom you want to get the primary User ID. If for the associated relation, the User ID or login value of the User assigned the associated relationship.

This can be me to represent the current session User.

Examples:
00u5zex6ztMbOZhF50h7
00u5zex6ztMbOZhF50h7
relationshipName
required
string

Name of the primary or associated relationship being queried

Examples:
manager
subordinate
Responses
200

Success

403

Forbidden

404

Not Found

429

Too Many Requests

get/api/v1/users/{userIdOrLogin}/linkedObjects/{relationshipName}
Request samples
Response samples
application/json

Delete a linked object value
CORS
OAuth 2.0: okta.users.manage

Deletes any existing relationship between the associated and primary user. For the associated User, this is specified by the ID. The primary name specifies the relationship.

The operation is successful if the relationship is deleted or if the specified User isn't in the associated relationship for any instance of the specified primary and thus, no relationship is found.

Request
path Parameters
userIdOrLogin
required
string

If for the self link, the ID of the User for whom you want to get the primary User ID. If for the associated relation, the User ID or login value of the User assigned the associated relationship.

This can be me to represent the current session User.

Examples:
00u5zex6ztMbOZhF50h7
00u5zex6ztMbOZhF50h7
relationshipName
required
string

Name of the primary or associated relationship being queried

Examples:
manager
subordinate
Responses
204

No Content

403

Forbidden

404

Not Found

429

Too Many Requests

delete/api/v1/users/{userIdOrLogin}/linkedObjects/{relationshipName}
Request samples
Response samples
application/json
{
  • "errorCode": "E0000006",
  • "errorSummary": "You do not have permission to perform the requested action",
  • "errorLink": "E0000006",
  • "errorId": "sampleNUSD_8fdkFd8fs8SDBK",
  • "errorCauses": [ ]
}