Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

session-operations changedmanaged-agents/session-operations

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+6added
Lines−31removed
From line 278 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits17to this page, all time

The whole hunk

from line 278, old and new numbered
/
lines
from line 278
278278 
279279<CodeGroup>
280280 ```bash cURL
281 first_page=$(curl -sS --fail-with-body \
281 curl -sS --fail-with-body \
282282 "https://api.anthropic.com/v1/sessions?agent_id=$AGENT_ID&limit=1" \
283283 -H "x-api-key: $ANTHROPIC_API_KEY" \
284284 -H "anthropic-version: 2023-06-01" \
285 -H "anthropic-beta: managed-agents-2026-04-01")
286 jq '{prev_page, next_page}' <<< "$first_page" # prev_page is null on the first page
287 
288 next_cursor=$(jq -r '.next_page' <<< "$first_page")
289 second_page=$(curl -sS --fail-with-body \
290 "https://api.anthropic.com/v1/sessions?agent_id=$AGENT_ID&limit=1&page=$next_cursor" \
291 -H "x-api-key: $ANTHROPIC_API_KEY" \
292 -H "anthropic-version: 2023-06-01" \
293 -H "anthropic-beta: managed-agents-2026-04-01")
294 
295 prev_cursor=$(jq -r '.prev_page' <<< "$second_page")
296 curl -sS --fail-with-body \
297 "https://api.anthropic.com/v1/sessions?agent_id=$AGENT_ID&limit=1&page=$prev_cursor" \
298 -H "x-api-key: $ANTHROPIC_API_KEY" \
299 -H "anthropic-version: 2023-06-01" \
300 -H "anthropic-beta: managed-agents-2026-04-01" \
301 | jq '{prev_page, next_page}'
285 -H "anthropic-beta: managed-agents-2026-04-01"
286 # Pass next_page back as the page query parameter to fetch the next page,
287 # or prev_page to go back.
302288 ```
303289 
304290 ```bash CLI
305291 # --format raw returns one page envelope with its prev_page and next_page
306292 # cursors; the default output auto-paginates and emits only the sessions.
307 cursors=$(ant beta:sessions list \
308 --agent-id "$AGENT_ID" \
309 --limit 1 \
310 --format raw \
311 --transform '{prev_page,next_page}')
312 printf '%s\n' "$cursors"
313 
314 # Pass the next_page cursor back as --page to fetch the next page.
315 NEXT_PAGE=$(jq -r '.next_page' <<< "$cursors")
316293 ant beta:sessions list \
317294 --agent-id "$AGENT_ID" \
318295 --limit 1 \
319 --page "$NEXT_PAGE" \
320 --format raw \
321 --transform '{prev_page,next_page}'
322 # Pass that response's prev_page as --page to go back the same way.
296 --format raw
297 # Pass next_page back as --page to fetch the next page, or prev_page to go back.
323298 ```
324299 
325300 ```python Python
Feedback