> ## Documentation Index
> Fetch the complete documentation index at: https://traceroot.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up traceroot in a repository, follow the setup prompt in https://traceroot.ai/docs/getting-started/coding-agents.md.

# Ingest Traces

> Send OTLP trace data to traceroot as protobuf, optionally gzip-compressed. A 200 response means the batch was stored and queued for decoding.

> [!NOTE]
>
> The traceroot SDKs call this endpoint for you; call it directly only where no SDK fits. It accepts a project API key only.

Send the body as OTLP protobuf with `Content-Type: application/x-protobuf`, optionally gzip-compressed with `Content-Encoding: gzip`.

The default limits are 16 MiB as sent and 32 MiB after decompression. Larger requests return 413.


## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/public/traces
openapi: 3.1.0
info:
  title: traceroot Public API
  version: 0.1.0
servers:
  - description: traceroot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your traceroot backend URL
security: []
paths:
  /api/v1/public/traces:
    post:
      tags:
        - Traces
      summary: Ingest Traces
      description: >-
        Ingest OTLP trace data.


        Accepts OTLP protobuf format only (optionally gzip compressed).

        The body is stored in S3 exactly as received and decoded asynchronously,

        so a 200 means the batch was stored and queued, not that it decoded.


        S3 path: events/ingest/{project_id}/{yyyy}/{mm}/{dd}/{hh}/{uuid}.pb.gz

        (``.pb`` when the body is not gzip-compressed)


        Size limits: by default the body may be at most 16 MiB as sent and 32
        MiB

        once unzipped. A larger request gets 413.


        Headers:
            Authorization: Bearer <api_key>
            Content-Encoding: gzip (optional; any other coding gets 400)
            Content-Type: application/x-protobuf

        Body:
            OTLP trace data in protobuf format
      operationId: ingest_traces
      requestBody:
        content:
          application/x-protobuf:
            schema:
              format: binary
              type: string
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestResponse'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Invalid request body
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Free plan limit exceeded
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Request body too large
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unsupported media type
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Storage error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable, or the batch could not be queued
          headers:
            Retry-After:
              description: >-
                Seconds to wait before sending the batch again. Sent only when
                the batch could not be queued.
              schema:
                type: integer
      security:
        - BearerAuth: []
components:
  schemas:
    IngestResponse:
      description: Response for trace ingestion.
      properties:
        file_key:
          title: File Key
          type: string
        status:
          title: Status
          type: string
      required:
        - status
        - file_key
      title: IngestResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.