List batches
List batches visible to the caller.
page_size defaults to 24, clamped to 1–100. ?search= matches the batch name.
Optional ?thread_id= restricts the list to batches that chat may attach — same scope as POST /api/v2/chats/{thread_id}/batch-attachments/.Authorizations
Organisation API key from Settings → API / /api/keys/. The secret is
shown once. Send Authorization: Bearer sk-abacus-…. One active key
per organisation. Ingest (/api/v2/ingest/*) refuses API keys — that
surface is Auth0-only with ingest:read / ingest:write scopes.
Query Parameters
1-indexed page number. Defaults to 1.
Rows per page. Defaults to 24; clamped to [1, 100].
Case-insensitive substring match against Batch.name. Trimmed and truncated to 100 characters.
Optional chat thread id. Visibility always resolves against the caller's own organization; supplying a thread the caller does not own in it returns an empty page instead of the full list, matching the scope of POST /api/v2/chats/<thread_id>/batch-attachments/. Use from the chat picker modal so the offered batches match what the attach endpoint will accept.
Response
Top-level response shape for GET /api/v2/batches/.
Page-based pagination (mirrors batch_library_documents so the JS
can reuse the same paging widget). has_more is server-computed to
avoid the SPA inferring it from page * page_size < total (which
would be wrong for a partial last page).

