Documentation
Log ingestion reference
Send API request logs from your applications to Zicroe with a single HTTP POST.
Overview
Zicroe ingests structured API logs from your services. Each log is tied to an application via its API key. Create an account, set up a project, environment, and application, then copy the application API key from your dashboard.
Endpoint
POST
https://api.zicroe.com/api/logsReturns 201 Created with the stored log entry. Missing required fields return 400.
Authentication
Include your application API key in the X-API-Key request header. The key identifies which application the log belongs to — you do not need to send applicationId in the body.
Headerhttp
X-API-Key: YOUR_APPLICATION_API_KEYRequired fields
| Field | Type | Description |
|---|---|---|
| timestamp | string (ISO 8601) | When the request completed |
| method | string | HTTP method (GET, POST, etc.) |
| endpoint | string | Request path or route |
| statusCode | integer | HTTP response status code |
| responseTime | integer | Round-trip time in milliseconds |
Optional fields
| Field | Type | Description |
|---|---|---|
| requestId | string | Your correlation or trace ID |
| ipAddress | string | Client IP address |
| userAgent | string | Client user agent |
| errorMessage | string | Error details for failed requests |
| stack | string | Full exception stack trace (e.g. err.stack in Node, traceback.format_exc() in Python). Strongly recommended for errors — pins source files during AI analysis. |
| metadata | object | Arbitrary JSON for custom context |
Request body
Example payloadjson
{
"timestamp": "2026-06-11T14:30:00.000Z",
"method": "POST",
"endpoint": "/api/checkout",
"statusCode": 500,
"responseTime": 142,
"requestId": "req_abc123",
"errorMessage": "Cannot read property 'email' of null",
"stack": "TypeError: Cannot read property 'email' of null\n at checkout (src/routes/checkout.js:48:22)\n at Layer.handle [as handle_request] (node_modules/express/lib/router/layer.js:95:5)",
"metadata": {
"orderId": "ord_123",
"region": "us-east-1"
}
}Examples
cURLbash
curl -X POST https://api.zicroe.com/api/logs \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_APPLICATION_API_KEY" \
-d '{"timestamp":"2026-06-11T14:30:00.000Z","method":"POST","endpoint":"/api/checkout","statusCode":500,"responseTime":142,"requestId":"req_abc123","errorMessage":"Cannot read property 'email' of null","stack":"TypeError: Cannot read property 'email' of null\n at checkout (src/routes/checkout.js:48:22)","metadata":{"orderId":"ord_123"}}'Node.jsjavascript
const response = await fetch("https://api.zicroe.com/api/logs", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.ZICROE_API_KEY,
},
body: JSON.stringify({
timestamp: new Date().toISOString(),
method: req.method,
endpoint: req.path,
statusCode: res.statusCode,
responseTime: Date.now() - start,
requestId: req.headers["x-request-id"],
errorMessage: err?.message,
stack: err?.stack,
metadata: { route: req.route?.path },
}),
});
if (!response.ok) {
throw new Error(`Log ingestion failed: ${response.status}`);
}Pythonpython
import os
import traceback
import requests
from datetime import datetime, timezone
try:
# ... handler logic
pass
except Exception as e:
requests.post(
"https://api.zicroe.com/api/logs",
headers={
"Content-Type": "application/json",
"X-API-Key": os.environ["ZICROE_API_KEY"],
},
json={
"timestamp": datetime.now(timezone.utc).isoformat(),
"method": "POST",
"endpoint": "/checkout",
"statusCode": 500,
"responseTime": 87,
"requestId": "req_xyz789",
"errorMessage": str(e),
"stack": traceback.format_exc(),
"metadata": {"orderId": "ord_123"},
},
timeout=5,
).raise_for_status()Tips
- Send logs after each request completes so response time and status are accurate.
- For failed requests, include
errorMessageandstackfrom your language's native error object — this dramatically improves AI diagnosis and patch quality. - Use
requestIdto correlate logs with your own tracing or error reporting tools. - Store the API key in an environment variable (e.g.
ZICROE_API_KEY) — never commit it to source control. - Regenerating an application API key in the dashboard invalidates the previous key immediately.