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

POSThttps://api.zicroe.com/api/logs

Returns 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_KEY

Required fields

FieldType
timestampstring (ISO 8601)
methodstring
endpointstring
statusCodeinteger
responseTimeinteger

Optional fields

FieldType
requestIdstring
ipAddressstring
userAgentstring
errorMessagestring
stackstring
metadataobject

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 errorMessage and stackfrom your language's native error object — this dramatically improves AI diagnosis and patch quality.
  • Use requestId to 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.