Spaces method and path for this operation:
Refer to Spaces for more information.
Replace the per-agent access control list (ACL). The agent owner, cluster admins, and anyone the ACL grants Editor or higher can call this endpoint (or anyone with manageAgents on a Public agent). Each call replaces the entire entries list — the most recent successful update wins. To learn more about agents, refer to the agents documentation.
[Required authorization] Route required privileges: agentBuilder:manageAgents.
Body
-
Access control entries to apply to the agent. Each entry has a
type(currently onlyuseris supported; role-based grants are planned for a future release), aname(the principal username), and arole. Submitting this field replaces the existing ACL entirely; submit an empty array to clear all grants.Not more than
100elements.
Responses
-
Indicates a successful response
-
Bad Request — the request body failed validation, or the request targets the built-in Elastic default agent (which cannot have an ACL).
-
Not Found — no agent with this ID is visible to the caller, or the caller lacks write access. Matches the existing
agentNotFoundshape so unprivileged callers cannot probe for hidden agents.
curl \
-X PUT "${KIBANA_URL}/api/agent_builder/agents/{id}/acl" \
-H "Authorization: ApiKey ${API_KEY}" \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{
"entries": [
{ "type": "user", "name": "alice", "role": "editor" },
{ "type": "user", "name": "bob", "role": "user" }
]
}'
PUT kbn://api/agent_builder/agents/{id}/acl
{
"entries": [
{ "type": "user", "name": "alice", "role": "editor" },
{ "type": "user", "name": "bob", "role": "user" }
]
}
{
"entries": []
}
{
"entries": [
{
"name": "alice",
"role": "editor",
"type": "user"
},
{
"name": "bob",
"role": "user",
"type": "user"
}
]
}
{
"entries": [
{
"name": "alice",
"role": "editor",
"type": "user"
},
{
"name": "bob",
"role": "user",
"type": "user"
}
]
}
{
"attributes": {
"trace_id": "8d4f2a3b-1c5e-4a9b-9f0d-2e6c1a3d4f5e"
},
"error": "Bad Request",
"message": "The default agent (elastic-ai-agent) does not support custom access controls.",
"statusCode": 400
}
{
"error": "Bad Request",
"message": "[request body.entries]: array size is [101], but cannot be greater than [100]",
"statusCode": 400
}
{
"attributes": {
"trace_id": "8d4f2a3b-1c5e-4a9b-9f0d-2e6c1a3d4f5e"
},
"error": "Not Found",
"message": "Agent custom-agent-id not found",
"statusCode": 404
}