COSS
Log drains

Retrieve a batch

GET
/v1/log_drains/{id}/batches/{batch_id}

One batch of the drain, with every HTTP attempt.

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.

batch_id*string

The batch's id.

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

The batch.

application/json
  1. response
object*"log_drain_batch"
Value in"log_drain_batch"
id*string

The batch's id: the webhook-id header, the same on every attempt.

drain_id*string
status*LogDrainBatchStatus

pending: waiting for its next attempt. succeeded: the drain answered with a 2xx status. failed: every attempt failed, or the drain was disabled.

Value in"pending""succeeded""failed"
line_count*integer

Lines in the batch (one per NDJSON line).

byte_size*integer

Size of the request body in bytes.

attempt_count*integer
next_attempt_at*|

When the next attempt is due; null once the batch is finished.

Formatdate-time
last_status_code*integer|null
last_error*string|null
attempts*array<>

Every HTTP attempt of this batch, oldest first.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
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.get("drain_01k7c8m4q2f3e9v6t5r1n0p8yz", "drainbat_01k7c8n2b5d7f9h1k3m5p7r9tv");
{  "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"}