Skip to main content
You're reading Identity & Access Management 7.1.0. The newest release is 7.3.0, and Cloud has the newest features. Go to the newest release

User sharing Management API

Download OpenAPI (YAML)Version v1

Base URL: https://localhost:9443/t/carbon.super/api/server/v1

The User Sharing API Definition (version v1).

Download the OpenAPI definition (YAML)

Security schemes​

BasicAuth: HTTP basic

OAuth2: oauth2

authorizationCode flow, token URL https://localhost:9443/oauth2/token, authorization URL https://localhost:9443/oauth2/authorize

3 scopes
ScopeDescription
shareinternal_user_share
unshareinternal_user_unshare
viewinternal_user_shared_access_view

User Sharing​

Share a user across specific organizations​

POST /users/share

This API shares one or more users across specified organizations, assigning roles based on the provided policy. The policy defines the sharing scope for each organization, including whether access extends to child organizations.

Important </br> If you switch a user from a general sharing policy to a selective sharing policy or vice versa, without unsharing a user, it can lead to access issues. To ensure a smooth transition, first unshare the user from all organizations and share them again with the desired organization(s) under the updated policy. </br> If you overlook this step and notice unexpected user-sharing behavior when new organizations are created, use the /users/unshare-with-all API to reset access before applying the new sharing policy.

Scope(Permission) required: internal_user_share

Request body (required): application/json

Schema: UserShareRequestBody

3 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be shared.

userCriteria.userIdsarray of string

List of user IDs.

organizationsarray of objectYes

List of organizations specifying sharing scope and roles.

Responses

CodeDescriptionSchema
202

Sharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Share a user with all organizations​

POST /users/share-with-all

This API shares users across all organizations, applying the provided roles to each organization. The policy determines the scope of sharing, including whether it applies to all current organizations or future organizations as well.

Important </br> If you switch a user from a general sharing policy to a selective sharing policy or vice versa, without unsharing a user, it can lead to access issues. To ensure a smooth transition, first unshare the user from all organizations and share them again with the desired organization(s) under the updated policy. </br> If you overlook this step and notice unexpected user-sharing behavior when new organizations are created, use the /users/unshare-with-all API to reset access before applying the new sharing policy.

Scope(Permission) required: internal_user_share

Request body (required): application/json

Schema: UserShareWithAllRequestBody

4 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be shared.

userCriteria.userIdsarray of string

List of user IDs.

policystringYes

The scope of sharing for this organization. Possible values are:

  • ALL_EXISTING_ORGS_ONLY:</br> Share the resource with all organizations that exist at the time the policy is applied. New organizations created after the policy is applied will not be included.
  • ALL_EXISTING_AND_FUTURE_ORGS:</br> Share the resource with all current organizations and automatically include any organizations created in the future.
  • IMMEDIATE_EXISTING_ORGS_ONLY:</br> Share the resource only with immediate child organizations that exist when the policy is applied. Future immediate child organizations are not included.
  • IMMEDIATE_EXISTING_AND_FUTURE_ORGS: </br> Share the resource with immediate existing child organizations and automatically include any immediate child organizations created in the future.
rolesarray of RoleWithAudience

A list of roles shared across all organizations.

Responses

CodeDescriptionSchema
202

Sharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Unshare a user from specific organizations​

POST /users/unshare

The parent organization admins can use this API to unshare a shared user from a selected list of organizations. The payload includes the list of user IDs and the organizations from which the users should be unshared.

Note the following details:

  • unsharing can only be done from the same organization that initially shared the user.
  • if you have shared a user with an organization and its children, unsharing the user from that organization will not unshare the user from the child organizations. You must explicitly declare all the organization IDs from which the user should be removed.

Scope(Permission) required: internal_user_unshare

Request body (required): application/json

Schema: UserUnshareRequestBody

3 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be unshared.

userCriteria.userIdsarray of string

List of user IDs.

organizationsarray of stringYes

List of organization IDs from which the users should be unshared.

Responses

CodeDescriptionSchema
202

Unsharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Remove a user's shared access​

POST /users/unshare-with-all

This API removes all shared access for one or more users, unsharing them from all organizations. Note that unsharing can only be done from the same organization that initially shared the user.

Scope(Permission) required: internal_user_unshare

Request body (required): application/json

Schema: UserUnshareWithAllRequestBody

2 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be unshared.

userCriteria.userIdsarray of string

List of user IDs.

Responses

CodeDescriptionSchema
202

Share removal process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

User Accessible Organizations​

Get the list of organizations accessible by the user​

GET /users/{userId}/shared-organizations

This API retrieves the list of organizations where the specified user has shared access.

Scope(Permission) required: internal_user_shared_access_view

Parameters

NameInTypeRequiredDescription
userIdpathstringYes

The ID of the user.

afterquerystring

The cursor indicating the item after which the next page of results will begin.

beforequerystring

The cursor pointing to the item before which the previous page of results should be returned.

limitqueryinteger

The maximum number of results to return per page.

filterquerystring

A filter to apply to the results, such as by organization name or other criteria.

recursivequeryboolean

Whether to retrieve organizations recursively, including child organizations.

Default: false

Responses

CodeDescriptionSchema
200

Successful Response with Accessible Organizations

UserSharedOrganizationsResponse
400

Bad Request

Error
500

Internal Server Error

Error

User Accessible Roles​

Get roles assigned to a user in an organization​

GET /users/{userId}/shared-roles

This API fetches the roles assigned to the specified user within a particular organization. </br> Note that the roles returned are only the roles assigned by the organization that initially shared the user. Any additional roles assigned to the user from the shared organizations are not included in this response.

Scope(Permission) required: internal_user_shared_access_view

Parameters

NameInTypeRequiredDescription
userIdpathstringYes

The ID of the user for whom roles are being retrieved.

orgIdquerystringYes

The organization ID for which roles are being fetched.

afterquerystring

The cursor indicating the item after which the next page of results will begin.

beforequerystring

The cursor pointing to the item before which the previous page of results should be returned.

limitqueryinteger

The maximum number of results to return per page.

filterquerystring

Filter to apply when retrieving the roles.

recursivequeryboolean

Set to true to retrieve roles recursively.

Responses

CodeDescriptionSchema
200

Successful Response with Accessible Roles

UserSharedRolesResponse
400

Bad Request

Error
500

Internal Server Error

Error

Schemas​

UserShareRequestBody​

Type: object

The request body for sharing users with multiple child organizations. Includes a list of users, organizations, sharing scope as policy, and roles.

3 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be shared.

userCriteria.userIdsarray of string

List of user IDs.

organizationsarray of objectYes

List of organizations specifying sharing scope and roles.

UserShareWithAllRequestBody​

Type: object

Process a request to share users with all organizations. The payload contains the roles applicable across all organizations and a policy that defines the scope of sharing.

4 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be shared.

userCriteria.userIdsarray of string

List of user IDs.

policystringYes

The scope of sharing for this organization. Possible values are:

  • ALL_EXISTING_ORGS_ONLY:</br> Share the resource with all organizations that exist at the time the policy is applied. New organizations created after the policy is applied will not be included.
  • ALL_EXISTING_AND_FUTURE_ORGS:</br> Share the resource with all current organizations and automatically include any organizations created in the future.
  • IMMEDIATE_EXISTING_ORGS_ONLY:</br> Share the resource only with immediate child organizations that exist when the policy is applied. Future immediate child organizations are not included.
  • IMMEDIATE_EXISTING_AND_FUTURE_ORGS: </br> Share the resource with immediate existing child organizations and automatically include any immediate child organizations created in the future.
rolesarray of RoleWithAudience

A list of roles shared across all organizations.

UserUnshareRequestBody​

Type: object

The request body for unsharing users from multiple organizations. Includes a list of user IDs and a list of organization IDs.

3 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be unshared.

userCriteria.userIdsarray of string

List of user IDs.

organizationsarray of stringYes

List of organization IDs from which the users should be unshared.

UserUnshareWithAllRequestBody​

Type: object

The request body for unsharing users from all organizations. Includes a list of user IDs.

2 properties
NameTypeRequiredDescription
userCriteriaobjectYes

Contains a list of user IDs to be unshared.

userCriteria.userIdsarray of string

List of user IDs.

UserSharedOrganizationsResponse​

Type: object

Response listing organizations where a user has shared access, including sharing policies, shared type and pagination links for navigating results.

2 properties
NameTypeRequiredDescription
linksarray of object

Pagination links for navigating the result set.

sharedOrganizationsarray of object

A list of shared access details for the user across multiple organizations

UserSharedRolesResponse​

Type: object

Response showing the roles assigned to a user within a specific organization, with pagination support for large role sets.

2 properties
NameTypeRequiredDescription
linksarray of object

Pagination links for navigating the result set.

rolesarray of RoleWithAudience

A list of roles with audience details

RoleWithAudience​

Type: object

Represents a user role within a specific audience (organization or application), defined by its display name and audience type.

4 properties
NameTypeRequiredDescription
displayNamestringYes

Display name of the role

audienceobjectYes
audience.displaystringYes

Display name of the audience

audience.typestringYes

Type of the audience, e.g., 'organization' or 'application'

ProcessSuccessResponse​

Type: object

Indicates that the sharing or unsharing process has started successfully, with the current status and relevant details.

2 properties
NameTypeRequiredDescription
statusstring

Status of the process.

detailsstring

Additional information about the process.

Error​

Type: object

Details of an error, including code, message, description, and a trace ID to help with debugging.

4 properties
NameTypeRequiredDescription
codestringYes

An error code.

messagestringYes

An error message.

descriptionstring

An error description.

traceIdstring (uuid)Yes

A trace ID in UUID format to help with debugging.

Was this page helpful?