COSS
Logs

Retrieve a log line

GET
/v1/logs/{id}

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 line'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 log line.

application/json
  1. response
object*"log"
Value in"log"
id*string
occurred_at*string
Formatdate-time
source*LogSource

api: a request to the API. email: an email event. webhook: a delivery attempt.

Value in"api""email""webhook"
level*LogLevel

error: 5xx responses, bounces, complaints, failures. warning: 4xx responses, delays, suppressions, failed webhook attempts that will be retried. info: everything else.

Value in"info""warning""error"
type*string

api.request, webhook.attempt, or an email event type such as email.delivered.

message*string

A one-line summary.

request_id*|

The X-Request-Id of the API request this line belongs to.

api_key_id*string|null
method*string|null
path*string|null
route*|

The matched route, e.g. /v1/emails/:id.

status_code*|

The API response status, or the webhook endpoint's response status.

duration_ms*integer|null
client_ip*string|null
user_agent*string|null
error_code*string|null
resource_type*|

What the line is about: email, domain, webhook_endpoint…

resource_id*string|null
recipient*string|null
attributes*

Details: redacted request and response bodies for API requests (secrets, attachment contents and long strings are never stored), event data for emails and webhooks.

import { Coss } from "coss";const coss = new Coss({  apiKey: process.env.COSS_API_KEY,  baseUrl: "https://api.coss.com",});const { data, error } = await coss.logs.get("log_01k7c8m4q2f3e9v6t5r1n0p8yz");
{  "object": "log",  "id": "log_01k7c8m4q2f3e9v6t5r1n0p8yz",  "occurred_at": "2026-01-15T09:30:00.000Z",  "source": "api",  "level": "info",  "type": "api.request",  "message": "POST /v1/emails 202",  "request_id": "req_01k7c8m4q2f3e9v6t5r1n0p8yz",  "api_key_id": "key_01k7c8m4q2f3e9v6t5r1n0p8yz",  "method": "POST",  "path": "/v1/emails",  "route": "/v1/emails",  "status_code": 202,  "duration_ms": 48,  "client_ip": "203.0.113.7",  "user_agent": "coss-node/0.1.0",  "error_code": null,  "resource_type": "email",  "resource_id": "email_01k7c8m4q2f3e9v6t5r1n0p8yz",  "recipient": null,  "attributes": {    "request": {      "body": {        "from": "hello@example.com",        "to": [          "user@example.com"        ],        "subject": "Hi"      }    },    "response": {      "body": {        "object": "email",        "id": "email_01k7c8m4q2f3e9v6t5r1n0p8yz"      }    }  }}