REST API
Send logs directly to Logged using the REST API. This is useful when you cannot use the SDK or need to debug ingestion outside your application.
Endpoint
POST /api/v1/logs
Accept: application/json
Content-Type: application/jsonThe API supports CORS for browser clients. Preflight requests are handled automatically.
Authentication
Include your project API key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEYKeep your key secret
Request body
Send a JSON object with at least a level and message.
{
"level": "error",
"message": "Database timeout",
"metadata": {
"query": "users"
},
"environment": "production",
"source": "server",
"url": "https://example.com/api/users",
"pathname": "/api/users",
"stack": "Error: Database timeout\n at ...",
"timestamp": "2026-08-28T16:00:00.000Z"
}| Field | Required | Description |
|---|---|---|
| level | Yes | Log severity. Must be one of: log, debug, info, success, warn, error. |
| message | Yes | Human-readable log message. |
| metadata | No | Arbitrary key-value pairs for additional debugging context. |
| environment | No | Application environment. Must be one of: development, staging, production. |
| source | No | Log source. Must be one of: server, client, edge. |
| url | No | Full URL where the log originated. |
| pathname | No | URL pathname where the log originated. |
| stack | No | Stack trace or error stack text. |
| timestamp | No | ISO-8601 timestamp. Defaults to server time if omitted. |
Batch ingestion
Send up to 100 logs in a single request by wrapping them in a logs array.
{
"logs": [
{
"level": "info",
"message": "Job started",
"environment": "production"
},
{
"level": "error",
"message": "Job failed",
"environment": "production"
}
]
}Success response
{
"success": true,
"id": "log_123"
}For batch requests, the response includes an accepted count and rejected count.
{
"success": true,
"accepted": 2,
"rejected": 0
}Errors
| Status | Meaning |
|---|---|
| 413 | Request body exceeds 100 KB limit. |
| 400 | Invalid request body or log fields. |
| 401 | Invalid or missing API key. |
| 429 | Too many requests. Check Retry-After and rate-limit headers. |
| 500 | Server error. Retry with backoff. |
Rate limit headers
Successful responses include rate-limit metadata. When rate-limited, the response also includes a Retry-After header.
| Header | Description |
|---|---|
| X-RateLimit-Limit | Maximum requests allowed per minute. |
| X-RateLimit-Remaining | Requests remaining in the current window. |
| X-RateLimit-Reset | Unix timestamp when the rate limit window resets. |
| Retry-After | Seconds to wait before retrying. Only present on 429 responses. |
cURL example
curl -X POST https://logged.oheo.site/api/v1/logs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"level": "error",
"message": "Database timeout",
"environment": "production"
}'The public Logged ingestion endpoint is https://logged.oheo.site/api/v1/logs. The SDK also targets this endpoint by default; it does not currently expose a custom baseUrl option.