---
title: "Ingest Agent Logs (OTLP Format)"
method: POST
path: "/logs/otlp"
tags: ["Logs"]
---

# Ingest Agent Logs (OTLP Format)

`POST /logs/otlp`

Ingest OpenTelemetry logs from an agent. Requires agent API key authentication.

## Request body

- OTLPLogIngestionRequest — OTLP log data in JSON format.
  - `resourceLogs` OTLPResourceLogs[], required — Array of ResourceLogs per OTLP spec
    - `resource` OTLPResource — OTLP resource with attributes.
      - `attributes` OTLPAttribute[]
        - `key` string, required
        - `value` OTLPAttributeValue, required — OTLP attribute value supporting multiple types. Per OTLP JSON spec, intValue is transmitted as a string to avoid JSON number precision issues with int64 values. We validate that the string represents a valid integer and provide a helper property to get the actual int value. String values are limited to MAX_ATTRIBUTE_VALUE_LENGTH (4KB) to prevent memory exhaustion and ClickHouse insert failures.
          - `arrayValue` object, nullable
          - `boolValue` boolean, nullable
          - `bytesValue` string, nullable
          - `doubleValue` number, nullable
          - `intValue` string, nullable
          - `stringValue` string, nullable
    - `scopeLogs` OTLPScopeLogs[]
      - `logRecords` OTLPLogRecord[]
        - `attributes` OTLPAttribute[]
          - `key` string, required
          - `value` OTLPAttributeValue, required — OTLP attribute value supporting multiple types. Per OTLP JSON spec, intValue is transmitted as a string to avoid JSON number precision issues with int64 values. We validate that the string represents a valid integer and provide a helper property to get the actual int value. String values are limited to MAX_ATTRIBUTE_VALUE_LENGTH (4KB) to prevent memory exhaustion and ClickHouse insert failures.
            - `arrayValue` object, nullable
            - `boolValue` boolean, nullable
            - `bytesValue` string, nullable
            - `doubleValue` number, nullable
            - `intValue` string, nullable
            - `stringValue` string, nullable
        - `body` OTLPBodyValue — OTLP body value for log record messages. Unlike OTLPAttributeValue, this class does NOT have max_length constraints on stringValue. This allows the OTLPLogRecord.validate_body_size validator to handle truncation for messages between 4KB and 64KB, rather than having Pydantic reject them outright due to the 4KB attribute limit. Messages exceeding MAX_MESSAGE_LENGTH (64KB) are truncated with a marker.
          - `arrayValue` object, nullable
          - `boolValue` boolean, nullable
          - `bytesValue` string, nullable
          - `doubleValue` number, nullable
          - `intValue` string, nullable
          - `stringValue` string, nullable
        - `severityNumber` integer, nullable
        - `severityText` string, nullable
        - `spanId` string, nullable
        - `timeUnixNano` string
        - `traceId` string, nullable
      - `scope` OTLPScope — OTLP instrumentation scope.
        - `name` string
        - `version` string

## Response `200`

Successful Response

- OTLPLogIngestionResponse — Response from OTLP log ingestion endpoint.
  - `logs_count` integer, required — Number of log records ingested
  - `status` string

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/revisions/f24a474dc415/schema)
