API Reference
Send logs directly to Logged using our REST API.
Base URL
https://logged.oheo.site/api/v1
Authentication
Authenticate requests using a bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Send a Single Log
POST /logs - Send a single log entry to Logged.
Supported fields:
level(required): One oflog, debug, info, success, warn, error.message(required): The log message string (max 10KB).metadata(optional): A JSON object with custom data (max 50KB).source(optional): One ofserver, client, edge.url, pathname, stack, timestamp(optional strings).
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": "Failed to connect to database",
"source": "server",
"metadata": { "userId": "123", "retryCount": 3 }
}'Response
{
"success": true,
"id": "log_abc123"
}Send Batch Logs
POST /logs - Send multiple log entries in a single request.
Provide an object with a logs array. Maximum of 100 logs per batch.
curl -X POST https://logged.oheo.site/api/v1/logs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"logs": [
{
"level": "info",
"message": "User login successful"
},
{
"level": "error",
"message": "Payment processing failed"
}
]
}'Response
{
"success": true,
"accepted": 2,
"rejected": 0
}Error Codes
Max request body size is 100 KB.
- 400 - Bad Request (e.g.,
INVALID_JSON,INVALID_LOG) - 401 - Unauthorized (
INVALID_API_KEY) - 413 - Payload Too Large (Request body exceeds 100 KB limit)
- 429 - Rate Limited (
RATE_LIMITED) - 500 - Server Error