Agent Sharing API
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
| Scope | Description |
|---|---|
internal_agent_share | Share agents across organizations. |
internal_agent_unshare | Unshare agents from organizations. |
internal_agent_shared_access_view | View shared organizations and roles for an agent. |
internal_agent_shared_access_update | Update 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
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
organizations | array of AgentOrgShareConfig | Yes | List of organizations to share agents with, along with policies and optional role assignments. |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
Operations | array of AgentSharingPatchOperation | Yes |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
policy | string | Yes | Global sharing policy. Possible values:
|
roleAssignment | RoleAssignment | Optional global role assignment configuration that applies to all organizations covered by this policy. If omitted, default behavior is no roles. |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
orgIds | array of string | Yes | List of organization IDs from which agents should be unshared. |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
Responses
| Code | Description | Schema |
|---|---|---|
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_ORGSpolicy → top-levelsharingModeis returned, and no per-orgsharingModeis present on each organization entry. - If the agent has been shared via
SELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN→ no top-levelsharingModeis returned, and each organization entry includes its ownsharingMode. - 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
sharingModeinformation.
Scope required: internal_agent_shared_access_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agentId | path | string | Yes | The ID of the agent. |
before | query | string | Base64 encoded cursor value for backward pagination. | |
after | query | string | Base64 encoded cursor value for forward pagination. | |
filter | query | string | Condition to filter the retrieval of records.
Supports | |
limit | query | integer | Maximum number of records to return. If you do not specify this parameter, this will return all shared organizations. | |
recursive | query | boolean | 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. | |
attributes | query | string | Specifies the required parameters in the response.
Supported values: |
Responses
| Code | Description | Schema |
|---|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
agentIds | array of string | Yes | List of agent IDs. |
AgentShareSelectedRequestBody
Type: object
Request body for sharing agents with a selected set of organizations.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
organizations | array of AgentOrgShareConfig | Yes | 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
| Name | Type | Required | Description |
|---|---|---|---|
orgId | string | Yes | Organization ID to share the agents with. |
policy | string | Yes | Sharing scope for this organization. Possible values:
|
roleAssignment | RoleAssignment | Optional role assignment configuration for this organization.
If omitted, the default behavior is to assign no roles (equivalent to |
AgentShareAllRequestBody
Type: object
Request body for sharing agents with all organizations controlled by the selected policy.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
policy | string | Yes | Global sharing policy. Possible values:
|
roleAssignment | RoleAssignment | 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
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
orgIds | array of string | Yes | List of organization IDs from which agents should be unshared. |
AgentUnshareAllRequestBody
Type: object
Request body for unsharing agents from all organizations.
1 property
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
AgentSharingPatchRequest
Type: object
PATCH request for performing incremental role assignment operations on already shared agents.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
agentCriteria | AgentCriteria | Yes | Criteria for selecting agents to share/unshare. |
Operations | array of AgentSharingPatchOperation | Yes |
AgentSharingPatchOperation
Type: object
A single PATCH operation (SCIM-like) for agent sharing.
Currently supported:
op: "add"→ Add roles.op: "remove"→ Remove roles.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
op | string | Yes | Operation type. Supported values: |
path | string | Yes | JSON-like path in the format:
|
value | array 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 underroles.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
mode | string | Mode of role assignment. Allowed values: | |
roles | array of RoleShareConfig | List of roles to assign when |
RoleShareConfig
Type: object
Role to be assigned to the shared agent in the sub-organization.
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
displayName | string | Yes | Human-readable name of the role. |
audience | object | Yes | |
audience.display | string | Yes | Display name of the audience (organization or application). |
audience.type | string | Yes | Type of the role audience:
|
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
| Name | Type | Required | Description |
|---|---|---|---|
policy | string | Yes | Global sharing policy covering all existing and future organizations. Allowed values: |
roleAssignment | RoleAssignment | Yes | Role assignment configuration for shared agents. This controls which roles are assigned to the agent in the target organization.
|
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
| Name | Type | Required | Description |
|---|---|---|---|
policy | string | Yes | Sharing policy scoped to a selected organization and its children. Allowed values: |
roleAssignment | RoleAssignment | Yes | Role assignment configuration for shared agents. This controls which roles are assigned to the agent in the target organization.
|
AgentSharedOrganizationBase
Type: object
Common fields for a shared organization entry.
12 properties
| Name | Type | Required | Description |
|---|---|---|---|
orgId | string | ID of the child organization. | |
orgName | string | Name of the child organization. | |
orgHandle | string | Unique, human-readable handle of the organization. | |
orgStatus | string | Current status of the organization. | |
orgRef | string | API reference of the organization resource. | |
hasChildren | boolean | Indicates whether the organization has child organizations. | |
depthFromRoot | integer | Depth of the organization in the hierarchy, where root is 0. | |
parentOrgId | string | ID of the parent (sharing initiated) organization. | |
parentAgentId | string | ID of the original agent in the parent (home) organization. | |
sharedAgentId | string | ID of the shared agent object in the target organization. | |
sharedType | string | Shared type of the agent. | |
roles | array 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
| Name | Type | Required | Description |
|---|---|---|---|
orgId | string | ID of the child organization. | |
orgName | string | Name of the child organization. | |
orgHandle | string | Unique, human-readable handle of the organization. | |
orgStatus | string | Current status of the organization. | |
orgRef | string | API reference of the organization resource. | |
hasChildren | boolean | Indicates whether the organization has child organizations. | |
depthFromRoot | integer | Depth of the organization in the hierarchy, where root is 0. | |
parentOrgId | string | ID of the parent (sharing initiated) organization. | |
parentAgentId | string | ID of the original agent in the parent (home) organization. | |
sharedAgentId | string | ID of the shared agent object in the target organization. | |
sharedType | string | Shared type of the agent. | |
roles | array 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
| Name | Type | Required | Description |
|---|---|---|---|
orgId | string | ID of the child organization. | |
orgName | string | Name of the child organization. | |
orgHandle | string | Unique, human-readable handle of the organization. | |
orgStatus | string | Current status of the organization. | |
orgRef | string | API reference of the organization resource. | |
hasChildren | boolean | Indicates whether the organization has child organizations. | |
depthFromRoot | integer | Depth of the organization in the hierarchy, where root is 0. | |
parentOrgId | string | ID of the parent (sharing initiated) organization. | |
parentAgentId | string | ID of the original agent in the parent (home) organization. | |
sharedAgentId | string | ID of the shared agent object in the target organization. | |
sharedType | string | Shared type of the agent. | |
roles | array of RoleShareConfig | Effective roles assigned to this agent in this organization via agent sharing. | |
sharingMode | SharingModeSelected | Yes | Per-org sharing mode present when the agent is shared with SELECTED organizations.
Policy is always |
AgentSharedOrgsAllResponse
Type: object
Response when the agent is shared with ALL organizations.
- Top-level
sharingModeis present with policyALL_EXISTING_AND_FUTURE_ORGS. - Per-org
sharingModeis absent on each organization entry.
3 properties
| Name | Type | Required | Description |
|---|---|---|---|
links | array of Link | ||
sharingMode | SharingModeAll | Yes | Top-level sharing mode present when the agent is shared with ALL organizations.
Policy is always |
organizations | array of AgentSharedOrganizationAllEntry | Yes |
AgentSharedOrgsSelectedResponse
Type: object
Response when the agent is shared with SELECTED organizations.
- Top-level
sharingModeis absent. - Each organization entry includes its own
sharingModewith policySELECTED_ORG_WITH_ALL_EXISTING_AND_FUTURE_CHILDREN.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
links | array of Link | ||
organizations | array of AgentSharedOrganizationSelectedEntry | Yes |
ProcessSuccessResponse
Type: object
Indicates that a sharing / unsharing / patch process has been triggered.
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
status | string | ||
details | string |
Error
Type: object
Error response model with a code, message, description, and trace ID.
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | |
message | string | Yes | |
description | string | ||
traceId | string | Yes |
Was this page helpful?