User sharing management API
The User Sharing API Definition (version v1).
Download the OpenAPI definition (YAML)
Security schemes
OAuth2: oauth2
authorizationCode flow, token URL https://localhost:9443/oauth2/token, authorization URL https://localhost:9443/oauth2/authorize
3 scopes
| Scope | Description |
|---|---|
share | internal_org_user_share |
unshare | internal_org_user_unshare |
view | internal_org_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
/o/users/unshare-with-allAPI to reset access before applying the new sharing policy.
Scope(Permission) required: internal_org_user_share
Request body (required): application/json
Schema: UserShareRequestBody
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be shared. |
userCriteria.userIds | array of string | List of user IDs. | |
organizations | array of object | Yes | List of organizations specifying sharing scope and roles. |
Responses
| Code | Description | Schema |
|---|---|---|
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
/o/users/unshare-with-allAPI to reset access before applying the new sharing policy.
Scope(Permission) required: internal_org_user_share
Request body (required): application/json
Schema: UserShareWithAllRequestBody
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be shared. |
userCriteria.userIds | array of string | List of user IDs. | |
policy | string | Yes | The scope of sharing for this organization. Possible values are:
|
roles | array of RoleWithAudience | A list of roles shared across all organizations. |
Responses
| Code | Description | Schema |
|---|---|---|
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_org_user_unshare
Request body (required): application/json
Schema: UserUnshareRequestBody
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be unshared. |
userCriteria.userIds | array of string | List of user IDs. | |
organizations | array of string | Yes | List of organization IDs from which the users should be unshared. |
Responses
| Code | Description | Schema |
|---|---|---|
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_org_user_unshare
Request body (required): application/json
Schema: UserUnshareWithAllRequestBody
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be unshared. |
userCriteria.userIds | array of string | List of user IDs. |
Responses
| Code | Description | Schema |
|---|---|---|
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_org_user_shared_access_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
userId | path | string | Yes | The ID of the user. |
after | query | string | The cursor indicating the item after which the next page of results will begin. | |
before | query | string | The cursor pointing to the item before which the previous page of results should be returned. | |
limit | query | integer | The maximum number of results to return per page. | |
filter | query | string | A filter to apply to the results, such as by organization name or other criteria. | |
recursive | query | boolean | Whether to retrieve organizations recursively, including child organizations. Default: |
Responses
| Code | Description | Schema |
|---|---|---|
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_org_user_shared_access_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
userId | path | string | Yes | The ID of the user for whom roles are being retrieved. |
orgId | query | string | Yes | The organization ID for which roles are being fetched. |
after | query | string | The cursor indicating the item after which the next page of results will begin. | |
before | query | string | The cursor pointing to the item before which the previous page of results should be returned. | |
limit | query | integer | The maximum number of results to return per page. | |
filter | query | string | Filter to apply when retrieving the roles. | |
recursive | query | boolean | Set to true to retrieve roles recursively. |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be shared. |
userCriteria.userIds | array of string | List of user IDs. | |
organizations | array of object | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be shared. |
userCriteria.userIds | array of string | List of user IDs. | |
policy | string | Yes | The scope of sharing for this organization. Possible values are:
|
roles | array 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
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be unshared. |
userCriteria.userIds | array of string | List of user IDs. | |
organizations | array of string | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
userCriteria | object | Yes | Contains a list of user IDs to be unshared. |
userCriteria.userIds | array 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
| Name | Type | Required | Description |
|---|---|---|---|
links | array of object | Pagination links for navigating the result set. | |
sharedOrganizations | array 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
| Name | Type | Required | Description |
|---|---|---|---|
links | array of object | Pagination links for navigating the result set. | |
roles | array 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
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Display name of the role |
audience | object | Yes | |
audience.display | string | Yes | Display name of the audience |
audience.type | string | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
status | string | Status of the process. | |
details | string | 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
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | An error code. |
message | string | Yes | An error message. |
description | string | An error description. | |
traceId | string (uuid) | Yes | A trace ID in UUID format to help with debugging. |
Was this page helpful?