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

# Create Trace

> Create a new trace.

Accepts optional client-supplied ``id`` and ``started_at`` (used by
harness's tracer). When absent, bedrock generates them.



## OpenAPI

````yaml POST /api/tracing/traces/
openapi: 3.0.3
info:
  title: Bedrock API
  version: 1.0.0
  description: API for managing agent templates, agents, organizations, and adapter state
servers: []
security: []
paths:
  /api/tracing/traces/:
    post:
      tags:
        - tracing
      description: |-
        Create a new trace.

        Accepts optional client-supplied ``id`` and ``started_at`` (used by
        harness's tracer). When absent, bedrock generates them.
      operationId: tracing_traces_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraceCreateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TraceCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TraceCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceCreate'
          description: ''
      security:
        - tokenAuth: []
        - APIKeyAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    TraceCreateRequest:
      type: object
      description: >-
        Serializer for creating a trace.


        External tracer clients (harness) supply `id` and `started_at` so trace

        timestamps reflect the client-side clock. Bedrock generates both when
        the

        fields are absent (preserves the original portal behavior).
      properties:
        id:
          type: string
          format: uuid
        started_at:
          type: string
          format: date-time
        name:
          type: string
          minLength: 1
          maxLength: 255
        room_name:
          type: string
          nullable: true
          maxLength: 255
        agent_id:
          type: string
          format: uuid
          nullable: true
        metadata: {}
      required:
        - name
    TraceCreate:
      type: object
      description: >-
        Serializer for creating a trace.


        External tracer clients (harness) supply `id` and `started_at` so trace

        timestamps reflect the client-side clock. Bedrock generates both when
        the

        fields are absent (preserves the original portal behavior).
      properties:
        id:
          type: string
          format: uuid
        started_at:
          type: string
          format: date-time
        name:
          type: string
          maxLength: 255
        room_name:
          type: string
          nullable: true
          maxLength: 255
        agent_id:
          type: string
          format: uuid
          nullable: true
        metadata: {}
      required:
        - name
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
    APIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````