Skip to main content

User sharing management API V2

Download OpenAPI (YAML)Version 1.0.0

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

The User Sharing API (v2) (version 1.0.0).

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

4 scopes
ScopeDescription
internal_org_user_shareShare users across organizations.
internal_org_user_unshareUnshare users from organizations.
internal_org_user_shared_access_viewView shared organizations and roles for a user.
internal_org_user_shared_access_updateUpdate shared attributes (e.g., roles) for shared users.

User Sharing​

Share users with specific organizations​

POST /users/share

Share one or more users with a selected set of organizations, optionally assigning roles to each shared user in each target organization.

This endpoint is treated as a processing function: it triggers a sharing process and responds with 202 Accepted.

Scope required: internal_org_user_share

Request body (required): application/json

Schema: UserShareSelectedRequestBody

2 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

organizationsarray of UserOrgShareConfigYes

List of organizations to share users with, along with policies and optional role assignments.

Responses

CodeDescriptionSchema
202

User sharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Perform incremental role assignment operations for already shared users​

PATCH /users/share

Perform incremental updates to the shared attributes (eg: role assignments) update of already shared users.

This endpoint supports SCIM-like PATCH semantics:

  • op: "add" → assign additional roles.
  • op: "remove" → remove specific roles.

Note:
Only role assignments updates are managed here as of now. Sharing/unsharing organizations is handled via /users/share, /users/share-with-all, /users/unshare, and /users/unshare-with-all.

Scope required: internal_org_user_shared_access_update

Request body (required): application/json

Schema: UserSharingPatchRequest

2 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

Operationsarray of UserSharingPatchOperationYes

Responses

CodeDescriptionSchema
202

Role assignment patch operation processed successfully.

ProcessSuccessResponse
400

Bad Request

Error
404

Not Found

Error
500

Internal Server Error

Error

Share users with all organizations​

POST /users/share-with-all

Share one or more users with all organizations according to the specified policy.

A common roleAssignment can be provided to assign roles in all matching organizations.

This endpoint is treated as a processing function and responds with 202 Accepted.

Scope required: internal_org_user_share

Request body (required): application/json

Schema: UserShareAllRequestBody

3 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

policystringYes

Global sharing policy.

Possible values:

  • ALL_EXISTING_AND_FUTURE_ORGS
roleAssignmentRoleAssignment

Optional global role assignment configuration that applies to all organizations covered by this policy. If omitted, default behavior is no roles.

Responses

CodeDescriptionSchema
202

Share-all process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Unshare users from specific organizations​

POST /users/unshare

Unshare one or more users from a selected set of organizations.

Note: This only removes the user from the specified organizations. If the user was shared with a parent org plus its children via a broader policy, you must explicitly include all relevant organization IDs when unsharing.

This endpoint is treated as a processing function and responds with 202 Accepted.

Scope required: internal_org_user_unshare

Request body (required): application/json

Schema: UserUnshareSelectedRequestBody

2 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

orgIdsarray of stringYes

List of organization IDs from which users should be unshared.

Responses

CodeDescriptionSchema
202

Unsharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Unshare users from all organizations​

POST /users/unshare-with-all

Completely remove all shared access for one or more users from all organizations.

This endpoint is treated as a processing function and responds with 202 Accepted.

Scope required: internal_org_user_unshare

Request body (required): application/json

Schema: UserUnshareAllRequestBody

1 property
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

Responses

CodeDescriptionSchema
202

Unshare-all process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

User Accessible Organizations​

List organizations where the user has shared access​

GET /users/{userId}/share

Retrieve the list of organizations where the specified user has shared access, including per-organization effective role assignments.

The response shape depends on how the user was shared:

  • If user has been shared via ALL_EXISTING_AND_FUTURE_ORGS policy → top-level sharingMode is returned, and no per-org sharingMode is present on each organization entry.
  • If user has been shared via SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN → no top-level sharingMode is returned, and each organization entry includes its own sharingMode.
  • If user has not been shared under any future applicable policies mentioned above, the response will simply include the list of shared organizations without any sharingMode information.

This follows the same pattern as GET /applications/{applicationId}/share.

Scope required: internal_org_user_shared_access_view

Parameters

NameInTypeRequiredDescription
userIdpathstringYes

The ID of the user.

beforequerystring

Base64 encoded cursor value for backward pagination.

afterquerystring

Base64 encoded cursor value for forward pagination.

filterquerystring

Condition to filter the retrieval of records. Supports sw, co, ew, and eq operations.

limitqueryinteger

Maximum number of records to return. If you do not specify this parameter, this will return all shared organizations.

recursivequeryboolean

Determines whether a recursive search should happen. If set to true, includes shared organizations in all levels of the hierarchy; if set to false, includes only shared organizations in the next level of the hierarchy.

attributesquerystring

Specifies the required parameters in the response. Supported values: roles, sharingMode.

Responses

CodeDescriptionSchema
200

Successful response with the user's shared organizations.

one of: UserSharedOrgsAllResponse, UserSharedOrgsSelectedResponse
400

Bad Request

Error
500

Internal Server Error

Error

Schemas​

UserCriteria​

Type: object

Criteria for selecting users to share/unshare.

1 property
NameTypeRequiredDescription
userIdsarray of stringYes

List of user IDs.

UserShareSelectedRequestBody​

Type: object

Request body for sharing users with a selected set of organizations.

2 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

organizationsarray of UserOrgShareConfigYes

List of organizations to share users with, along with policies and optional role assignments.

UserOrgShareConfig​

Type: object

Per-organization sharing configuration for selected organizations.

3 properties
NameTypeRequiredDescription
orgIdstringYes

Organization ID to share the users with.

policystringYes

Sharing scope for this organization.

Possible values:

  • SELECTED_ORG_ONLY
  • SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN
roleAssignmentRoleAssignment

Optional role assignment configuration for this organization. If omitted, the default behavior is to assign no roles (equivalent to mode = NONE).

UserShareAllRequestBody​

Type: object

Request body for sharing users with all organizations controlled by the selected policy.

3 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

policystringYes

Global sharing policy.

Possible values:

  • ALL_EXISTING_AND_FUTURE_ORGS
roleAssignmentRoleAssignment

Optional global role assignment configuration that applies to all organizations covered by this policy. If omitted, default behavior is no roles.

UserUnshareSelectedRequestBody​

Type: object

Request body for unsharing users from selected organizations.

2 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

orgIdsarray of stringYes

List of organization IDs from which users should be unshared.

UserUnshareAllRequestBody​

Type: object

Request body for unsharing users from all organizations.

1 property
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

UserSharingPatchRequest​

Type: object

PATCH request for performing incremental role assignment operations on already shared users.

2 properties
NameTypeRequiredDescription
userCriteriaUserCriteriaYes

Criteria for selecting users to share/unshare.

Operationsarray of UserSharingPatchOperationYes

UserSharingPatchOperation​

Type: object

A single PATCH operation (SCIM-like) for user sharing.

Currently supported:

  • op: "add" → Add roles.
  • op: "remove" → Remove roles.
3 properties
NameTypeRequiredDescription
opstringYes

Operation type. Supported values: add, remove.

pathstringYes

JSON-like path in the format:

  • organizations[orgId eq \"<org-id>\"].roles
valuearray of RoleShareConfig

List of roles to add/remove under the specified path.

RoleAssignment​

Type: object

Role assignment configuration for shared users.

This controls which roles are assigned to the user in the target organization.

  • NONE → Do not assign any roles via user sharing.
  • SELECTED → Assign only the roles listed under roles.
2 properties
NameTypeRequiredDescription
modestring

Mode of role assignment.

Allowed values: NONE, SELECTED. Default: SELECTED

rolesarray of RoleShareConfig

List of roles to assign when mode = SELECTED. Required when mode = SELECTED. Ignored when mode = NONE.

RoleShareConfig​

Type: object

Role to be assigned to the shared user in the sub-organization.

4 properties
NameTypeRequiredDescription
displayNamestringYes

Human-readable name of the role.

audienceobjectYes
audience.displaystringYes

Display name of the audience (organization or application).

audience.typestringYes

Type of the role audience:

  • organization
  • application

SharingModeAll​

Type: object

Top-level sharing mode present when the user is shared with ALL organizations. Policy is always ALL_EXISTING_AND_FUTURE_ORGS.

2 properties
NameTypeRequiredDescription
policystringYes

Global sharing policy covering all existing and future organizations.

Allowed values: ALL_EXISTING_AND_FUTURE_ORGS

roleAssignmentRoleAssignmentYes

Role assignment configuration for shared users.

This controls which roles are assigned to the user in the target organization.

  • NONE → Do not assign any roles via user sharing.
  • SELECTED → Assign only the roles listed under roles.

SharingModeSelected​

Type: object

Per-org sharing mode present when the user is shared with SELECTED organizations. Policy is always SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN.

2 properties
NameTypeRequiredDescription
policystringYes

Sharing policy scoped to a selected organization and its children.

Allowed values: SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN

roleAssignmentRoleAssignmentYes

Role assignment configuration for shared users.

This controls which roles are assigned to the user in the target organization.

  • NONE → Do not assign any roles via user sharing.
  • SELECTED → Assign only the roles listed under roles.

UserSharedOrganizationBase​

Type: object

Common fields for a shared organization entry.

12 properties
NameTypeRequiredDescription
orgIdstring

ID of the child organization.

orgNamestring

Name of the child organization.

orgHandlestring

Unique, human-readable handle of the organization.

orgStatusstring

Current status of the organization.

orgRefstring

API reference of the organization resource.

hasChildrenboolean

Indicates whether the organization has child organizations.

depthFromRootinteger

Depth of the organization in the hierarchy, where root is 0.

parentOrgIdstring

ID of the parent (sharing initiated) organization.

parentUserIdstring

ID of the user in the parent (sharing initiated) organization.

sharedUserIdstring

ID of the shared user object in the target organization.

sharedTypestring

Shared type of the user.

rolesarray of RoleShareConfig

Effective roles assigned to this user in this organization via user sharing.

UserSharedOrganizationAllEntry​

Type: UserSharedOrganizationBase

Organization entry when user is shared via ALL_EXISTING_AND_FUTURE_ORGS policy. No per-org sharingMode is present.

12 properties
NameTypeRequiredDescription
orgIdstring

ID of the child organization.

orgNamestring

Name of the child organization.

orgHandlestring

Unique, human-readable handle of the organization.

orgStatusstring

Current status of the organization.

orgRefstring

API reference of the organization resource.

hasChildrenboolean

Indicates whether the organization has child organizations.

depthFromRootinteger

Depth of the organization in the hierarchy, where root is 0.

parentOrgIdstring

ID of the parent (sharing initiated) organization.

parentUserIdstring

ID of the user in the parent (sharing initiated) organization.

sharedUserIdstring

ID of the shared user object in the target organization.

sharedTypestring

Shared type of the user.

rolesarray of RoleShareConfig

Effective roles assigned to this user in this organization via user sharing.

UserSharedOrganizationSelectedEntry​

Type: UserSharedOrganizationBase

Organization entry when user is shared via SELECTED org policy. Includes per-org sharingMode with policy SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN.

13 properties
NameTypeRequiredDescription
orgIdstring

ID of the child organization.

orgNamestring

Name of the child organization.

orgHandlestring

Unique, human-readable handle of the organization.

orgStatusstring

Current status of the organization.

orgRefstring

API reference of the organization resource.

hasChildrenboolean

Indicates whether the organization has child organizations.

depthFromRootinteger

Depth of the organization in the hierarchy, where root is 0.

parentOrgIdstring

ID of the parent (sharing initiated) organization.

parentUserIdstring

ID of the user in the parent (sharing initiated) organization.

sharedUserIdstring

ID of the shared user object in the target organization.

sharedTypestring

Shared type of the user.

rolesarray of RoleShareConfig

Effective roles assigned to this user in this organization via user sharing.

sharingModeSharingModeSelectedYes

Per-org sharing mode present when the user is shared with SELECTED organizations. Policy is always SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN.

UserSharedOrgsAllResponse​

Type: object

Response when the user is shared with ALL organizations.

  • Top-level sharingMode is present with policy ALL_EXISTING_AND_FUTURE_ORGS.
  • Per-org sharingMode is absent on each organization entry.
3 properties
NameTypeRequiredDescription
linksarray of Link
sharingModeSharingModeAllYes

Top-level sharing mode present when the user is shared with ALL organizations. Policy is always ALL_EXISTING_AND_FUTURE_ORGS.

organizationsarray of UserSharedOrganizationAllEntryYes

UserSharedOrgsSelectedResponse​

Type: object

Response when the user is shared with SELECTED organizations.

  • Top-level sharingMode is absent.
  • Each organization entry includes its own sharingMode with policy SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN.
2 properties
NameTypeRequiredDescription
linksarray of Link
organizationsarray of UserSharedOrganizationSelectedEntryYes

Type: object

2 properties
NameTypeRequiredDescription
hrefstring
relstring

ProcessSuccessResponse​

Type: object

Indicates that a sharing / unsharing / patch process has been triggered.

2 properties
NameTypeRequiredDescription
statusstring
detailsstring

Error​

Type: object

Error response model with a code, message, description, and trace ID.

4 properties
NameTypeRequiredDescription
codestringYes
messagestringYes
descriptionstring
traceIdstringYes

Was this page helpful?