session-threads changedmanaged-agents/session-threads
Nearest release: v2.1.304, published under an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+8added
Lines−30removed
From line
117
where the diff opens
First seen
9 Oct 2026
this site's first read of the page
Recorded edits11to this page, all time
The whole hunk
from line 117, old and new numbered
/
from line 117
117117 -H "anthropic-version: 2023-06-01" \
118118 -H "anthropic-beta: managed-agents-2026-04-01" \
119119 -H "content-type: application/json" \
120 -d "{\"events\": [{\"type\": \"user.interrupt\", \"session_thread_id\": \"$THREAD_ID\"}]}"
120 -d '{"events": [{"type": "user.interrupt", "session_thread_id": "'"$THREAD_ID"'"}]}'
121121 ```
122122
123123 ```bash CLI
from line 271
271271 -H "anthropic-version: 2023-06-01" \
272272 -H "anthropic-beta: managed-agents-2026-04-01" \
273273 -H "content-type: application/json" \
274 -d "{\"events\": [{\"type\": \"user.interrupt\", \"session_thread_id\": \"$THREAD_ID\"}]}"
274 -d '{"events": [{"type": "user.interrupt", "session_thread_id": "'"$THREAD_ID"'"}]}'
275275
276276 curl -fsS -X POST "https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/archive" \
277277 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 421
421421 curl -fsSN "https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/stream?beta=true" \
422422 -H "x-api-key: $ANTHROPIC_API_KEY" \
423423 -H "anthropic-version: 2023-06-01" \
424 -H "anthropic-beta: managed-agents-2026-04-01" |
425 while IFS= read -r line; do
426 [[ $line == data:* ]] || continue
427 json=${line#data: }
428 case $(jq -r '.type' <<<"$json") in
429 agent.message)
430 printf '%s' "$(jq -j '.content[] | select(.type == "text") | .text' <<<"$json")"
431 ;;
432 session.thread_status_idle)
433 break
434 ;;
435 esac
436 done
424 -H "anthropic-beta: managed-agents-2026-04-01"
437425 ```
438426
439427 ```bash CLI
from line 575
587575 curl -fsS "https://api.anthropic.com/v1/sessions/$SESSION_ID/threads/$THREAD_ID/events" \
588576 -H "x-api-key: $ANTHROPIC_API_KEY" \
589577 -H "anthropic-version: 2023-06-01" \
590 -H "anthropic-beta: managed-agents-2026-04-01" \
591 | jq -r '.data[] | "[\(.type)] \(.processed_at)"'
578 -H "anthropic-beta: managed-agents-2026-04-01"
592579 ```
593580
594581 ```bash CLI
from line 682
695682
696683The following example goes inside the event loop of the [tool confirmation handler](https://platform.claude.com/docs/en/managed-agents/events-and-streaming#tool-confirmation). For each ID in `stop_reason.event_ids`, it sends a `user.tool_confirmation` that allows the call. The same pattern applies to `user.custom_tool_result`, which you can also send as soon as its `agent.custom_tool_use` event arrives.
697684
698<CodeGroup exclude="shell:CLI">
699 ```bash cURL
700 while IFS= read -r event_id; do
701 jq -n --arg id "$event_id" \
702 '{events: [{type: "user.tool_confirmation", tool_use_id: $id, result: "allow"}]}' |
703 curl -fsS "https://api.anthropic.com/v1/sessions/$SESSION_ID/events?beta=true" \
704 -H "x-api-key: $ANTHROPIC_API_KEY" \
705 -H "anthropic-version: 2023-06-01" \
706 -H "anthropic-beta: managed-agents-2026-04-01" \
707 -H "content-type: application/json" \
708 -d @-
709 done < <(jq -r '.stop_reason.event_ids[]' <<<"$data")
710 ```
685<CodeGroup exclude="shell:cURL, shell:CLI">
686 <CodeGroupItem language="cURL">
687 This workflow needs more logic than a single shell command. Use the [Claude SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) to run it.
688 </CodeGroupItem>
711689
712690 <CodeGroupItem language="CLI">
713691 This workflow needs more logic than a single shell command. Use the [Claude SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) to run it.
No line in this hunk matches that.