List a drain's batches
The drain's delivery log, newest first: one batch per request, with every HTTP attempt. A failing batch is retried with backoff for about a day (10 attempts); if every attempt fails, the drain is disabled. Pass the last id as after to get the next page while has_more is true.
bearerAuthAuthorizationBearer <token>A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.
id*stringThe log drain's id.
status?stringOnly batches with this status.
"pending""succeeded""failed"limit?integer1-100, default 50.
1 <= value <= 100after?stringCursor: the id of the last batch of the previous page.
Coss-Version?"2026-10-10"The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.
"2026-10-10"A page of batches.
application/json- response
- response
- …
object*"list""list"data*array<>has_more*booleanimport { Coss } from "coss";const coss = new Coss({ apiKey: process.env.COSS_API_KEY, baseUrl: "https://api.coss.com",});const { data, error } = await coss.logDrains.batches.list("drain_01k7c8m4q2f3e9v6t5r1n0p8yz");{ "object": "list", "data": [ { "object": "log_drain_batch", "id": "drainbat_01k7c8n2b5d7f9h1k3m5p7r9tv", "drain_id": "drain_01k7c8m4q2f3e9v6t5r1n0p8yz", "status": "succeeded", "line_count": 42, "byte_size": 31870, "attempt_count": 1, "next_attempt_at": null, "last_status_code": 200, "last_error": null, "attempts": [ { "object": "log_drain_attempt", "id": "drainatt_01k7c8n2c9e1g3j5l7n9q1s3uw", "attempted_at": "2026-01-15T09:30:01.000Z", "status_code": 200, "duration_ms": 182, "error": null, "response_excerpt": "ok" } ], "created_at": "2026-01-15T09:30:00.000Z", "updated_at": "2026-01-15T09:30:01.000Z" } ], "has_more": false}