Logs API
Ingest and query logs via the REST API.
Logs API
Endpoints for ingesting and querying logs.
POST /logs
Ingest logs for a project. Supports batch ingestion.
This endpoint uses API key authentication via Authorization: Bearer, not JWT tokens.
Request
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
logs | array | ✓ | Array of log entries (max 1000) |
logs[].level | string | ✓ | info, warn, error, or critical |
logs[].message | string | ✓ | Log message (max 10KB) |
logs[].source | string | Service/component identifier | |
logs[].metadata | object | Structured metadata (max 100KB) | |
logs[].timestamp | string | ISO 8601 timestamp (auto-generated if omitted) |
Response (202 Accepted)
Rate Limits
| Plan | Logs per minute | Batch size |
|---|---|---|
| Free | 1,000 | 100 |
| Starter | 10,000 | 500 |
| Pro | 100,000 | 1,000 |
| Enterprise | Unlimited | 1,000 |
GET /logs
Query logs with filters.
Request
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
projectId | string | required | Project ID |
level | string | all | Filter by level: info, warn, error, critical |
search | string | Full-text search in message | |
startTime | string | 24h ago | ISO 8601 start time |
endTime | string | now | ISO 8601 end time |
offset | number | 0 | Number of results to skip |
limit | number | 50 | Results per request (max 1000) |
Response (200 OK)
GET /logs/:id
Get a single log entry by ID.
Request
Response (200 OK)
SDK vs Direct API
The SDK handles batching, retries, and error handling automatically:
Best Practices
- Batch logs — Send multiple logs per request to reduce overhead
- Use structured metadata — Makes searching and filtering easier
- Include timestamps — For accurate time ordering across services
- Add source tags — Identify which service generated each log