Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Agent Sharing API

Download OpenAPI (YAML)Version 1.0.0

Base URL: https://api.asgardeo.io/t/{organization-name}/api/server/v1

The Agent Sharing API (v1) (version 1.0.0).

Download the OpenAPI definition (YAML)

Security schemes​

OAuth2: oauth2

authorizationCode flow, token URL https://api.asgardeo.io/t/{organization-name}/oauth2/token, authorization URL https://api.asgardeo.io/t/{organization-name}/oauth2/authorize

4 scopes
ScopeDescription
internal_agent_shareShare agents across organizations.
internal_agent_unshareUnshare agents from organizations.
internal_agent_shared_access_viewView shared organizations and roles for an agent.
internal_agent_shared_access_updateUpdate shared attributes (e.g., roles) for shared agents.

Agent Sharing​

Share agents with specific organizations​

POST /agents/share

Share one or more agents with a selected set of organizations, optionally assigning roles to each shared agent 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_agent_share

Request body (required): application/json

Schema: AgentShareSelectedRequestBody

2 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

organizationsarray of AgentOrgShareConfigYes

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

Responses

CodeDescriptionSchema
202

Agent sharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Perform incremental role assignment operations for already shared agents​

PATCH /agents/share

Perform incremental updates to the shared attributes (e.g., role assignments) of already shared agents.

This endpoint supports SCIM-like PATCH semantics:

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

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

Scope required: internal_agent_shared_access_update

Request body (required): application/json

Schema: AgentSharingPatchRequest

2 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

Operationsarray of AgentSharingPatchOperationYes

Responses

CodeDescriptionSchema
202

Role assignment patch operation processed successfully.

ProcessSuccessResponse
400

Bad Request

Error
404

Not Found

Error
500

Internal Server Error

Error

Share agents with all organizations​

POST /agents/share-with-all

Share one or more agents 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_agent_share

Request body (required): application/json

Schema: AgentShareAllRequestBody

3 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents 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 agents from specific organizations​

POST /agents/unshare

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

Note: This only removes the agent from the specified organizations. If the agent 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_agent_unshare

Request body (required): application/json

Schema: AgentUnshareSelectedRequestBody

2 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

orgIdsarray of stringYes

List of organization IDs from which agents should be unshared.

Responses

CodeDescriptionSchema
202

Unsharing process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Unshare agents from all organizations​

POST /agents/unshare-with-all

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

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

Scope required: internal_agent_unshare

Request body (required): application/json

Schema: AgentUnshareAllRequestBody

1 property
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

Responses

CodeDescriptionSchema
202

Unshare-all process triggered successfully.

ProcessSuccessResponse
400

Bad Request

Error
500

Internal Server Error

Error

Agent Accessible Organizations​

List organizations where the agent has shared access​

GET /agents/{agentId}/share

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

The response shape depends on how the agent was shared:

  • If the agent 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 the agent 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 the agent 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.

Scope required: internal_agent_shared_access_view

Parameters

NameInTypeRequiredDescription
agentIdpathstringYes

The ID of the agent.

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 agent's shared organizations.

one of: AgentSharedOrgsAllResponse, AgentSharedOrgsSelectedResponse
400

Bad Request

Error
500

Internal Server Error

Error

Schemas​

AgentCriteria​

Type: object

Criteria for selecting agents to share/unshare.

1 property
NameTypeRequiredDescription
agentIdsarray of stringYes

List of agent IDs.

AgentShareSelectedRequestBody​

Type: object

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

2 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

organizationsarray of AgentOrgShareConfigYes

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

AgentOrgShareConfig​

Type: object

Per-organization sharing configuration for selected organizations.

3 properties
NameTypeRequiredDescription
orgIdstringYes

Organization ID to share the agents 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).

AgentShareAllRequestBody​

Type: object

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

3 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents 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.

AgentUnshareSelectedRequestBody​

Type: object

Request body for unsharing agents from selected organizations.

2 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

orgIdsarray of stringYes

List of organization IDs from which agents should be unshared.

AgentUnshareAllRequestBody​

Type: object

Request body for unsharing agents from all organizations.

1 property
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

AgentSharingPatchRequest​

Type: object

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

2 properties
NameTypeRequiredDescription
agentCriteriaAgentCriteriaYes

Criteria for selecting agents to share/unshare.

Operationsarray of AgentSharingPatchOperationYes

AgentSharingPatchOperation​

Type: object

A single PATCH operation (SCIM-like) for agent 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 agents.

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

  • NONE → Do not assign any roles via agent 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 agent 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 agent 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 agents.

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

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

SharingModeSelected​

Type: object

Per-org sharing mode present when the agent 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 agents.

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

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

AgentSharedOrganizationBase​

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.

parentAgentIdstring

ID of the original agent in the parent (home) organization.

sharedAgentIdstring

ID of the shared agent object in the target organization.

sharedTypestring

Shared type of the agent.

rolesarray of RoleShareConfig

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

AgentSharedOrganizationAllEntry​

Type: AgentSharedOrganizationBase

Organization entry when the agent 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.

parentAgentIdstring

ID of the original agent in the parent (home) organization.

sharedAgentIdstring

ID of the shared agent object in the target organization.

sharedTypestring

Shared type of the agent.

rolesarray of RoleShareConfig

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

AgentSharedOrganizationSelectedEntry​

Type: AgentSharedOrganizationBase

Organization entry when the agent 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.

parentAgentIdstring

ID of the original agent in the parent (home) organization.

sharedAgentIdstring

ID of the shared agent object in the target organization.

sharedTypestring

Shared type of the agent.

rolesarray of RoleShareConfig

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

sharingModeSharingModeSelectedYes

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

AgentSharedOrgsAllResponse​

Type: object

Response when the agent 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 agent is shared with ALL organizations. Policy is always ALL_EXISTING_AND_FUTURE_ORGS.

organizationsarray of AgentSharedOrganizationAllEntryYes

AgentSharedOrgsSelectedResponse​

Type: object

Response when the agent 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 AgentSharedOrganizationSelectedEntryYes

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?