Documentation Structure
5 min read | June 24, 2026
Tutorial

Structure

To ensure high performance and enable our AI features (like NL2SQL and Auto Root-Cause Analysis), events must follow a strict schema at the root level, while allowing infinite flexibility inside the payload.

Standard Payload Schema

When sending data to the ingestion API, the expected JSON payload must contain an array of events. Here is an example of a perfectly structured payload:

{
  "events": [
    {
      "timestamp": "2026-10-24T14:32:05.123Z",
      "service": "payment-gateway",
      "level": "error",
      "message": "Payment processing failed due to upstream timeout",
      "trace_id": "req-5f8a9b2c",
      "metadata": {
        "user_id": "usr_987654",
        "tenant_id": "acme_corp",
        "latency_ms": 5040,
        "endpoint": "/api/v1/checkout",
        "payment_method": "credit_card"
      }
    }
  ]
}

⚠️ Crucial: Use Official SDKs in Production

Always use official SDKs in production. While the raw HTTP API is available, we strongly recommend using our official SDKs (Go, Python, Node.js). The SDKs automatically handle asynchronous batching, connection pooling, and automatic retries in the background without blocking your main application thread.


Ingestion Example (cURL)

You can send events directly from any backend for testing purposes using a simple HTTP request:

curl -X POST "https://ingest.astralog.io/v1/drain" \
  -H "Authorization: Bearer ast_sk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "level": "info",
        "service": "auth-worker",
        "message": "User login successful",
        "metadata": {"user_id": "123"}
      }
    ]
  }'