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

# Update Trace

> Use this endpoint to update an existing trace.



## OpenAPI

````yaml PUT /api/v1/traces/{id}
openapi: 3.1.0
info:
  version: 0.0.1
  title: Prem Studio API
  description: Studio autofinetuning agent API
servers:
  - url: http://studio.premai.io
    description: Current environment
  - url: https://studio.premai.io
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/traces/{id}:
    put:
      tags:
        - Traces
      description: Update individual trace
      operationId: traces.update
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TraceUpdateRequest'
      responses:
        '200':
          description: success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trace'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TraceUpdateRequest:
      type: object
      properties:
        score:
          type: number
          minimum: 0
          maximum: 1
          description: Updated evaluator score between 0 and 1.
        feedback:
          type: string
          nullable: true
          maxLength: 2048
          description: Updated feedback text for this trace.
        projectId:
          type: string
          nullable: true
          format: uuid
          description: Project to associate with the trace.
    Trace:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique trace identifier.
        createdAt:
          type: string
          format: date-time
          description: ISO timestamp representing when the trace was recorded.
        modelId:
          type: string
          description: Model identifier attached to the trace.
        projectId:
          type: string
          nullable: true
          format: uuid
          description: Project identifier, null when the trace is not linked to a project.
        input:
          type: string
          description: Prompt or message provided to the model.
        output:
          type: string
          description: Model response captured for the trace.
        score:
          type: number
          nullable: true
          minimum: 0
          maximum: 1
          description: Score between 0 and 1. Null when the trace has not been scored yet.
        feedback:
          type: string
          nullable: true
          maxLength: 2048
          description: Feedback provided for the trace.
        addedToDataset:
          type: boolean
          description: Flag indicating whether the trace is already in the dataset.
        processingStatus:
          type: string
          enum:
            - none
            - processing
            - failed
          description: >-
            Background processing status used when generating improved
            datapoints.
      required:
        - id
        - createdAt
        - modelId
        - projectId
        - input
        - output
        - score
        - feedback
        - addedToDataset
        - processingStatus
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````