API Reference

LogTrace REST API Documentation

Smart log analysis for Russian business. Integrate log ingestion and querying in minutes.

View Endpoints Authentication Guide

Available Endpoints

Ingest logs via HTTP or Logstash-compatible TCP/UDP. Query and filter using RESTful GET/POST methods.

POST /v1/logs/ingest

Submit log batches in JSON format. Supports up to 5,000 events per request. Content-Type must be application/json.

cURL Example:
curl -X POST https://api.logtrace.io/v1/logs/ingest -H "Authorization: Bearer lt_live_8f3a9c2d1e4b5f6a7c8d9e0f1a2b3c4d" -H "Content-Type: application/json" -d '{"logs":[{"timestamp":"2024-03-15T10:22:01Z","level":"ERROR","message":"Connection timeout on db-primary-03","service":"payment-gateway"}]}'

Response: 202 Accepted (processing queued)

POST /v1/logs/query

Search logs using KQL-style syntax. Returns paginated results with metadata. Default limit is 100 records per page.

cURL Example:
curl -X POST https://api.logtrace.io/v1/logs/query -H "Authorization: Bearer lt_live_8f3a9c2d1e4b5f6a7c8d9e0f1a2b3c4d" -H "Content-Type: application/json" -d '{"filter":"service:payment-gateway AND level:ERROR","from":"-24h","limit":50}'

Response: 200 OK (JSON array with matches)

GET /v1/health

Verify API status and cluster connectivity. Returns service uptime, active workers, and current ingestion rate.

cURL Example:
curl -X GET https://api.logtrace.io/v1/health -H "Authorization: Bearer lt_live_8f3a9c2d1e4b5f6a7c8d9e0f1a2b3c4d"

Response: 200 OK ({"status":"healthy","workers":12,"ingestion_rps":4320})

Authentication

All API requests require a valid API key passed in the Authorization header.

LogTrace uses Bearer token authentication. Generate your key in the dashboard under Settings > API Access. Keep your secret key secure and never expose it in client-side code or public repositories.

Example header:
Authorization: Bearer lt_live_8f3a9c2d1e4b5f6a7c8d9e0f1a2b3c4d

Keys are scoped to specific environments (production, staging, development). Cross-environment requests return a 403 Forbidden response.

Rate Limits & Status Codes

Protect your infrastructure and our clusters with predictable throttling and clear error responses.

Standard tier: 10,000 requests per hour for ingestion, 2,000 queries per hour. Enterprise tier: 50,000 ingestion, 10,000 queries. Limits reset at the top of each UTC hour.

HTTP Status Codes:
200 OK — Request succeeded
202 Accepted — Ingestion queued for processing
400 Bad Request — Malformed JSON or missing required fields
401 Unauthorized — Invalid or expired API key
403 Forbidden — Key lacks required scope (e.g., write:logs)
429 Too Many Requests — Rate limit exceeded. Retry-After header provided.
500 Internal Server Error — Cluster maintenance or transient failure

When a 429 is returned, back off using exponential delay. LogTrace automatically queues overflowed batches for Enterprise customers without dropping data. Monitor your usage in the Analytics dashboard under API Consumption.