COSS
Log drains

List a drain's batches

GET
/v1/log_drains/{id}/batches

The drain's delivery log, newest first: one batch per NDJSON 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.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Path Parameters

id*string

The log drain's id.

Query Parameters

status?string

Only batches with this status.

Value in"pending""succeeded""failed"
limit?integer

1-100, default 50.

Range1 <= value <= 100
after?string

Cursor: the id of the last batch of the previous page.

Header Parameters

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.

Value in"2026-10-10"

Response Body

A page of batches.

application/json
  1. response
object*"list"
Value in"list"
data*array<>
has_more*boolean
import { 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}