> ## 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.

# Ingest Traces

> Ingest OTLP trace data.

Accepts OTLP protobuf format only (optionally gzip compressed).
Protobuf is converted to camelCase JSON before storage in S3.

S3 path: events/otel/{project_id}/{yyyy}/{mm}/{dd}/{hh}/{uuid}.json

Headers:
    Authorization: Bearer <api_key>
    Content-Encoding: gzip (optional)
    Content-Type: application/x-protobuf

Body:
    OTLP trace data in protobuf format

<Note>The TraceRoot SDKs call this endpoint for you; call it directly only where no SDK fits. It accepts a project API key only.</Note>

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


## 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).
        Protobuf is converted to camelCase JSON before storage in S3.

        S3 path: events/otel/{project_id}/{yyyy}/{mm}/{dd}/{hh}/{uuid}.json

        Headers:
            Authorization: Bearer <api_key>
            Content-Encoding: gzip (optional)
            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
        '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
      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.