Ingest
Log ingest API
The endpoint a log source posts to. It is deliberately undemanding: one header, a JSON array, done.
POST https://api.watchtower15.com/api/log-sources/ingestAuthorization: Bearer wt15ls_…Content-Type: application/jsonThe source’s page in the dashboard shows this URL. Behind a firewall that allows
outbound traffic by IP address, allow 3.11.48.155, 18.171.1.44 and
18.135.154.177 on port 443: those addresses serve api.watchtower15.com only. See the Restricted egress tab under
Install for the list and when it changes.
Official SDKs build, retry and batch these calls for you: see SDKs.
Generating your own client? This API’s contract is an OpenAPI document, ingest.json,
with every form, answer and limit on this page. It is written from the code, so it is the same as the page.
Request
Section titled “Request”The body may be any of the following — the format is detected from the content,
not from Content-Type:
| Form | Example |
|---|---|
| JSON array | [{"message":"a"},{"message":"b"}] |
| Envelope | {"lines":[{"message":"a"}]} |
| Single object | {"message":"a"} |
| NDJSON | one JSON object per line |
| gzip | any of the above, gzipped |
Fields
Section titled “Fields”| Field | Required | Notes |
|---|---|---|
message |
yes | The log line. A line without one is skipped. |
logged_at |
no | RFC 3339 (2026-10-06T14:03:22.481+01:00) or a Unix epoch in seconds or milliseconds, as a number or a string. A time without a timezone is read as UTC, and fractions of a second are kept. A missing or unreadable time is the time the line was received. Timestamps more than 5 minutes in the future are clamped to now. |
log_level |
no | One of debug, info, notice, warning, error, critical, alert, emergency. Anything else is dropped rather than stored. |
stream_name |
no | The stream this line belongs to. Defaults to the source’s slug. |
raw_line |
no | The original unparsed line, if you have one. |
log_source is accepted as an alias for stream_name, so an agent-shaped payload
works unchanged.
Response
Section titled “Response”{ "status": "success", "data": { "accepted": true, "batch_id": "…", "lines": 2 } }accepted means the batch is durably stored. Lines usually become searchable
within a second, but the two are not the same guarantee.
Limits and errors
Section titled “Limits and errors”| Code | Meaning |
|---|---|
200 |
Accepted. lines reports how many were usable. |
400 |
The body could not be parsed, or contained no readable lines. |
403 |
The token is missing, unknown, revoked, or the source is paused or deleted. All of these return the same response deliberately. |
413 |
Too many lines (max 1,000 per request), or the body is too large (5 MB on the wire, 20 MB decompressed). |
422 |
The Idempotency-Key was already used, in the last 24 hours, for a different batch. data.code is idempotency_key_reused and errors names the header. See Retries. |
429 |
Rate limited. Retry with back-off. Also returned while your organisation’s log ingestion limit is reached for the billing period: data.code is log_volume_limit_reached, data.resumes_at says when ingestion restarts, in epoch milliseconds, and Retry-After is at most an hour. Lines sent until then are discarded. Also returned when many requests from one address carry an invalid token: if 403s came first, check the token. |
503 |
We could not store the batch. Retry later. |
Rate limiting is keyed to the token, not your IP, so a fleet of workers behind one NAT address shares one generous budget rather than competing for a per-IP one.
Retries
Section titled “Retries”Send an Idempotency-Key header with each batch, and send the same value when you retry that batch. A
request that worked at our end and timed out at yours is the common case, and retrying it is the right instinct.
Idempotency-Key: orders-lambda/run-8812/batch-17-
With a key, a repeat of the same batch within 24 hours is answered exactly as the first was, with the first batch’s
batch_idandlines, and the lines are stored once and billed once. The repeat counts as a request for the rate limit, as any request does. -
A key is yours alone: it is kept per log source, so two sources never see each other’s keys.
-
A different batch under a key used in the last 24 hours is refused with
422, never dropped silently, so no lines are lost without a word:{ "status": "failure","message": "This Idempotency-Key was used for a different batch in the last 24 hours.","data": { "code": "idempotency_key_reused" },"errors": { "Idempotency-Key": ["This Idempotency-Key was used for a different batch in the last 24 hours."] } }Use a new key for a new batch. Whether a batch is the same is judged on its lines, not its bytes: the same lines gzipped differently are the same batch.
-
A batch that fails with a
413or a503leaves its key unused, so retrying it with the same key stores it. -
Without a key (or with a header of only spaces, which counts as no key), a retried batch is stored and billed twice. Only retry on a response that is not a
2xx.
After 24 hours a key is forgotten and may be used again for any batch.
AWS Lambda
Section titled “AWS Lambda”A Lambda function can forward log lines to this endpoint, or mirror a CloudWatch Logs group through a subscription filter: see the AWS Lambda recipe.
Related
Section titled “Related”- Log sources — creating a source and managing its token.
- Search & explore — finding the lines once they are in.
- SDKs — the official SDKs, which build, retry and batch these calls for you.