Operations 25
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“How do I archive an agent session I no longer need so it drops out of my default list?”
“Can I archive a Claude session through the beta sessions endpoint instead of deleting it?”
Tell an agent
Archive session {session_id} using the beta flag.
Move beta session {session_id} into the archive but keep its history.
GET
/v1/sessions/{session_id}/events/stream?beta=true
Stream a session's events live · Stream Events
#
Ask an LLM
“How can I watch a running agent session's events as they happen?”
“Can the session event stream include partial deltas while the agent is still typing?”
Tell an agent
Open a live event stream for session {session_id}.
Stream events from session {session_id} including {event_deltas} deltas.
Ask an LLM
“Where can I page through the full event history of an agent session?”
“Can I filter a session's recorded events by type or by when they were created?”
Tell an agent
List the recorded events of session {session_id}.
Show only {types} events from session {session_id} created after {since}.
Ask an LLM
“How do I post a user message into an agent session with the beta sessions API?”
“Can I push several events to a session in a single request?”
Tell an agent
Send events {events} to beta session {session_id}.
Post a batch of user events {events} into session {session_id} via the beta flag.
GET
/v1/sessions/{session_id}/resources/{resource_id}?beta=true
Get a resource attached to a session · Get Session Resource
#
Ask an LLM
“How do I look up one resource that's mounted on an agent session?”
“What details can I see for a specific session resource?”
Tell an agent
Get resource {resource_id} on session {session_id}.
Show me the details of session {session_id} resource {resource_id}.
DELETE
/v1/sessions/{session_id}/resources/{resource_id}?beta=true
Remove a resource from a session · Delete Session Resource
#
Ask an LLM
“What is the way to detach a resource from an agent session?”
“Can I delete one mounted resource without deleting the whole session?”
Tell an agent destructive · confirm first
Delete resource {resource_id} from session {session_id}.
Detach session {session_id} resource {resource_id} permanently.
POST
/v1/sessions/{session_id}/resources/{resource_id}?beta=true
Refresh a session resource's access token · Update Session Resource
#
Ask an LLM
“Need to rotate the authorization token on a resource already attached to a session?”
“Can I give a session resource a new access token without removing it?”
Tell an agent
Update resource {resource_id} on session {session_id} with token {authorization_token}.
Swap in a fresh authorization token {authorization_token} for session {session_id} resource {resource_id}.
GET
/v1/sessions/{session_id}/resources?beta=true
List resources attached to a session · List Session Resources
#
Ask an LLM
“Which resources are currently mounted on my agent session?”
“Can I page through a session's resources a few at a time?”
Tell an agent
List all resources on session {session_id}.
Show the first {limit} resources attached to session {session_id}.
POST
/v1/sessions/{session_id}/resources?beta=true
Attach a new resource to a session · Add Session Resource
#
Ask an LLM
“How do I mount an additional resource onto a session that's already running?”
“Can I add a resource to an agent session after I've created it?”
Tell an agent
Add a new resource to session {session_id}.
Attach another resource onto existing session {session_id}.
POST
/v1/sessions/{session_id}/threads/{thread_id}/archive?beta=true
Archive a thread within a session · Archive Session Thread
#
Ask an LLM
“How do I archive a single thread inside an agent session?”
“Can I put away one conversation thread while keeping the rest of the session active?”
Tell an agent
Archive thread {thread_id} in session {session_id}.
Mark session {session_id} thread {thread_id} as archived.
GET
/v1/sessions/{session_id}/threads/{thread_id}/events?beta=true
List events recorded in a session thread · List Session Thread Events
#
Ask an LLM
“Where do I read back the event history for one thread of a session?”
“Can I page through a single thread's events rather than the whole session's?”
Tell an agent
List the events in thread {thread_id} of session {session_id}.
Page through {limit} past events at a time from session {session_id} thread {thread_id}.
GET
/v1/sessions/{session_id}/threads/{thread_id}/stream?beta=true
Stream live events from a session thread · Stream Session Thread Events
#
Ask an LLM
“How can I follow just one thread of an agent session in real time?”
“Can a thread's live stream include incremental deltas?”
Tell an agent
Stream thread {thread_id} of session {session_id} live.
Follow session {session_id} thread {thread_id} as it runs with {event_deltas} deltas turned on.
GET
/v1/sessions/{session_id}/threads/{thread_id}?beta=true
Get one thread of a session · Get Session Thread
#
Ask an LLM
“Can I fetch the details of a specific thread in a session?”
“What does a single session thread record look like?”
Tell an agent
Get thread {thread_id} from session {session_id}.
Look up the thread record {thread_id} under session {session_id}.
GET
/v1/sessions/{session_id}/threads?beta=true
List the threads in a session · List Session Threads
#
Ask an LLM
“Which threads exist inside my agent session?”
“Can I page through a session's threads in chunks?”
Tell an agent
List every thread in session {session_id}.
Show {limit} threads per page for session {session_id}.
Ask an LLM
“How do I check the status and settings of one agent session using the beta endpoint?”
“What does the beta sessions API return for a single session?”
Tell an agent
Get beta session {session_id}.
Fetch session {session_id} with the beta query flag set.
POST
/v1/sessions/{session_id}?beta=true
Update a session's title, vaults or budget · Update Session
#
Ask an LLM
“How do I rename an agent session or change its metadata?”
“Can I change which vaults or budget a session uses after it starts?”
Tell an agent
Rename session {session_id} to {title}.
Set the budget of session {session_id} to {budget}.
DELETE
/v1/sessions/{session_id}?beta=true
Delete an agent session via the beta flag · Delete Session
#
Ask an LLM
“How do I permanently delete an agent session with the beta sessions API?”
“Can I remove a session entirely rather than archiving it, using the beta endpoint?”
Tell an agent destructive · confirm first
Delete beta session {session_id} permanently.
Remove session {session_id} for good through the beta flag.
Ask an LLM
“How do I start a new agent session in an environment with the beta API?”
“Can I seed a new session with initial events and a spending budget?”
Tell an agent
Start a beta session for agent {agent} in environment {environment_id}.
Create session {title} running agent {agent} in environment {environment_id} with budget {budget}.
Ask an LLM
“Which agent sessions are running for a given agent or deployment?”
“Can I include archived sessions or filter sessions by status and creation date?”
Tell an agent
List sessions for agent {agent_id} with status {statuses}.
Show sessions started by deployment {deployment_id}, archived ones included {include_archived}.
Ask an LLM
“How do I create a stateful agent execution instance without the beta query flag?”
“Can I pass vault IDs when creating a session on the plain /v1/sessions endpoint?”
Tell an agent
On the plain endpoint, create a stateful execution for agent {agent} in environment {environment_id}.
Without the beta flag, spin up agent {agent} in {environment_id} using vaults {vault_ids}.
Ask an LLM
“How do I list sessions by agent and status on the /v1/sessions endpoint without the beta query flag?”
“Can the non-beta-flag session listing filter by a single status?”
Tell an agent
Using the plain sessions endpoint, list sessions for agent {agent_id}.
On the endpoint without the beta query flag, list sessions whose status is {status}.
GET
/v1/sessions/{session_id}
Get a session on the plain sessions endpoint · Anthropic Get Session
#
Ask an LLM
“How do I read one session from /v1/sessions without adding the beta query flag?”
“What's the non-beta-flag way to look up a session by its ID?”
Tell an agent
Look up session {session_id} on the plain endpoint.
Retrieve session {session_id} without the beta query parameter.
Ask an LLM
“How do I change the tools or MCP servers a session uses?”
“Can I reconfigure a session's config on the plain endpoint without the beta flag?”
Tell an agent
Update the tools and MCP servers configured on session {session_id}.
Reconfigure session {session_id} through the plain endpoint.
DELETE
/v1/sessions/{session_id}
Delete a session on the plain sessions endpoint · Anthropic Delete Session
#
Ask an LLM
“How do I delete a session on /v1/sessions without the beta query flag?”
“Is deleting a session on the plain endpoint permanent?”
Tell an agent destructive · confirm first
Delete session {session_id} using the plain endpoint.
Without the beta parameter, permanently erase session {session_id}.
POST
/v1/sessions/{session_id}/archive
Archive a session on the plain endpoint · Anthropic Archive Session
#
Ask an LLM
“How do I archive a session on the endpoint that doesn't take the beta query flag?”
“Can I archive a session through the plain /archive path?”
Tell an agent
Archive session {session_id} on the plain endpoint.
Without the beta parameter, set session {session_id} to archived.
Documentation
Documentation
https://docs.anthropic.com/en/api/admin-api/users/get-user
Documentation
https://docs.anthropic.com/en/api/prompt-tools-generate
Documentation
https://docs.anthropic.com/en/api/usage-cost-api
Documentation
https://platform.claude.com/docs/en/managed-agents/overview
Documentation
https://platform.claude.com/docs/en/managed-agents/agent-setup
Documentation
https://platform.claude.com/docs/en/managed-agents/sessions
Documentation
https://platform.claude.com/docs/en/managed-agents/environments
Specifications
Schemas & Data
JSONSchema
https://artifacts.apis.io/anthropic/json-schema/anthropic-beta-managed-agents-session-schema.json
JSONSchema
https://artifacts.apis.io/anthropic/json-schema/anthropic-beta-managed-agents-stream-session-thread-events-schema.json
JSONSchema
https://artifacts.apis.io/anthropic/json-schema/anthropic-beta-managed-agents-stream-session-events-schema.json
JSONSchema
https://artifacts.apis.io/anthropic/json-schema/anthropic-beta-managed-agents-session-thread-schema.json
JSONSchema
https://artifacts.apis.io/anthropic/json-schema/anthropic-beta-managed-agents-list-session-threads-schema.json
JSONSchema
https://artifacts.apis.io/anthropic/json-schema/anthropic-beta-managed-agents-update-session-params-schema.json