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_KEYGet 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|fatalmessage(required) — log message stringservice— service or application namehost— hostname or instance identifiertimestamp— 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
- 10,000 requests/minute per API key
- Up to 1,000 logs per batch request
- Max 1 MB per request body