Log drains

Create Log Drain

Changed on
post/log-drains

Request

  • Base URL
    https://api.hedra.com/v3
  • Auth
    • API key in header Authorization
    • or HTTP bearer

Request body

namestring required

Human-readable label.

urlstring required

HTTPS endpoint job-log batches are posted to.

format'ndjson' | 'otlp'

Wire encoding for one log drain endpoint's HTTP posts.

secretstring password nullable

Signs every NDJSON post. Required when format is ndjson (the default); optional for otlp drains, whose receivers authenticate with headers instead.

headersobject nullable

Extra headers sent with every post — typically the receiver's authentication. Stored values are never echoed back; reads expose header_names only.

enabledboolean

Whether the drain receives batches.

batch_sizeinteger

Maximum log lines per post.

Response

Successful Response

idstring required

The drain's id (drain_<uuid>).

namestring required

Human-readable label.

urlstring required

The destination endpoint.

format'ndjson' | 'otlp' required

Wire encoding for one log drain endpoint's HTTP posts.

header_namesstring[]

Names of the configured extra headers. Values are write-only and never echoed back.

enabledboolean required

Whether the drain receives batches.

batch_sizeinteger required

Maximum log lines per post.

consecutive_failuresinteger required

Failed batches since the last success; the drain auto-disables when it crosses the failure threshold.

last_success_atstring date-time nullable

ISO-8601 instant of the last delivered batch.

last_failure_atstring date-time nullable

ISO-8601 instant of the last failed batch.

last_failure_statusinteger nullable

HTTP status of the last failed batch; null when it never got a response.

disabled_reasonstring nullable

Why the drain is off (consecutive_failures for auto-disable, disabled_by_user); null while enabled.

created_atstring date-time required

ISO-8601 instant the drain was created.

updated_atstring date-time required

ISO-8601 instant the config last changed.

updated_by_key_idstring nullable

The API key that last changed the config.

Changes