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

# Export spans (OTLP/HTTP, JSON encoding)

> **Security Requirements**

| Auth Types | Entities | Permissions | Required Roles |
|------------|----------|-------------|----------------|
| AGENT, SERVICE | TELEMETRY | WRITE | TELEMETRY:WRITE |



## OpenAPI

````yaml /openapi/swarmd.json post /telemetry/v1/traces
openapi: 3.1.0
info:
  title: Relay
  version: v0
servers:
  - url: https://api.dev.swarmd.ai
    description: Development
security: []
tags:
  - name: Policy Groups
    x-displayName: Policy Groups
  - name: Policy Bindings
    x-displayName: Policy Bindings
  - name: Evaluation Packs
    x-displayName: Evaluation Packs
  - name: Webhooks
    x-displayName: Webhooks
  - name: MCP JSON-RPC
    x-displayName: MCP JSON-RPC
  - name: Conversations
    x-displayName: Conversations
  - name: Human JSON-RPC
    x-displayName: Human JSON-RPC
  - name: Channel JSON-RPC
    x-displayName: Channel JSON-RPC
  - name: HITL Approvals
    x-displayName: HITL Approvals
  - name: Agent JSON-RPC
    x-displayName: Agent JSON-RPC
  - name: Tasks
    x-displayName: Tasks
  - name: Push Notifications
    x-displayName: Push Notifications
  - name: Messaging
    x-displayName: Messaging
  - name: LLM Runtime
    x-displayName: LLM Runtime
  - name: Agent Discovery
    x-displayName: Agent Discovery
  - name: Governance
    x-displayName: Governance
  - name: MCP Servers
    x-displayName: MCP Servers
  - name: LLM Gateways
    x-displayName: LLM Gateways
  - name: Agents
    x-displayName: Agents
  - name: User Subscriptions
    x-displayName: User Subscriptions
  - name: LLM Providers
    x-displayName: LLM Providers
  - name: LLM Gateway Subscriptions
    x-displayName: LLM Gateway Subscriptions
  - name: Kill Switches
    x-displayName: Kill Switches
  - name: Channels
    x-displayName: Channels
  - name: Channel Subscriptions
    x-displayName: Channel Subscriptions
  - name: Agent Subscriptions
    x-displayName: Agent Subscriptions
  - name: Marketplace
    x-displayName: Marketplace
  - name: Identity Providers
    x-displayName: Identity Providers
  - name: Groups
    x-displayName: Groups
  - name: Authentication
    x-displayName: Authentication
  - name: Users
    x-displayName: Users
  - name: Tenants
    x-displayName: Tenants
  - name: Audit Retention
    x-displayName: Audit Retention
  - name: Audit Monitors
    x-displayName: Audit Monitors
  - name: Audit Integrity
    x-displayName: Audit Integrity
  - name: Audit Events
    x-displayName: Audit Events
  - name: Audit Traces
    x-displayName: Audit Traces
  - name: Audit Dashboard
    x-displayName: Audit Dashboard
  - name: A2A Payments
    x-displayName: A2A Payments
  - name: Licence Verification
    x-displayName: Licence Verification
  - name: ECR Credentials
    x-displayName: ECR Credentials
  - name: Telemetry Ingest
    x-displayName: Telemetry Ingest
  - name: Telemetry Logs
    x-displayName: Telemetry Logs
  - name: Telemetry Spans
    x-displayName: Telemetry Spans
paths:
  /telemetry/v1/traces:
    post:
      tags:
        - Telemetry Ingest
      summary: Export spans (OTLP/HTTP, JSON encoding)
      description: |-
        **Security Requirements**

        | Auth Types | Entities | Permissions | Required Roles |
        |------------|----------|-------------|----------------|
        | AGENT, SERVICE | TELEMETRY | WRITE | TELEMETRY:WRITE |
      operationId: exportSpans
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Telemetry_OtlpTracesRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Telemetry_OtlpTracesResponse'
      security:
        - Telemetry_bearerAuth: []
components:
  schemas:
    Telemetry_OtlpTracesRequest:
      type: object
      properties:
        resourceSpans:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpResourceSpans'
    Telemetry_OtlpTracesResponse:
      type: object
      properties:
        partialSuccess:
          $ref: '#/components/schemas/Telemetry_OtlpSpanPartialSuccess'
    Telemetry_OtlpResourceSpans:
      type: object
      properties:
        resource:
          $ref: '#/components/schemas/Telemetry_OtlpResource'
        scopeSpans:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpScopeSpans'
    Telemetry_OtlpSpanPartialSuccess:
      type: object
      properties:
        rejectedSpans:
          type: integer
          format: int64
        errorMessage:
          type: string
    Telemetry_OtlpResource:
      type: object
      properties:
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpKeyValue'
    Telemetry_OtlpScopeSpans:
      type: object
      properties:
        scope:
          $ref: '#/components/schemas/Telemetry_OtlpInstrumentationScope'
        spans:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpSpan'
    Telemetry_OtlpKeyValue:
      type: object
      properties:
        key:
          type: string
        value:
          $ref: '#/components/schemas/Telemetry_OtlpAnyValue'
    Telemetry_OtlpInstrumentationScope:
      type: object
      properties:
        name:
          type: string
        version:
          type: string
    Telemetry_OtlpSpan:
      type: object
      properties:
        traceId:
          type: string
        spanId:
          type: string
        parentSpanId:
          type: string
        name:
          type: string
        kind:
          type: string
        startTimeUnixNano:
          type: string
        endTimeUnixNano:
          type: string
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpKeyValue'
        status:
          $ref: '#/components/schemas/Telemetry_OtlpStatus'
    Telemetry_OtlpAnyValue:
      type: object
      properties:
        stringValue:
          type: string
        intValue:
          type: string
        doubleValue:
          type: number
          format: double
        boolValue:
          type: boolean
        bytesValue:
          type: string
        arrayValue:
          $ref: '#/components/schemas/Telemetry_OtlpArrayValue'
        kvlistValue:
          $ref: '#/components/schemas/Telemetry_OtlpKeyValueList'
    Telemetry_OtlpStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    Telemetry_OtlpArrayValue:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpAnyValue'
    Telemetry_OtlpKeyValueList:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/Telemetry_OtlpKeyValue'
  securitySchemes:
    Telemetry_bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token (USER, AGENT, or SERVICE auth)

````