View a markdown version of this page

Claude Managed Agents for Amazon Bedrock REST API reference - Amazon Bedrock

Claude Managed Agents for Amazon Bedrock REST API reference

The Claude Managed Agents for Amazon Bedrock API is Anthropic's Managed Agents API, with every path under /anthropic/v1/ and AWS Signature Version 4 (SigV4) signing. You define an agent, create a session for it, and send the session messages. The service runs the agent loop, calls the model, and sends each built-in tool call to a tool runner that runs on an Amazon Bedrock AgentCore Runtime in your account or on a machine that you start it on.

This reference describes what a developer needs to call the API: the endpoint and signing, the headers, the operations, the main request and response fields, and the errors. For fields that this page does not list, use Anthropic's Managed Agents API reference together with the differences described here.

Endpoint and signing

The base URL is https://bedrock.region.amazonaws.com/anthropic/v1. Every path in this reference is relative to it, so POST /agents is POST https://bedrock.us-west-2.amazonaws.com/anthropic/v1/agents. A path outside /anthropic/v1/ is not served.

AWS Region

Region code

Base URL

US East (N. Virginia)

us-east-1

https://bedrock.us-east-1.amazonaws.com/anthropic/v1

US East (Ohio)

us-east-2

https://bedrock.us-east-2.amazonaws.com/anthropic/v1

US West (Oregon)

us-west-2

https://bedrock.us-west-2.amazonaws.com/anthropic/v1

Canada (Central)

ca-central-1

https://bedrock.ca-central-1.amazonaws.com/anthropic/v1

South America (São Paulo)

sa-east-1

https://bedrock.sa-east-1.amazonaws.com/anthropic/v1

Europe (Frankfurt)

eu-central-1

https://bedrock.eu-central-1.amazonaws.com/anthropic/v1

Europe (Ireland)

eu-west-1

https://bedrock.eu-west-1.amazonaws.com/anthropic/v1

Europe (London)

eu-west-2

https://bedrock.eu-west-2.amazonaws.com/anthropic/v1

Europe (Stockholm)

eu-north-1

https://bedrock.eu-north-1.amazonaws.com/anthropic/v1

Asia Pacific (Mumbai)

ap-south-1

https://bedrock.ap-south-1.amazonaws.com/anthropic/v1

Asia Pacific (Seoul)

ap-northeast-2

https://bedrock.ap-northeast-2.amazonaws.com/anthropic/v1

Asia Pacific (Singapore)

ap-southeast-1

https://bedrock.ap-southeast-1.amazonaws.com/anthropic/v1

Asia Pacific (Sydney)

ap-southeast-2

https://bedrock.ap-southeast-2.amazonaws.com/anthropic/v1

Asia Pacific (Tokyo)

ap-northeast-1

https://bedrock.ap-northeast-1.amazonaws.com/anthropic/v1

Sign every request with SigV4, with the signing service name bedrock and the endpoint's Region. With temporary credentials, send the session token in X-Amz-Security-Token. Anthropic's SDKs sign for you.

Only IAM role sessions can call the API. A request signed by an IAM user or by the account root user is refused with 403, because the service records every agent, session, and event as created by a role.

Each operation is authorized as its own IAM action, named bedrock:VerbAnthropicNoun, such as bedrock:CreateAnthropicSession. An operation on a resource is authorized on that resource's ARN. The list operations are authorized on the project ARN, and the creates on project-arn/anthropic-type/*. The encryption configuration operations are authorized on the encryption configuration's own ARN. The tag operations use the shared Amazon Bedrock tagging actions.

The request body is JSON, at most 2 MiB (2,097,152 bytes). Each response carries x-amzn-requestid. Keep it when you report a problem.

Headers

Send these headers in addition to the SigV4 signing headers and, on a request with a body, Content-Type: application/json.

Header

Required

Description

anthropic-version

Yes

2023-06-01.

anthropic-beta

Yes

managed-agents-2026-04-01. Without it, a request returns 404 with a message that names the required anthropic-beta value.

anthropic-workspace-id

No

The Amazon Bedrock project, as a project ID such as default or proj_..., or a project ARN. Without it, the request goes to the default project. A resource is found only in its own project, so the same ID sent with another project answers 404.

x-amz-role-arn

No

On session create, a role to run the session as, the same as the body's execution_identity: any role in your account that you may pass. If both are sent, they must name the same role. Refused on session update. On other operations that name a session, it must match the role that the session was created with.

How this API differs from Anthropic's Managed Agents API

The API follows Anthropic's Managed Agents API: the same resources, paths (under /anthropic/v1/), request and response bodies, and error body. Anthropic's SDKs sign their requests with SigV4. Set the client's base URL to the base URL without its trailing /v1. The SDKs retry some failures on their own, so read Errors and retries before you use one. The main differences are the following.

Area

On Amazon Bedrock

Authentication

SigV4 with IAM role credentials.

Environments

There is no environments API. A session's environment_id is an AgentCore Runtime ARN, a runtime endpoint ARN, or the project's self-hosted ID, project-arn/anthropic-self-hosted.

Roles

An agent has one IAM role, the session role, named as execution_identity, {"type": "aws_role", "role_arn": "role-arn"}. The older name, a top-level role_arn that holds the ARN, is still accepted in its place, but a body can't name both. A session runs as its agent's role unless its create names another role in your account. The role can't change after the session is created. allowed_role_arns is refused.

Models

model is an Amazon Bedrock inference profile ID, such as us.anthropic.claude-sonnet-5-5 or global.anthropic.claude-sonnet-5-5. The ID is called as written, so its prefix decides where the model runs. A Claude model name such as claude-sonnet-5-5, a model ID with no geography prefix, an inference profile ARN, and inference_geo are refused.

MCP servers

Only aws_agentcore_gateway entries, which name an AgentCore Gateway ARN. url servers are refused.

Skills

sandbox_path entries, which name a folder in the tool runner, and s3_mount entries, which name an Amazon S3 folder that the tool runner mounts. Stored skills (custom and anthropic) are refused.

Session resources

memory_store, sandbox_path, s3_mount, and s3_object entries, named only at create. The service refuses file and github_repository entries, and the routes under /sessions/{id}/resources answer 404.

Built-in tools

A configs entry that names web_fetch or web_search is refused with 400 and feature_unsupported_on_platform.

Files, skills, vaults, and deployments APIs

Not available. Their routes answer 404 with not_found_error and a message such as "the files API is not available on Amazon Bedrock". A document block that names a file ID is refused. A session has no vault_ids, and vault_ids and budget are refused.

Outcomes

Not available. A user.define_outcome event, sent or in initial_events, is refused with 400 and feature_unsupported_on_platform, and nothing in that request is stored.

Streaming

The stream sends whole events. Partial text is sent only on a stream opened with event_deltas[].

Unknown fields

Refused with 400, where Anthropic's API may ignore them. A field repeated in one object is also refused.

Added fields

Agents, sessions, and memory stores carry resource_arn and created_by. Sessions also carry execution_identity, role_arn, and working_directory.

Retry hints

An error worth retrying can carry x-should-retry: true and retry-after-ms, which Anthropic's SDKs read.

Creates

Not idempotent. A repeated create makes a second agent, session, or memory store.

Operations

All paths are relative to the base URL. Updates use POST, not PATCH, and change only the fields that they send. Agents can't be deleted, only archived.

Operation

Method and path

Successful response

Create an agent

POST /agents

Agent resource, at version 1

List agents

GET /agents

Paginated agent summary list

Get an agent

GET /agents/{id}

Agent resource

Update an agent

POST /agents/{id}

Agent resource, at its new version

Archive an agent

POST /agents/{id}/archive

Agent resource, with archived_at set

List an agent's versions

GET /agents/{id}/versions

Paginated agent summary list

Create a session

POST /sessions

Session resource

List sessions

GET /sessions

Paginated session summary list

Get a session

GET /sessions/{id}

Session resource

Update a session

POST /sessions/{id}

Session resource

Archive a session

POST /sessions/{id}/archive

Session resource, with status terminated

Delete a session

DELETE /sessions/{id}

{"id": "...", "type": "session_deleted"}

Send events

POST /sessions/{id}/events

List of the stored events

List events

GET /sessions/{id}/events

Paginated event list

Stream events

GET /sessions/{id}/events/stream

text/event-stream

List threads

GET /sessions/{id}/threads

Paginated thread list

Get a thread

GET /sessions/{id}/threads/{thread_id}

Thread resource

Archive a thread

POST /sessions/{id}/threads/{thread_id}/archive

Thread resource, with status terminated

List a thread's events

GET /sessions/{id}/threads/{thread_id}/events

Paginated event list

Stream a thread's events

GET /sessions/{id}/threads/{thread_id}/stream

text/event-stream

Create a memory store

POST /memory_stores

Memory store resource

List memory stores

GET /memory_stores

Paginated memory store summary list

Get a memory store

GET /memory_stores/{id}

Memory store resource

Update a memory store

POST /memory_stores/{id}

Memory store resource

Archive a memory store

POST /memory_stores/{id}/archive

Memory store resource, with archived_at set

Delete a memory store

DELETE /memory_stores/{id}

{"id": "...", "type": "memory_store_deleted"}

Create a memory

POST /memory_stores/{id}/memories

Memory resource

List memories

GET /memory_stores/{id}/memories

Paginated list of memories and folder markers

Get a memory

GET /memory_stores/{id}/memories/{memory_id}

Memory resource

Update a memory

POST /memory_stores/{id}/memories/{memory_id}

Memory resource

Delete a memory

DELETE /memory_stores/{id}/memories/{memory_id}

{"id": "...", "type": "memory_deleted"}

List memory versions

GET /memory_stores/{id}/memory_versions

Paginated memory version list

Get a memory version

GET /memory_stores/{id}/memory_versions/{memory_version_id}

Memory version resource

Redact a memory version

POST /memory_stores/{id}/memory_versions/{memory_version_id}/redact

Memory version resource, with redacted_at set

Get a project's encryption configuration

GET /bedrock/encryption_configuration

Encryption configuration

Set a project's encryption configuration

PUT /bedrock/encryption_configuration

Encryption configuration

Activate a self-hosted tool runner

POST /sessions/{id}/bedrock/attachment

Activation

Tag an agent, memory store, or session

POST /agents/{id}/tags, POST /memory_stores/{id}/tags, POST /sessions/{id}/tags

{}

Untag an agent, memory store, or session

POST /agents/{id}/untag, POST /memory_stores/{id}/untag, POST /sessions/{id}/untag

{}

List an agent's, memory store's, or session's tags

GET /agents/{id}/tags, GET /memory_stores/{id}/tags, GET /sessions/{id}/tags

{"tags": {...}}

Use the IDs returned by the service and treat them, and pagination tokens, as opaque values. IDs carry a type prefix: agent_, sesn_ (session), sthr_ (thread), sevt_ (event), memstore_, mem_, and memver_. A path ID that is not of its type's form is a 400, such as session_id is not a valid session id.

A list returns data and, when more results exist, next_page. Pass that value as the page query parameter of the next request to the same list, with the same filters. A next_page value expires after 24 hours. After that, the list answers 400 invalid or expired page token; restart pagination, so start again from the first page. Timestamps are RFC 3339 in UTC, such as 2026-11-20T17:05:40.318Z. metadata is up to 16 string pairs, stored with the resource and never evaluated by IAM.

Create an agent

An agent is a versioned definition: the model, the system prompt, the tools, skills, and MCP servers, the agents it can call, and the IAM role that its sessions run as. Creating an agent makes version 1. An update that changes the configuration makes a new version.

Request

POST /anthropic/v1/agents HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json

The following body creates an agent that can use the built-in tools:

{ "name": "first-agent", "model": "us.anthropic.claude-sonnet-5-5", "system": "You are a careful assistant. Use bash to answer questions about the machine you run on.", "execution_identity": { "type": "aws_role", "role_arn": "arn:aws:iam::111122223333:role/ClaudeManagedAgentsSessionRole" }, "tools": [{ "type": "agent_toolset_20260401", "default_config": { "permission_policy": { "type": "always_allow" } } }] }

Field

Required

Description

name

Yes

The display name, 1 to 256 characters. It need not be unique.

model

Yes

An Amazon Bedrock inference profile ID that the endpoint offers, such as us.anthropic.claude-sonnet-5-5, or an object with id and optional speed (only standard is accepted) and effort (low, medium, high, xhigh, or max).

execution_identity

Yes, unless role_arn is sent

{"type": "aws_role", "role_arn": "role-arn"}: the IAM role in your account that the agent's sessions run as by default. The service assumes it to call the model, to call AgentCore Gateways, and to start and stop the session's container on your AgentCore Runtime. The role must carry the tag ManagedAgentsExecutionRole with the value enabled, and its trust policy must let bedrock.amazonaws.com assume it. The caller needs iam:PassRole on it.

system

No

The system prompt, up to 100,000 characters.

description

No

A description, up to 2,048 characters.

tools

No

Up to 256 entries. agent_toolset_20260401 turns on the built-in tools (bash, read, write, edit, glob, and grep), which run in the session's tool runner. mcp_toolset names an entry of mcp_servers. custom defines a tool that your application runs. memory_toolset_20261030 gives the agent the memory tools. Each toolset takes a default_config and per-tool configs with enabled and a permission_policy of always_allow, always_ask, or auto. If you set none, the toolset uses auto, and the create response shows {"type": "auto", ...}.

mcp_servers

No

Up to 20 entries of {"type": "aws_agentcore_gateway", "name": "...", "gateway_arn": "..."}. Each needs exactly one mcp_toolset entry in tools with the same name. The service calls the gateway as the session's role, which needs bedrock-agentcore:InvokeGateway on it.

skills

No

Up to 20 folders of skills: sandbox_path entries with a path, or s3_mount entries with s3_uri, region, and mount_path. Skills need the agent's read tool.

multiagent

No

{"type": "coordinator", "agents": [...]}, with 1 to 20 entries, counting {"type": "self"}, that this agent may call. Each runs in its own thread of the same session.

metadata

No

Up to 16 string pairs.

tags

No

The agent's AWS tags. See Tags.

If you don't set a permission policy, the toolset uses auto. To control this yourself, set one. allowed_role_arns and inference_geo are refused.

Creating or updating an agent is also authorized on the model's inference profile, each AgentCore Gateway in mcp_servers, each S3 folder of an s3_mount skill, and each agent in the multiagent list. See the caller's permissions in Security and IAM roles.

Response

The response is the stored agent at version 1. It includes the fields of the request, with every default filled in, and the following fields.

Field

Description

id

The agent ID, such as agent_011CZkZAtmR3yMPDzynEDxu7.

type

agent.

version

The version, starting at 1.

resource_arn

The agent's ARN, such as arn:aws:bedrock:us-west-2:111122223333:project/default/anthropic-agent/agent_011CZkZAtmR3yMPDzynEDxu7.

execution_identity, role_arn

The agent's role, under both names.

created_by

The role that created the agent, as {"type": "role_actor", "role_id": "...", "arn": "..."}.

created_at, updated_at, archived_at

When version 1 was created, when this version was written, and when the agent was archived, or null.

Creating an agent is not idempotent. Each request makes a new agent. If you lose a create's response, list your agents before you send it again.

Create a session

A session is one stateful conversation with one agent. It holds its own copy of the agent's configuration, taken when it is created, names where its built-in tools run, and runs as one IAM role that can't change. Nothing starts yet: on an AgentCore Runtime, the service starts the session's container when you send the first event.

Request

POST /anthropic/v1/sessions HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json

The following body creates a session for that agent on an AgentCore Runtime:

{ "agent": "agent_011CZkZAtmR3yMPDzynEDxu7", "environment_id": "arn:aws:bedrock-agentcore:us-west-2:111122223333:runtime/cma_tool_runner-a1b2c3d4e5", "title": "Investigate the failing build", "metadata": { "ticket": "1234" } }

Field

Required

Description

agent

Yes

An agent ID, which uses the agent's latest version. To pin a version, send {"type": "agent", "id": "agent_...", "version": 2}. To change parts of the agent for this session only, send an agent_with_overrides object. See Overrides.

environment_id

Yes

Where the built-in tools run: an AgentCore Runtime ARN in your account and the endpoint's Region (arn:aws:bedrock-agentcore:region:account:runtime/runtime-id), one of its endpoint ARNs (runtime-arn/runtime-endpoint/name), or the project's self-hosted ID (project-arn/anthropic-self-hosted). Returned as sent.

execution_identity

No

A role to run the session as in place of the agent's role: any role in your account that you may pass. The older role_arn is accepted in its place, but a body can't name both. Naming a role, the agent's or another, needs iam:PassRole on it. A session that inherits its agent's role needs none. The service assumes the role once while it creates the session, so a role that it can't assume fails the create with 400, and nothing is made.

working_directory

No

The absolute path where the tools start. The default is /mnt/workspace.

title

No

A display title, up to 500 characters.

metadata

No

Up to 16 string pairs.

resources

No

Memory stores to attach, folders in your tool runner to tell the agent about, and Amazon S3 folders and files to mount or copy in. See Session resources.

initial_events

No

Up to 50 user.message events to send as the session's first input, so that you need no separate send. When it is not empty, the response shows status running.

tags

No

The session's AWS tags. A session does not take its agent's tags.

vault_ids, budget, agent_id, and outcome events are refused. The caller needs bedrock:CreateAnthropicSession on the new session, the agent and each agent it calls directly, each attached memory store, with the bedrock:AnthropicMemoryStoreAccess condition key set to ReadOnly or ReadWrite for the access that the session asks for, and the parent AgentCore Runtime ARN (also when environment_id names one of its endpoints) or the project's self-hosted ARN.

Overrides

An agent_with_overrides object takes id and optional version, model, system, skills, tools, and mcp_servers. A field that you leave out keeps the agent's value. A field that you send replaces it for this session's copy only. The stored agent does not change. This example changes one session's role, system prompt, and model, and attaches two memory stores. The agent must have the memory toolset enabled.

{ "agent": { "type": "agent_with_overrides", "id": "agent_011CZkZAtmR3yMPDzynEDxu7", "model": "us.anthropic.claude-sonnet-5-5", "system": "Read the reference store and record your work in the journal store." }, "execution_identity": { "type": "aws_role", "role_arn": "arn:aws:iam::111122223333:role/CmaSessionOverrideRole" }, "environment_id": "arn:aws:bedrock-agentcore:us-west-2:111122223333:runtime/cma_tool_runner-a1b2c3d4e5", "resources": [ { "type": "memory_store", "memory_store_id": "memstore_01AbCdEfGhJkLmNoPqRsTuVw", "access": "read_only" }, { "type": "memory_store", "memory_store_id": "memstore_01XyZaBcDeFgHiJkLmNoPqRs", "access": "read_write" } ] }

A model override is also authorized on its inference profile, arn:aws:bedrock:region:account:inference-profile/model-id. Each AgentCore Gateway of an mcp_servers override and each S3 folder of an s3_mount skill override is authorized on its ARN. Administrators can restrict which fields may be overridden with the Bool condition keys bedrock:AnthropicAgentsOverrideModel, bedrock:AnthropicAgentsOverrideSystem, bedrock:AnthropicAgentsOverrideSkills, bedrock:AnthropicAgentsOverrideTools, and bedrock:AnthropicAgentsOverrideMcpServers.

A session update, POST /sessions/{id}, takes title, metadata, and an agent patch with tools, mcp_servers, or both. It can't change the role, the skills, or the agent, and tools and MCP servers can't change while the session is running. A session update is authorized on the session, its agent, and each AgentCore Gateway that the patch names.

Session resources

Each resources entry has a type. Entries are named only at create and can't change later.

Type

Description

memory_store

Attaches a memory store from the same project, by memory_store_id, with access read_write (the default) or read_only, and optional instructions for the model. At most 8. The agent needs the memory toolset with memory_read enabled.

sandbox_path

Tells the agent about a folder or file at path that the tool runner already holds. Nothing is mounted. Optional is_output, description, and instructions.

s3_mount

An S3 folder, s3_uri s3://bucket/folder/, in region, that the tool runner mounts at mount_path each time the session's container starts, with mount_as read_only or read_write.

s3_object

One S3 object, s3_uri s3://bucket/key, in region, that the tool runner copies once to the file at mount_path. Changes to the copy are never written back to S3.

A session can name at most 20 sandbox_path, s3_mount, and s3_object entries in all. S3 entries need an environment_id that names an AgentCore Runtime, and the service refuses them on a self-hosted session. The service authorizes each S3 folder and object on its ARN. The service reports a failure to put an S3 entry in place as a session.error event, not as an error of the create.

Response

The response is the new session resource. It includes:

Field

Description

id

The session ID, such as sesn_011CZkZB4mR3yMPDzynEDxu8.

type

session.

resource_arn

The session's ARN, project-arn/anthropic-session/session-id.

status

idle: waiting for input, including for you to allow a tool call or return a custom tool's result. running: a turn is in progress, including while your tool runner runs a built-in tool call. terminated: ended by an archive or by a failure, and takes no more events.

agent

The session's own copy of its agent, with any override applied. Later changes to the stored agent do not reach it.

environment_id

Where the built-in tools run, as given on create.

execution_identity, role_arn

The role that the session runs as, under both names.

working_directory

Where the tools start.

resources

The entries named on create, each with its own id.

usage

Token counts, working time, and an estimated cost at list price, which is not what your account is billed.

created_by, created_at, updated_at, archived_at

Who created the session, and when it was created, last changed, and archived.

Creating a session is not idempotent. Each request makes a new session. If you lose a create's response, list your sessions before you send it again. To archive a session, which keeps its events, send POST /sessions/{id}/archive. To delete a session and its events, and stop its container on AgentCore Runtime, send DELETE /sessions/{id}. A running session can't be archived or deleted, so interrupt it first. Deleting a session does not delete what its tools wrote outside the service, such as files in your S3 buckets.

Send events

Send events with POST /sessions/{id}/events. The request body holds an events array of 1 to 1,000 events, applied in order. The response, {"data": [...]}, lists the stored form of each event with its new id. It comes back as soon as the events are stored, not when the turn ends. On an AgentCore Runtime, the first send starts the session's container before the events are stored, so it can take several seconds.

POST /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/events HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "events": [{ "type": "user.message", "content": [{ "type": "text", "text": "Summarize the files in the workspace." }] }] }

Event type

Fields

Description

user.message

content (required)

Starts a turn. content is a list of blocks: text, image (base64), and document (base64 PDF or plain text). The 2 MiB request body limit also limits the size of images and documents. The service queues a message that you send while a turn is running, and the agent reads it at its next step.

user.interrupt

session_thread_id (optional)

Stops the current turn. Without session_thread_id, it stops the primary thread and every subagent thread that has not ended. An interrupt does not undo what tools already did.

user.tool_confirmation

tool_use_id, result (required); deny_message (optional)

Allows or denies a tool call that waits for permission. tool_use_id is the ID of the agent.tool_use, agent.mcp_tool_use, or agent.custom_tool_use event. result is allow or deny. deny_message, only with deny, is a message that the agent sees. Send one confirmation per request.

user.custom_tool_result

custom_tool_use_id (required); content, is_error (optional)

Returns the result of a custom tool that the agent called. custom_tool_use_id is the ID of the agent.custom_tool_use event. Set is_error to true when the tool failed, with text content that says why.

A tool whose permission policy is always_ask pauses the session before it runs. The session goes idle with the stop reason requires_action, and stop_reason.event_ids names the tool call events. Answer each one:

{ "events": [{ "type": "user.tool_confirmation", "tool_use_id": "sevt_011CZkZD2sR3yMPDzynEDxuA", "result": "allow" }] }

When the agent calls a custom tool, the session emits agent.custom_tool_use and goes idle with requires_action. Run the tool in your application and send its result:

{ "events": [{ "type": "user.custom_tool_result", "custom_tool_use_id": "sevt_011CZkZE5tR3yMPDzynEDxuB", "content": [{ "type": "text", "text": "Paris" }] }] }

While the session waits on a tool call, it accepts only the answer to that call, or user.interrupt. One request can't mix user.message, tool results, and user.tool_confirmation. You can't send user.tool_result: a built-in tool's result comes from the tool runner. Do not retry a 500 from this operation automatically, because the events may be stored. List the session's events before you send them again.

List and stream events

GET /sessions/{id}/events returns the session's events, oldest first.

GET /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/events?limit=100&types[]=agent.message HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01

Query parameter

Description

limit

Events per page, from 1 to 1,000. Default: 1,000.

order

asc or desc. Default: asc.

page

The next_page value from the previous page. The last page has no next_page.

types[]

Only events of this type. Repeat the parameter, with the brackets, for each type.

created_at[gt], created_at[gte], created_at[lt], created_at[lte]

Only events in a time range, as RFC 3339 times.

GET /sessions/{id}/events/stream keeps the connection open and sends each event as it happens, as server-sent events. Send Accept: text/event-stream, and open the stream before you send a message so that you see the whole turn.

: connected event: message data: {"id":"sevt_011CZkZF8uR3yMPDzynEDxuC","processed_at":"2026-11-20T17:06:02.21Z","type":"session.status_running"} :keepalive

Each event: message block has one JSON event in its data line. Lines that begin with : are comments. Ignore them, as SSE clients do. A quiet stream gets a comment every 15 seconds, so that idle timeouts on the way do not close it. The service closes a stream that has carried no event for 10 minutes, even while a turn runs. In a project on a customer managed key, the service also closes every stream after 15 minutes, at an event boundary, so that the caller's access to the key is checked again. Reconnect to go on. Comments and partial text do not count as events.

The stream sends each event whole. To also see an agent's text as the model writes it, open the stream with event_deltas[]=agent.message. The stream then sends event_start and event_delta frames before the finished event, which still carries the whole text. These frames are best effort: some can be dropped, and they are never stored or listed. event_deltas[]=agent.thinking sends only the event_start frame, never the thinking text.

If the stream drops or is closed, the session goes on. List the events to see what happened while you were away, and reconnect. An error before the stream opens is answered as a JSON error body.

Event types and stop reasons

Every event has id, type, and, once processed, processed_at. Events you sent also carry sent_by. Expect event types that you don't use, and skip them.

Event type or stop reason

Description

agent.message

Text from the agent, in content.

agent.thinking

Marks that the agent reasoned before its next step, for models that reason. The reasoning text isn't shown.

agent.tool_use

A built-in or memory tool call, with name, input, and evaluated_permission (allow, ask, or deny).

user.tool_result

A built-in tool call's result from your tool runner. The service writes one with is_error true when no tool runner takes the call within 120 seconds, or the tool runner is lost.

agent.tool_result

A tool call's result that the service writes itself: every memory tool call's result, and a built-in tool call's result when the call is denied or interrupted. Match a result to its call by tool_use_id.

agent.mcp_tool_use, agent.mcp_tool_result

A call to a tool on an MCP server, and its result.

agent.custom_tool_use

A call to one of your custom tools. Answer it with user.custom_tool_result.

session.status_running

A turn started.

session.status_idle

A turn stopped. The reason is in stop_reason, and a refusal is in stop_details.

session.status_terminated

The session ended. A stream receives it as its last event when the session is archived, and receives session.deleted when the session is deleted.

session.error

Something failed. error has type, message, and retry_status: retrying (the session goes on), exhausted (the turn ends idle with retries_exhausted), or terminal (the session or thread has ended).

span.model_request_end

A model request finished, with its token usage in model_usage.

Stop reason end_turn

The agent finished and waits for the next message.

Stop reason requires_action

The agent called tools that need an answer from you. stop_reason.event_ids lists the tool call events.

Stop reason retries_exhausted

The service retried a failure, such as a model request, or the session's container could not put its S3 folders and files in place, and it gave up. The session still works, and the next event that you send tries again. After compaction_limit_reached_error or tool_use_limit_reached_error, nothing is retried.

When the model refuses to answer, the turn still ends with end_turn. The refusal is in the same event's stop_details, as {"type": "refusal", "category": "...", "explanation": "..."}, which is null on every other turn. An idle session is not proof that the task worked. Check stop_details, then read the tool results and the agent's last message.

Threads

Every session has a primary thread. When a coordinator agent calls a subagent, the call runs in a subagent thread of the same session, with its own tools and the same tool runner. A thread has an id (sthr_...), parent_thread_id (null for the primary thread), agent, status (idle, running, or terminated), and usage.

The thread operations mirror the session's: list threads, get a thread, list a thread's events, and stream a thread's events, which behaves as the session's stream does. A thread's event list takes only limit and page. order, types[], and created_at filters are refused with 400. Archive a subagent thread that you no longer need with POST /sessions/{id}/threads/{thread_id}/archive, because a coordinator starts no new subagent thread while a session holds as many live ones as its limit allows. The primary thread can't be archived, and a running thread must be interrupted first with a user.interrupt that sets session_thread_id.

Memory stores and memories

A memory store holds text documents, called memories, that the service keeps across sessions. An agent with the memory toolset reads and changes the memories of the stores that its session attaches, and your application reads and changes them through the memory operations.

POST /anthropic/v1/memory_stores HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "name": "payments-oncall", "description": "What the payments on-call engineers hand over" }

A create takes name (required, 1 to 255 characters), description (up to 1,024 characters), metadata, and tags. The memory tools show the name and description to the model. The response is the memory store, with id (memstore_...), resource_arn, backend {"type": "managed"}, and created_by. An archived store can still be read. Its memories can't be created or updated, but they can be deleted. Deleting a store deletes its memories.

A memory is a text document at a path in a store, such as /services/billing.md. Create one with POST /memory_stores/{id}/memories:

{ "path": "/escalation.md", "content": "# Payments escalation\n\nPage the payments manager.\n" }

Field

Required

Description

path

Yes

Starts with /, does not end with /, and has no empty, ., or .. segment. At most 1,024 bytes and 20 segments. A memory and a folder of it can't both exist: /a.md and /a.md/b.md conflict.

content

Yes on create

The whole text, up to 102,400 bytes of UTF-8.

precondition

No, on update only

{"type": "content_sha256", "content_sha256": "..."}: applies the update only if the stored content's SHA-256 is the one that you name, the content_sha256 that you last read.

A memory has id (mem_...), path, content (null in the basic view), content_size_bytes, content_sha256, and memory_version_id. The view query parameter selects basic or full. List memories with path_prefix, a folder ending with /, and depth 1 to list one folder's memories and subfolders. An update changes content, path, or both. A delete takes an optional expected_content_sha256 query parameter. On a conflict, the service answers 409 with memory_path_conflict_error or memory_precondition_failed_error. Read the memory again before you retry.

Every write that changes a memory appends a memory version (memver_...), with the whole text, the operation (created, modified, or deleted), and who made it, as a caller or a session actor. List versions with filters such as memory_id, session_id, and operation. Redacting a version, with POST /memory_stores/{id}/memory_versions/{memory_version_id}/redact, empties its text and path and keeps its record. The current version of a memory can't be redacted.

A memory and a memory version have no ARN of their own. Operations on them are authorized on their memory store.

Encryption configuration

The service encrypts the content that it stores at rest with an AWS owned key by default. A project's encryption configuration can name a customer managed AWS KMS key in AWS Key Management Service (AWS KMS) instead, with a key role in your account that the service assumes to use it. Each project has one encryption configuration. Encryption is server side: the service encrypts content before it stores it and decrypts it when an authorized caller reads it.

What the key protects

The service uses envelope encryption: your key encrypts the project's data keys, and the data keys encrypt the content. The service caches decrypted data keys in memory for up to 5 minutes. Your key protects this content in the project:

Resource

What the key encrypts

Agents

Each version's configuration, including the system prompt, tools, MCP servers, and skills.

Sessions

The conversation and its events, including messages, tool inputs, and tool results, and the session's resources entries, such as Amazon S3 folder paths.

Memory stores

The memories and their versions.

Large values, such as long events, are encrypted the same way.

These are not under your key. They include, but are not limited to:

  • Resource metadata that the service needs to find, route, and authorize requests: IDs, ARNs, the account and project, versions, status, timestamps, and the IAM roles that agents and sessions run as or that created a session. The service encrypts these at rest under a key that it owns. Don't put sensitive data in them.

  • Resource tags.

  • Files that tools write. The service does not store them. They stay where the tool runner wrote them, such as your runtime's storage or your Amazon S3 folders, under that storage's own encryption.

  • Telemetry. Where you turn on trace delivery, text that you choose, such as an agent's name or a session's title, can appear on trace spans delivered to Amazon CloudWatch and AWS X-Ray.

Get and set the encryption configuration

Both operations are signed with SigV4, and the anthropic-workspace-id header names the project.

Operation

IAM action

Resource

GET /bedrock/encryption_configuration

bedrock:GetAnthropicEncryptionConfiguration

arn:aws:bedrock:region:account:project/project-id/anthropic-encryption-configuration/default

PUT /bedrock/encryption_configuration

bedrock:PutAnthropicEncryptionConfiguration, and iam:PassRole on the key role

The same configuration ARN

AWS CloudTrail names the resource type AWS::Bedrock::AnthropicEncryptionConfiguration. Set a customer managed key:

PUT /anthropic/v1/bedrock/encryption_configuration HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 anthropic-workspace-id: proj_EXAMPLE Content-Type: application/json
{ "kmsKeyArn": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "roleArn": "arn:aws:iam::111122223333:role/CmaKeyRole" }

Field

Required

Description

kmsKeyArn

Yes

The ARN, not an alias, of a symmetric encryption KMS key in the project's Region. The key can be in another account if its key policy allows the callers and the key role. For a key in another account, the key role and every caller also need IAM policies in the project's account that allow the AWS KMS actions on the key. null selects the AWS owned key.

roleArn

Yes, with a key

The key role, an IAM role in the project's account. See Key role. Not allowed when kmsKeyArn is null.

encryptionConfigurationArn, projectArn

No

Accepted only as the get operation returns them. Another value is refused.

keySwitch

No

Ignored, so you can send back a get response unchanged.

Any other field is refused with 400. Putting the configuration that the project already has changes nothing.

Both operations return the configuration. The put returns it as it is after the change. This response is for a project that is changing from the AWS owned key to a customer managed key:

{ "encryptionConfigurationArn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE/anthropic-encryption-configuration/default", "projectArn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE", "kmsKeyArn": null, "roleArn": null, "keySwitch": { "kmsKeyArn": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "roleArn": "arn:aws:iam::111122223333:role/CmaKeyRole", "status": "IN_PROGRESS" } }

Field

Description

encryptionConfigurationArn

The configuration's ARN, which both IAM actions are evaluated on.

projectArn

The project's ARN.

kmsKeyArn

The key that protects the project's content now, or null for the AWS owned key. While the key is changing, this is still the old key.

roleArn

The key role used with kmsKeyArn, or null for the AWS owned key.

keySwitch

Present only while the project's key is changing to another key. It has kmsKeyArn and roleArn, the key and key role being changed to, each null for the AWS owned key, and status.

keySwitch.status

IN_PROGRESS or FAILED.

keySwitch.failureReason

Present only when status is FAILED: OLD_KEY_REFUSED (AWS KMS or AWS STS refused the old key or its role), NEW_KEY_REFUSED (AWS KMS or AWS STS refused the new key or its role), UNAVAILABLE (a dependency did not answer or throttled), or INTERNAL.

Checks before the configuration is saved

A put is refused before anything is saved if one of these checks fails. The service makes them in this order:

  1. IAM allows bedrock:PutAnthropicEncryptionConfiguration on the configuration's ARN.

  2. The project is not archived.

  3. The body is valid.

  4. When the project is on a customer managed key now, you can use that key, as every content request checks.

  5. For a put that names a key, the key ARN is a key ARN of at most 2,048 characters in the project's Region, and the role is in the project's account, with a name of 1 to 64 characters and a path of at most 512.

  6. For a put that names a key, IAM allows you iam:PassRole on roleArn, with bedrock.amazonaws.com as iam:PassedToService and the configuration's ARN as iam:AssociatedResourceArn.

  7. For a put that names a key, you can use it: kms:DescribeKey as you, to check that it is an enabled symmetric encryption key, then dry runs of kms:Decrypt and kms:GenerateDataKey with the project's ARN in the encryption context.

  8. The project's state allows the change, and the key role can use the key. The service assumes the role and makes, as the role, kms:DescribeKey and dry runs of kms:GenerateDataKeyWithoutPlaintext, kms:ReEncrypt, and kms:Decrypt, each with the project's ARN in the encryption context. For a key change, it also makes dry runs of kms:Encrypt.

A put with kmsKeyArn set to null asks AWS KMS nothing about a new key. The dry runs return no key material.

Key role

The key role is an IAM role in the project's account that the service assumes to create and decrypt the project's data keys, including for work that continues after a request returns, such as a running turn. It has these requirements:

  • Trust policy. Trust the bedrock.amazonaws.com service principal, with aws:SourceAccount set to your account and aws:SourceArn set to the project's ARN. To use one key role for several projects, list each project's ARN in aws:SourceArn.

  • Tag. Tag the role ManagedAgentsKeyRole = enabled.

  • Separate from session roles. Don't tag the key role ManagedAgentsExecutionRole, and don't use it as a session role. Sessions that run as a key role fail.

  • Permissions. The role needs no permissions policy when the key policy allows it kms:DescribeKey, kms:Decrypt, kms:Encrypt, kms:GenerateDataKeyWithoutPlaintext, kms:ReEncryptFrom, and kms:ReEncryptTo.

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": { "Service": "bedrock.amazonaws.com" }, "Action": "sts:AssumeRole", "Condition": { "StringEquals": { "aws:SourceAccount": "111122223333" }, "ArnEquals": { "aws:SourceArn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE" } } }] }

In AWS CloudTrail, the key role's sessions are named ClaudeManagedAgents-key-project-id, and AWS STS records an AssumeRole each time the service assumes the role.

Key policy and caller permissions

Use a symmetric encryption key (key spec SYMMETRIC_DEFAULT, key usage ENCRYPT_DECRYPT) in the project's Region. Add these statements to its key policy, next to your administrator statement. Name every role that calls the service in the project as a caller.

[ { "Sid": "AllowCallersToDescribeTheKeyThroughBedrock", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/AppRole" }, "Action": "kms:DescribeKey", "Resource": "*", "Condition": { "StringEquals": { "kms:ViaService": "bedrock.us-west-2.amazonaws.com", "kms:CallerAccount": "111122223333" } } }, { "Sid": "AllowCallersToUseTheKeyForTheProjectThroughBedrock", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/AppRole" }, "Action": ["kms:Decrypt", "kms:GenerateDataKey"], "Resource": "*", "Condition": { "StringEquals": { "kms:ViaService": "bedrock.us-west-2.amazonaws.com", "kms:CallerAccount": "111122223333", "kms:EncryptionContext:aws:bedrock:arn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE" } } }, { "Sid": "AllowTheKeyRoleToDescribeTheKey", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/CmaKeyRole" }, "Action": "kms:DescribeKey", "Resource": "*" }, { "Sid": "AllowTheKeyRoleToManageTheProjectsDataKeys", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::111122223333:role/CmaKeyRole" }, "Action": [ "kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKeyWithoutPlaintext", "kms:ReEncryptFrom", "kms:ReEncryptTo" ], "Resource": "*", "Condition": { "StringEquals": { "kms:EncryptionContext:aws:bedrock:arn": "arn:aws:bedrock:us-west-2:111122223333:project/proj_EXAMPLE" } } } ]

Every AWS KMS call that the service makes for a project, and every check of a caller's access, includes the project's ARN in the encryption context as aws:bedrock:arn, except kms:DescribeKey, which takes no encryption context. The kms:EncryptionContext:aws:bedrock:arn condition limits a statement to the projects that you name. To allow every project in the account, use StringLike with arn:aws:bedrock:us-west-2:111122223333:project/*. The service makes the caller statements' calls on the caller's behalf, so they use kms:ViaService. The key role makes its calls with its own credentials, so its statements don't.

The principal that sets the configuration needs bedrock:PutAnthropicEncryptionConfiguration, iam:PassRole on the key role with the encryption configuration's ARN as iam:AssociatedResourceArn, and the caller statements of the key policy. Every caller who uses the project's agents, sessions, or memory stores needs the caller statements too. Before each request that reads or writes the project's content, the service makes a kms:Decrypt dry run as the caller, and refuses the request with 403 if the key policy does not allow the caller. Removing one caller's access refuses that caller's next such request and leaves other callers unaffected. An event stream that is already open stays connected until the service closes it for a check, at most 15 minutes later. Deletes, AWS tags, and the encryption configuration operations are authorized by IAM and aren't checked against the key.

If you disable the key or schedule it for deletion, requests in the project are refused with 400 at once. If you change the key policy so that the key role can't use the key, requests are refused within 5 minutes, and if you remove the key role's trust policy or tag, within about 15 minutes. Running turns stop when their cached data key expires. Deletes, tag operations, and the encryption configuration operations keep working. Your content isn't moved to the AWS owned key. When you enable the key again or restore the access, the project's content is readable again. When AWS KMS rotates your key automatically, you don't need to change the encryption configuration.

Changing the key

You can change a project's key at any time. Before the project's first agent, session, or memory store, a put sets the key. After that, a put that names another key changes the project's key: the service re-encrypts the project's data keys under the new key in the background and returns at once, with keySwitch. A key change does not re-encrypt content, and the content stays readable throughout.

  • Keep both keys enabled and usable until a get returns no keySwitch. The old key is also needed to restore a backup taken before the change.

  • In a change between two of your keys, let the new key role use both keys.

  • A change onto a customer managed key needs the key policy to allow the key role kms:Encrypt, which setting a key on a new project doesn't need.

  • If keySwitch.status is FAILED, fix the cause that failureReason names, then put the same configuration again to resume the change.

  • A put that names any other key while a change runs or has failed is refused with 409.

To go back to the AWS owned key, put {"kmsKeyArn": null}. This is also a key change, and the service needs your old key until it finishes.

Encryption configuration errors

Each refusal has the error body described in Errors and retries. In the messages, key-arn is the key's ARN and action is the AWS KMS action that was refused.

HTTP status

Error type

Message and cause

400

invalid_request_error

The body is not valid: the body: a JSON object with kmsKeyArn and roleArn, kmsKeyArn: the project's KMS key's ARN, or null for the service's own key, roleArn: the key role, with kmsKeyArn, roleArn: only with kmsKeyArn, kmsKeyArn: a string or null, roleArn: a string or null, field: not a member of the configuration, encryptionConfigurationArn: this project's, or leave it out, or projectArn: this project's, or leave it out. Also the project is archived.

400

invalid_request_error

the KMS key: a key ARN, not an alias, in this project's Region, the KMS key: a key ARN of at most 2048 characters, as KMS takes, the role: an IAM role in this project's account, or the role: an IAM role whose name is 1 to 64 characters and whose path is at most 512, as IAM allows.

400

invalid_request_error

The role named in this project's encryption configuration can't be assumed or can't use the KMS key. The role does not trust the service for this project, does not have the ManagedAgentsKeyRole tag, or the key policy refuses it one of the operations.

400

invalid_request_error

This project's KMS key is disabled, pending deletion, not found, or not a symmetric encryption key. The key refused the key role's checks.

400

invalid_request_error

the KMS key key-arn is disabled, pending deletion, not found, or not a symmetric encryption key, for the key the put names. this project's KMS key key-arn is disabled, pending deletion, not found, or otherwise not in a state that allows kms:Decrypt, for the key the project uses now. KMS doesn't accept key-arn as a KMS key ARN; name a symmetric encryption key by its key ARN, when AWS KMS does not accept the ARN.

403

permission_error

IAM refused bedrock:PutAnthropicEncryptionConfiguration or iam:PassRole.

403

permission_error

your credentials don't allow action on the KMS key key-arn. Whoever uses a project on a customer managed key needs kms:DescribeKey on it, and kms:Decrypt and kms:GenerateDataKey with the project's encryption context, for the key the put names. this project's content is encrypted with the KMS key key-arn, and your credentials don't allow kms:Decrypt on it, for the key the project uses now.

409

invalid_request_error

the project's key is switching to another key; wait for it to finish, or put that key again. the project's key is being set up; try again in a few minutes, while the project's first create makes its key. the project's encryption configuration changed; read it and try again, when another put was saved first. the project's encryption configuration can't be changed. Get the configuration before you retry.

503

api_error

the KMS key couldn't be checked; retry, the project's KMS key couldn't be checked; retry, or the project's encryption configuration is unavailable; retry. Retry with backoff.

Self-hosted tool runner attachment

A session whose environment_id is the project's self-hosted ID runs its tools on a machine that you start the tool runner on. The tool runner connects out to the service and listens on no port. After you create the session, attach a tool runner to it:

POST /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/bedrock/attachment HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "workspace_directory": "/workspace" }

The body can be empty. workspace_directory is the absolute path where the file tools work and bash starts. The response is an activation, which you pass to the tool runner on its standard input. It includes session_id, environment_id, endpoint, region, service (bedrock), workspace, attachment_generation, and attachment_token. The attachment_token is shown only in this response, so keep it where the model's commands can't read it.

Each call attaches a new tool runner and makes any earlier activation stale: the earlier tool runner gets no more tool calls. Call it again to replace a tool runner, for example one whose credentials expired. Start one tool runner per activation. The caller needs bedrock:CreateAnthropicSessionAttachment on the session. The tool runner signs its connection with a role that needs only bedrock:CreateAnthropicSessionConnection on the session. A session on an AgentCore Runtime takes no attachment, because the service activates that tool runner itself.

Tags

Agents, memory stores, and sessions take AWS tags. IAM evaluates a resource's tags as aws:ResourceTag/key on the actions on it. Set tags on a create with a top-level tags object, or later with the tag operations.

POST /anthropic/v1/sessions/sesn_011CZkZB4mR3yMPDzynEDxu8/tags HTTP/1.1 Host: bedrock.us-west-2.amazonaws.com anthropic-version: 2023-06-01 anthropic-beta: managed-agents-2026-04-01 Content-Type: application/json
{ "tags": { "team": "blue" } }

To remove tags, send POST /type/{id}/untag with {"tag_keys": ["team"]}. To read them, send GET /type/{id}/tags, which returns {"tags": {...}}. A key is 1 to 128 characters and a value at most 256. A request sets at most 200 tags, and a resource has at most 50. A key that begins with aws: is reserved. Two keys that differ only in letter case are refused.

The tag operations use the shared actions bedrock:TagResource, bedrock:UntagResource, and bedrock:ListTagsForResource, which bedrock:*Anthropic* does not grant. A create that sets tags also needs bedrock:TagResource on the new resource. Tags are not metadata: a get or a list never returns them. A session does not take its agent's tags. A change to a resource's tags can take up to 15 minutes to affect IAM decisions.

Use Anthropic's SDKs

Anthropic's SDKs support this API on Amazon Bedrock. To see the languages and get the SDKs, see SDKs, CLI, and libraries in Anthropic's documentation. The SDKs send requests to the Region's base URL, sign them with SigV4 with the signing name bedrock, and send the required headers for you. If you set a base URL, end it with /anthropic, because the SDK adds /v1/... to it. Leave AWS_BEARER_TOKEN_BEDROCK unset, so that the SDK signs with your IAM role credentials. The SDKs retry some failures by themselves, so read Retries before you use one for creates and event sends.

Errors and retries

Errors use Anthropic's error body, except a 413:

{ "type": "error", "error": { "type": "invalid_request_error", "message": "..." }, "request_id": "req_011CZkZ9X2dpNyB7HsEFoRfW" }

HTTP status

What to check

400

The message names the field. kind_id is not a valid kind id means that the ID in the path is not one that the service issues. Also check for a role that the service can't assume, an environment_id that is not a runtime in your account and Region, or a runtime that the session role can't invoke. the project is archived means that the project in anthropic-workspace-id was archived: you can still get, list, and archive its agents, sessions, and memory stores, list agent versions, delete its sessions and memory stores, redact memory versions, list and remove tags, and get the encryption configuration, but not create or otherwise change anything, read or send events, or read memories.

401

The signature: credentials, Region, service name bedrock, and the session token.

403

The caller's IAM permissions, including iam:PassRole on agent create, agent role change, a session create that names a role, or a put of the encryption configuration. In a project on a customer managed key, the key policy, which must allow the caller kms:Decrypt. A request signed by an IAM user or the root user. An agent execution role in another account.

404

The ID, the project in anthropic-workspace-id, and anthropic-beta. the project does not exist means that the project in anthropic-workspace-id does not exist.

409

On a memory, memory_path_conflict_error or memory_precondition_failed_error: another memory has the path, or the memory changed since you read it. Read it again before you retry. On a put of the encryption configuration, the project's key is changing, is being set up, or changed while the request ran; see Encryption configuration errors. Otherwise the request was not applied, and the message says whether to send it again.

413

The body is over 2 MiB. This response is plain text, not the error body.

429 or 529

Too many requests, or the service is overloaded. Retry with backoff.

500 or 503

Service or dependency failure. See the retry guidance that follows.

A 403 or 404 on a resource says nothing about whether it exists in another account or project. Capture the error details and the x-amzn-requestid value when troubleshooting.

Follow these rules when you retry:

  • Retry reads with exponential backoff and jitter.

  • An error with x-should-retry: true changed nothing. Retry it after retry-after-ms, or with backoff if it has none. x-should-retry: false means do not retry it as it is.

  • A 503, a 529, and a 500 with the message overloaded, shedding load changed nothing. Retry them.

  • Do not retry a 500 from POST /sessions/{id}/events automatically. The events may be stored. List the session's events before you send them again.

  • Do not retry a create whose response you lost. Creates are not idempotent, so list agents or sessions first.

  • Anthropic's SDKs retry 5xx, 408, 409, and 429 responses, and dropped connections, on their own. Turn their retries off for creates and sends, or check before you resend.