iam.agent-sessions.set-scopeAllow an agent session to write or destroy for a while, or drop it to read-only
Raising a session needs a person signed in to the console; an access key or OAuth token is refused, so an agent cannot raise itself. Your own agents need no IAM action.
Request syntax
POST /iam/api/agent-sessions/{id}/scope
{
"scope": "enum",
"durationMinutes": "number"
}Path parameters
idRequiredstring
Constraints: uuid
Request body
scopeRequiredenum
What the session may do
One of:
read,write,destructivedurationMinutesOptionalnumber
15, 60 or 480. Default: 60 for write, 15 for destructive
Constraints: integer
Response
200 with { id, scope, scopeExpiresAt }: when the raised scope falls back to read (null for read).
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow iam:UpdateAgentSession on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud iam agent-sessions set-scope id --scope readcurl -X POST "https://console.platform-development.deutschecloud.app/iam/api/agent-sessions/id/scope" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"scope":"read"}'Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_iam_agent-sessions_set-scope.