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

# Add Tags To Trace

> Add tags to a trace.



## OpenAPI

````yaml /openapi.json post /v1/traces/{trace_id}/tags
openapi: 3.1.0
info:
  title: Tuor API
  description: API for storing and managing human review of model traces
  version: 0.1.0
servers:
  - url: https://api.tuor.dev
security:
  - ApiKeyAuth: []
paths:
  /v1/traces/{trace_id}/tags:
    post:
      tags:
        - Traces
      summary: Add Tags To Trace
      description: Add tags to a trace.
      operationId: add_tags_to_trace_v1_traces__trace_id__tags_post
      parameters:
        - name: trace_id
          in: path
          required: true
          schema:
            type: string
            title: Trace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraceTagRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TraceTagRequest:
      properties:
        tag_ids:
          items:
            type: string
          type: array
          maxItems: 50
          minItems: 1
          title: Tag Ids
          description: List of tag IDs to add
      type: object
      required:
        - tag_ids
      title: TraceTagRequest
    TraceDetailResponse:
      properties:
        id:
          type: string
          title: Id
        created_by:
          type: string
          title: Created By
        org_id:
          type: string
          title: Org Id
        project_id:
          type: string
          title: Project Id
        status:
          $ref: '#/components/schemas/TraceStatus'
        spans:
          items:
            oneOf:
              - $ref: '#/components/schemas/MessageSpan'
              - $ref: '#/components/schemas/ReasoningSpan'
              - $ref: '#/components/schemas/ToolRequestSpan'
              - $ref: '#/components/schemas/ToolResponseSpan'
              - $ref: '#/components/schemas/ErrorSpan'
              - $ref: '#/components/schemas/UnknownSpan'
            discriminator:
              propertyName: type
              mapping:
                error: '#/components/schemas/ErrorSpan'
                message: '#/components/schemas/MessageSpan'
                reasoning: '#/components/schemas/ReasoningSpan'
                tool_request: '#/components/schemas/ToolRequestSpan'
                tool_response: '#/components/schemas/ToolResponseSpan'
                unknown: '#/components/schemas/UnknownSpan'
          type: array
          title: Spans
        model_output:
          additionalProperties: true
          type: object
          title: Model Output
        corrected_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Corrected Output
        final_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Final Output
        trace_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Trace Config
        output_schema:
          anyOf:
            - additionalProperties:
                oneOf:
                  - $ref: '#/components/schemas/EnumFieldSchema'
                  - $ref: '#/components/schemas/BooleanFieldSchema'
                  - $ref: '#/components/schemas/JsonFieldSchema'
                discriminator:
                  propertyName: type
                  mapping:
                    boolean: '#/components/schemas/BooleanFieldSchema'
                    enum: '#/components/schemas/EnumFieldSchema'
                    json: '#/components/schemas/JsonFieldSchema'
              type: object
            - type: 'null'
          title: Output Schema
        version:
          type: integer
          title: Version
        created_at:
          type: string
          format: date-time
          title: Created At
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
        deleted_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Deleted By
        restored_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Restored At
        restored_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Restored By
        tags:
          items:
            $ref: '#/components/schemas/TagSummary'
          type: array
          title: Tags
        events:
          items:
            $ref: '#/components/schemas/TraceEventResponse'
          type: array
          title: Events
      type: object
      required:
        - id
        - created_by
        - org_id
        - project_id
        - status
        - spans
        - model_output
        - version
        - created_at
      title: TraceDetailResponse
      description: A trace with its tags and review history.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TraceStatus:
      type: string
      enum:
        - pending
        - approved
        - rejected
        - corrected
      title: TraceStatus
      description: Review status of a trace.
    MessageSpan:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: message
          title: Type
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          title: Role
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        content:
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContentBlock'
              - $ref: '#/components/schemas/JsonContentBlock'
              - $ref: '#/components/schemas/EncryptedContentBlock'
              - $ref: '#/components/schemas/RefusalContentBlock'
              - $ref: '#/components/schemas/ImageContentBlock'
              - $ref: '#/components/schemas/DocumentContentBlock'
            discriminator:
              propertyName: type
              mapping:
                document: '#/components/schemas/DocumentContentBlock'
                encrypted: '#/components/schemas/EncryptedContentBlock'
                image: '#/components/schemas/ImageContentBlock'
                json: '#/components/schemas/JsonContentBlock'
                refusal: '#/components/schemas/RefusalContentBlock'
                text: '#/components/schemas/TextContentBlock'
          type: array
          title: Content
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - role
        - content
      title: MessageSpan
    ReasoningSpan:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: reasoning
          title: Type
        role:
          type: string
          const: assistant
          title: Role
          default: assistant
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        content:
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContentBlock'
              - $ref: '#/components/schemas/JsonContentBlock'
              - $ref: '#/components/schemas/EncryptedContentBlock'
              - $ref: '#/components/schemas/RefusalContentBlock'
              - $ref: '#/components/schemas/ImageContentBlock'
              - $ref: '#/components/schemas/DocumentContentBlock'
            discriminator:
              propertyName: type
              mapping:
                document: '#/components/schemas/DocumentContentBlock'
                encrypted: '#/components/schemas/EncryptedContentBlock'
                image: '#/components/schemas/ImageContentBlock'
                json: '#/components/schemas/JsonContentBlock'
                refusal: '#/components/schemas/RefusalContentBlock'
                text: '#/components/schemas/TextContentBlock'
          type: array
          title: Content
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - content
      title: ReasoningSpan
    ToolRequestSpan:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: tool_request
          title: Type
        role:
          type: string
          const: assistant
          title: Role
          default: assistant
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Call Id
        server:
          anyOf:
            - type: string
            - type: 'null'
          title: Server
        name:
          type: string
          title: Name
        invalid_json:
          type: boolean
          title: Invalid Json
          default: false
        content:
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContentBlock'
              - $ref: '#/components/schemas/JsonContentBlock'
              - $ref: '#/components/schemas/EncryptedContentBlock'
              - $ref: '#/components/schemas/RefusalContentBlock'
              - $ref: '#/components/schemas/ImageContentBlock'
              - $ref: '#/components/schemas/DocumentContentBlock'
            discriminator:
              propertyName: type
              mapping:
                document: '#/components/schemas/DocumentContentBlock'
                encrypted: '#/components/schemas/EncryptedContentBlock'
                image: '#/components/schemas/ImageContentBlock'
                json: '#/components/schemas/JsonContentBlock'
                refusal: '#/components/schemas/RefusalContentBlock'
                text: '#/components/schemas/TextContentBlock'
          type: array
          title: Content
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - name
        - content
      title: ToolRequestSpan
    ToolResponseSpan:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: tool_response
          title: Type
        role:
          type: string
          const: tool
          title: Role
          default: tool
        call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Call Id
        is_error:
          type: boolean
          title: Is Error
          default: false
        content:
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContentBlock'
              - $ref: '#/components/schemas/JsonContentBlock'
              - $ref: '#/components/schemas/EncryptedContentBlock'
              - $ref: '#/components/schemas/RefusalContentBlock'
              - $ref: '#/components/schemas/ImageContentBlock'
              - $ref: '#/components/schemas/DocumentContentBlock'
            discriminator:
              propertyName: type
              mapping:
                document: '#/components/schemas/DocumentContentBlock'
                encrypted: '#/components/schemas/EncryptedContentBlock'
                image: '#/components/schemas/ImageContentBlock'
                json: '#/components/schemas/JsonContentBlock'
                refusal: '#/components/schemas/RefusalContentBlock'
                text: '#/components/schemas/TextContentBlock'
          type: array
          title: Content
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - content
      title: ToolResponseSpan
    ErrorSpan:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: error
          title: Type
        role:
          type: string
          const: system
          title: Role
          default: system
        content:
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContentBlock'
              - $ref: '#/components/schemas/JsonContentBlock'
              - $ref: '#/components/schemas/EncryptedContentBlock'
              - $ref: '#/components/schemas/RefusalContentBlock'
              - $ref: '#/components/schemas/ImageContentBlock'
              - $ref: '#/components/schemas/DocumentContentBlock'
            discriminator:
              propertyName: type
              mapping:
                document: '#/components/schemas/DocumentContentBlock'
                encrypted: '#/components/schemas/EncryptedContentBlock'
                image: '#/components/schemas/ImageContentBlock'
                json: '#/components/schemas/JsonContentBlock'
                refusal: '#/components/schemas/RefusalContentBlock'
                text: '#/components/schemas/TextContentBlock'
          type: array
          title: Content
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - content
      title: ErrorSpan
    UnknownSpan:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: unknown
          title: Type
        content:
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContentBlock'
              - $ref: '#/components/schemas/JsonContentBlock'
              - $ref: '#/components/schemas/EncryptedContentBlock'
              - $ref: '#/components/schemas/RefusalContentBlock'
              - $ref: '#/components/schemas/ImageContentBlock'
              - $ref: '#/components/schemas/DocumentContentBlock'
            discriminator:
              propertyName: type
              mapping:
                document: '#/components/schemas/DocumentContentBlock'
                encrypted: '#/components/schemas/EncryptedContentBlock'
                image: '#/components/schemas/ImageContentBlock'
                json: '#/components/schemas/JsonContentBlock'
                refusal: '#/components/schemas/RefusalContentBlock'
                text: '#/components/schemas/TextContentBlock'
          type: array
          title: Content
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - content
      title: UnknownSpan
    EnumFieldSchema:
      properties:
        type:
          type: string
          const: enum
          title: Type
        options:
          items:
            type: string
          type: array
          title: Options
        multi:
          type: boolean
          title: Multi
          default: false
        open:
          type: boolean
          title: Open
          default: true
      type: object
      required:
        - type
      title: EnumFieldSchema
      description: A field the reviewer fills by picking from a list of options.
    BooleanFieldSchema:
      properties:
        type:
          type: string
          const: boolean
          title: Type
      type: object
      required:
        - type
      title: BooleanFieldSchema
      description: A field the reviewer toggles between true and false.
    JsonFieldSchema:
      properties:
        type:
          type: string
          const: json
          title: Type
      type: object
      required:
        - type
      title: JsonFieldSchema
      description: >-
        A field holding arbitrary JSON, which the reviewer edits as a single
        value.
    TagSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          type: string
          title: Color
      type: object
      required:
        - id
        - name
        - color
      title: TagSummary
      description: A tag attached to a trace.
    TraceEventResponse:
      properties:
        id:
          type: string
          title: Id
        org_id:
          type: string
          title: Org Id
        trace_id:
          type: string
          title: Trace Id
        event_type:
          $ref: '#/components/schemas/EventType'
        actor_type:
          $ref: '#/components/schemas/ActorType'
        actor_id:
          type: string
          title: Actor Id
        occurred_at:
          type: string
          format: date-time
          title: Occurred At
        trace_version_before:
          anyOf:
            - type: integer
            - type: 'null'
          title: Trace Version Before
        trace_version_after:
          type: integer
          title: Trace Version After
        status_before:
          anyOf:
            - $ref: '#/components/schemas/TraceStatus'
            - type: 'null'
        status_after:
          anyOf:
            - $ref: '#/components/schemas/TraceStatus'
            - type: 'null'
        final_output_before:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Final Output Before
        final_output_after:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Final Output After
        corrected_output_before:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Corrected Output Before
        corrected_output_after:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Corrected Output After
      type: object
      required:
        - id
        - org_id
        - trace_id
        - event_type
        - actor_type
        - actor_id
        - occurred_at
        - trace_version_after
      title: TraceEventResponse
      description: >-
        An entry in a trace's review history. Webhook deliveries use the same
        shape.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TextContentBlock:
      properties:
        type:
          type: string
          const: text
          title: Type
        value:
          type: string
          title: Value
      additionalProperties: false
      type: object
      required:
        - type
        - value
      title: TextContentBlock
    JsonContentBlock:
      properties:
        type:
          type: string
          const: json
          title: Type
        value:
          $ref: '#/components/schemas/JsonValue'
      additionalProperties: false
      type: object
      required:
        - type
        - value
      title: JsonContentBlock
    EncryptedContentBlock:
      properties:
        type:
          type: string
          const: encrypted
          title: Type
        value:
          type: string
          title: Value
      additionalProperties: false
      type: object
      required:
        - type
        - value
      title: EncryptedContentBlock
    RefusalContentBlock:
      properties:
        type:
          type: string
          const: refusal
          title: Type
        value:
          type: string
          title: Value
      additionalProperties: false
      type: object
      required:
        - type
        - value
      title: RefusalContentBlock
    ImageContentBlock:
      properties:
        type:
          type: string
          const: image
          title: Type
        source:
          oneOf:
            - $ref: '#/components/schemas/ImageMediaSource'
            - $ref: '#/components/schemas/ImageUrlSource'
          title: Source
          discriminator:
            propertyName: type
            mapping:
              base64: '#/components/schemas/ImageMediaSource'
              url: '#/components/schemas/ImageUrlSource'
      additionalProperties: false
      type: object
      required:
        - type
        - source
      title: ImageContentBlock
    DocumentContentBlock:
      properties:
        type:
          type: string
          const: document
          title: Type
        source:
          $ref: '#/components/schemas/DocumentMediaSource'
      additionalProperties: false
      type: object
      required:
        - type
        - source
      title: DocumentContentBlock
    EventType:
      type: string
      enum:
        - trace.created
        - trace.deleted
        - trace.restored
        - trace.reset
        - review.approved
        - review.rejected
        - review.corrected
      title: EventType
      description: What happened to the trace.
    ActorType:
      type: string
      enum:
        - user
        - api_key
        - system
        - demo_seed
      title: ActorType
      description: 'Who acted: `user` for the Web Console, `api_key` for an API key.'
    JsonValue: {}
    ImageMediaSource:
      properties:
        type:
          type: string
          const: base64
          title: Type
        media_type:
          type: string
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
          title: Media Type
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        value:
          type: string
          title: Value
      additionalProperties: false
      type: object
      required:
        - type
        - media_type
        - value
      title: ImageMediaSource
    ImageUrlSource:
      properties:
        type:
          type: string
          const: url
          title: Type
        url:
          type: string
          title: Url
      additionalProperties: false
      type: object
      required:
        - type
        - url
      title: ImageUrlSource
      description: >-
        An image the trace links to rather than embeds. Tuor shows the link and
        never fetches it.
    DocumentMediaSource:
      properties:
        type:
          type: string
          const: base64
          title: Type
        media_type:
          type: string
          const: application/pdf
          title: Media Type
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        value:
          type: string
          title: Value
      additionalProperties: false
      type: object
      required:
        - type
        - media_type
        - value
      title: DocumentMediaSource
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

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