Skip to content

Ingest and API ​

SDKs and their agents send data to Lumberjack over HTTP. This page lists the endpoints, their payloads and limits, for running Lumberjack behind a proxy or writing your own SDK.

Endpoints ​

EndpointAuthLimit
POST /api/ingestServer token, as a bearer token600 batches a minute per project
POST /api/ingest/heartbeatServer tokenCounted with the batches
POST /api/ingest/browser?key=Public key, and an allowed origin30 a minute per address and key, 300 a minute per address
POST /api/ingest/sourcemapsServer token120 a minute per project
POST /api/v1/opentelemetry/v1/...Server tokenCounted with the batches
GET /api/healthServer token120 a minute per project
DELETE /api/activity/actorServer token60 a minute per project
GET or POST /api/health/ping/{token}The heartbeat check's secret URL60 a minute per address
/mcpMCP token, as a bearer token120 calls a minute per token
GET /api/v1/...Team token, or public stats key120 a minute per token or key

See the metrics API and MCP pages for those endpoints, and OpenTelemetry for sending OTLP from an OpenTelemetry SDK or collector.

Responses ​

StatusWhen
202A batch is accepted, with {"accepted": <count>}. It is processed in the background.
401The token is wrong or missing.
400The body is not valid gzip.
413The body is larger than 1 MB.
415The browser endpoint got a compressed body.
422The payload is invalid. The answer names the fields at fault.
429A rate limit is hit, or the address sent 30 unknown server or MCP tokens this minute.

Batches ​

POST /api/ingest takes a JSON batch, plain or with Content-Encoding: gzip:

json
{
    "v": 1,
    "environment": "production",
    "release": "4f2c1a9",
    "host": "web-1",
    "events": [{ "type": "exception", "...": "..." }]
}
FieldRequiredNotes
vyesAlways 1.
environmentnoAt most 64 characters.
releasenoAt most 64 characters.
hostnoAt most 255 characters.
eventsyesAt most 5,000 events, each of type request, request_counts, query, exception, job, log, schedule, command, span, health, alert, maintenance, activity or ai_call.

Requests ​

A request event carries method, route, url, status, duration_ms and memory_peak. route is the route's URI, or the path when no route matched. It may also carry:

FieldNotes
domainThe host the request was made to, such as shop.example.com. Include the port only when it is not the default. Without it, Lumberjack takes the host from url. Stored lowercase.
route_nameThe framework's name for the route, such as orders.show.

Sampling ​

An SDK that samples marks each run. A request, job, command or schedule event, and each query and span of a run, may carry:

FieldNotes
sample_rateThe share of runs the SDK picks, from 0 to 1. Defaults to 1.
sampledtrue when the run was picked, false when it was kept because it was slow or failed. Defaults to true.

A request_counts event counts every request the SDK recorded since its last one, sampled or not:

json
{
    "type": "request_counts",
    "counts": [
        {
            "method": "GET",
            "route": "/orders/{order}",
            "domain": "shop.example.com",
            "status": 200,
            "count": 2,
            "duration_ms_sum": 31.4
        }
    ],
    "from": 1762179000.12,
    "to": 1762179005.34,
    "timestamp": 1762179005.34
}
FieldNotes
countsRequired. A list of at most 501 rows. A missing list or a longer one is rejected with 422.
counts[].methodThe HTTP method.
counts[].routeThe route's URI, or the path when no route matched.
counts[].domainOptional, as on a request event.
counts[].statusThe response status.
counts[].countThe number of requests. A row without a positive count is skipped.
counts[].duration_ms_sumThe summed duration of those requests, in milliseconds.
from, to, timestampUnix time in seconds. The counts are filed under the minute of timestamp.

Send one event per request or one every few seconds, with the same result. The counts are kept as long as the request runs, and used as described under Sampling.

Heartbeat ​

The agent sends POST /api/ingest/heartbeat once a minute. It fills the project's Agents list and the Queues card.

FieldNotes
hostRequired. At most 255 characters.
nameThe agent's name. At most 64 characters.
environmentAt most 64 characters.
clientThe sdk, agent, runtime and framework, each with a name and a version.
queuesAt most 50, each with connection, queue, size, and optionally oldest_age_s and workers.
metricscpu_load_1m, cpu_cores, memory_used_bytes, memory_total_bytes, disk_used_bytes, disk_total_bytes and php_memory_peak_bytes.

The answer holds the project's health check states under health, the same as GET /api/health, and the event types this server knows under features. An event of a type the server does not know is skipped, and the rest of its batch is kept, so a newer agent can talk to an older server.

Alert events ​

An event of type alert sends a custom alert:

json
{
    "type": "alert",
    "title": "Payment failed",
    "topic": "payments",
    "level": "critical",
    "message": "Order 1042 was declined.",
    "url": "https://shop.example/orders/1042",
    "fields": [{ "name": "Amount", "value": "499 kr", "inline": true }],
    "tables": [
        {
            "title": "Items",
            "headers": ["Item", "Qty"],
            "rows": [["Print", "2"]]
        }
    ],
    "links": [
        {
            "label": "Refund",
            "url": "https://shop.example/r/1",
            "style": "danger"
        }
    ],
    "dedupe_key": "order-1042",
    "dedupe_minutes": 10
}
FieldNotes
titleRequired. An event without it is skipped.
topicWhich topic to send to. Made into a slug. Without it, default.
levelinfo, success, warning or critical. Sets the color and the urgency.
messageThe text under the title.
urlWhere the title links to. http or https only.
fieldsAt most 20, each with name, value and inline.
tablesAt most 3, with title, headers (at most 8) and rows (at most 20).
linksAt most 5, with label (at most 75 characters), url (at most 512) and a style of primary or danger.
dedupe_key,dedupe_minutesA repeat of the key within the minutes is listed, but not sent.
timestampWhen it happened.

Maintenance events ​

An event of type maintenance opens or closes a maintenance window of the batch's environment:

json
{
    "type": "maintenance",
    "state": "start",
    "message": "Upgrading the database",
    "expected_minutes": 15,
    "timestamp": 1762164000.123
}
FieldNotes
stateRequired. start or end. An event with anything else is skipped.
messageWhat is going on. Cut to 500 characters.
expected_minutesHow long it should take, at most a week.
expected_untilWhen it should be over, in ISO 8601, kept between the start and a week later. Wins over expected_minutes. Without either, the project's default (30).
timestampWhen it started or ended.

The environment comes from the batch, like release and host; a batch without one covers every environment of the project. A start while a window of the environment is open keeps that window, with the new message and expected end where the event sends them. An end closes the environment's open window, and does nothing when none is open. Other fields are ignored. Browsers cannot send it.

Activity events ​

An event of type activity records an activity:

json
{
    "type": "activity",
    "name": "order.placed",
    "group": "billing",
    "actor": { "type": "App\\Models\\User", "id": "17" },
    "subjects": [
        { "type": "image", "id": "81" },
        { "type": "gallery", "id": "5" }
    ],
    "payload": { "total": 499, "currency": "DKK" },
    "trace_id": "4bf92f3577b34da6",
    "timestamp": 1763025600.123
}
FieldNotes
nameRequired. Letters, digits, ., _, : and -, at most 128 characters. Otherwise it is skipped.
groupMade into a slug. Without it, default.
actorWho did it: a type (at most 128 characters) and an id (at most 64). Left out without both.
subjectsWhat it was done to: a list of at most 10, each a type and an id like the actor. subject with one is taken too.
payloadA JSON object, scrubbed. Larger than 16 KB, it is replaced by {"_truncated": true}.
trace_idThe trace it was recorded in.
timestampWhen it happened.

Forgetting an actor ​

DELETE /api/activity/actor with the server token and a JSON body of the actor's type and id deletes all activity of that actor in the project, and answers {"deleted": <count>}. The hourly counts are kept.

AI call events ​

An event of type ai_call records one call to an AI model. The prompt and the answer are never sent, and neither is the API key:

json
{
    "type": "ai_call",
    "source": "laravel-ai",
    "provider": "anthropic",
    "driver": "anthropic",
    "model": "claude-sonnet-4-5-20250929",
    "operation": "text",
    "tokens": {
        "input": 1200,
        "output": 300,
        "cache_read": 800,
        "cache_write": 0,
        "reasoning": null
    },
    "duration_ms": 1834.2,
    "status": "ok",
    "error": null,
    "key": {
        "sha256": "<64 hex characters>",
        "label": "prod-primary",
        "owner": { "type": "tenant", "id": "42" }
    },
    "actor": { "type": "App\\Models\\User", "id": "1337" },
    "invocation_id": "01JD3QK8V7",
    "step": 2,
    "trace_id": "4bf92f3577b34da6",
    "timestamp": 1763025600.123
}
FieldNotes
providerRequired, at most 64 characters. Otherwise the call is skipped. Stored lowercase.
modelRequired, at most 128 characters. Otherwise the call is skipped.
driverThe integration's driver, at most 64 characters. Stored lowercase.
sourcelaravel-ai, prism, manual or otel. Anything else is manual.
operationtext, structured, stream, embeddings, image, audio, transcription or rerank. Anything else is text.
tokensinput (all input, cached tokens included), output, cache_read, cache_write and reasoning: whole numbers from 0 to 10,000,000,000, or null when unknown; a count above that is dropped as unknown.
duration_msHow long the call took, in milliseconds.
statusok or error. Without it, error when error is set, else ok.
errorThe error's name, at most 255 characters.
key.sha256sha256(driver + ":" + key) as 64 hex characters, where the driver is the vendor in lowercase (openai, anthropic), not a connection name; the Laravel library lowercases it before hashing. Only an HMAC of it is stored, as the key's fingerprint; anything else and the call is kept without a key.
key.labelThe key's name, at most 255 characters.
key.ownerWhose key it is: a type (at most 128 characters) and an id (at most 64). Left out without both.
actorWho caused the call, like the owner.
invocation_idThe agent run it belongs to, at most 64 characters.
stepThe step of that run.
trace_idThe trace it was made in.
timestampWhen it was made.

A value out of range (a negative token count, an unknown operation) is dropped or replaced as the table says; the call itself is kept. Browsers cannot send it.

Browser ​

POST /api/ingest/browser?key=<public key> takes plain JSON. The browser script sends it with sendBeacon as text/plain. A batch holds at most 50 events of type exception or vital.

The request's Origin must be one of the project's allowed origins, which get a CORS preflight answer. Requests from crawlers and automated browsers are accepted and dropped.

Source maps ​

POST /api/ingest/sourcemaps takes one source map as a multipart upload, with the server token. See Source maps for what they do.

FieldHolds
fileThe .map file, a version 3 source map of at most 20 MB.
pathThe public path of the bundle it belongs to, e.g. /build/assets/app-3f9a.js.
releaseOptional. The release, as the browser script's data-release sends it.
bash
for map in public/build/assets/*.js.map; do
    curl -fsS https://lumberjack.example/api/ingest/sourcemaps \
        -H "Authorization: Bearer $LUMBERJACK_TOKEN" \
        -F "file=@$map" \
        -F "path=/build/assets/$(basename "$map" .map)" \
        -F "release=$(git rev-parse --short HEAD)"
done
rm public/build/assets/*.map

The answer is 201 with the stored path, release and size. The same path and release uploaded again replaces the map. A file that is not a source map gets a 422, and a map that could not be stored gets a 503; upload it again.

Limits ​

WhatLimit
Batch body1 MB
Events per batch5,000
Rows per request_counts event501
Events per browser batch50
Source map file20 MB
Queues per heartbeat50
Unknown tokens per address a minute30