HTTP API

Send logs from any language or framework using the REST API.

Authentication

All requests require an API key in the Authorization header:

bash
Authorization: Bearer lf_YOUR_API_KEY

Get your API key from Settings → API Keys in the dashboard.

POST /v1/logs — single log

bash
curl -X POST https://api.getlogflow.com/v1/logs \
  -H "Authorization: Bearer lf_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "level": "info",
    "message": "User signed up",
    "service": "auth-service",
    "host": "auth-1",
    "traceId": "abc123",
    "attributes": {
      "userId": "u_123",
      "plan": "starter"
    }
  }'

Log fields

  • level (required) — trace | debug | info | warn | error | fatal
  • message (required) — log message string
  • service — service or application name
  • host — hostname or instance identifier
  • timestamp — ISO 8601 (defaults to now)
  • traceId — distributed trace ID (hex string)
  • spanId — span ID (hex string)
  • attributes — key-value pairs of additional metadata

POST /v1/logs/batch — multiple logs

Send up to 1000 logs in a single request for better efficiency:

bash
curl -X POST https://api.getlogflow.com/v1/logs/batch \
  -H "Authorization: Bearer lf_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "logs": [
      { "level": "info", "message": "Request received", "service": "api" },
      { "level": "error", "message": "DB timeout", "service": "api" }
    ]
  }'
💡
Batching is much more efficient than sending individual requests. Use /v1/logs/batch whenever possible, or use the SDK which batches automatically.

Rate limits

Rate limits are enforced per API key, not per IP address. Teams behind a shared proxy or corporate NAT each get their own independent bucket. Exceeded limits return HTTP 429 with a Retry-After header.

  • POST /v1/logs and POST /v1/logs/batch — 10,000 req/min per key
  • GET /v1/logs/search — 2,000 req/min per key
  • All other API endpoints — 1,000 req/min per key
  • Max 1,000 logs per batch request body
💡
If you need higher search limits for a high-traffic integration or internal tooling, contact support@getlogflow.com — Enterprise plans have custom limits.