---
title: "Update Span"
method: PATCH
path: "/v2/projects/{project_id}/spans/{span_id}"
tags: ["trace"]
---

# Update Span

`PATCH /v2/projects/{project_id}/spans/{span_id}`

Update a span with the given ID.

## Path parameters

- `span_id` string, uuid4, required
- `project_id` string, uuid4, required

## Request body

- LogSpanUpdateRequest — Request model for updating a span.
  - `log_stream_id` string, uuid4, nullable — Log stream id associated with the traces.
  - `experiment_id` string, uuid4, nullable — Experiment id associated with the traces.
  - `metrics_testing_id` string, uuid4, nullable — Metrics testing id associated with the traces.
  - `logging_method` 'playground' | 'python_client' | 'typescript_client' | 'api_direct'
  - `client_version` string, nullable
  - `reliable` boolean — Whether or not to use reliable logging. If set to False, the method will respond immediately before verifying that the traces have been successfully ingested, and no error message will be returned if ingestion fails. If set to True, the method will wait for the traces to be successfully ingested or return an error message if there is an ingestion failure.
  - `span_id` string, uuid4, required — Span id to update.
  - `input` union — Input of the span. Overwrites previous value if present.
    - string
    - GalileoCoreSchemasLoggingLlmMessage[]
      - `content` union, required
        - string
        - union[]
          - union
            - TextContentPart — A text segment within a message.
              - …
            - FileContentPart — Reference to a file associated with this message. The file_id can be resolved via the ``files`` dict returned on trace/span detail responses, which contains metadata such as modality, MIME type, and a presigned download URL.
              - …
      - `role` 'agent' | 'assistant' | 'developer' | 'function' | 'system' | 'tool' | 'user', required
      - `tool_call_id` string, nullable
      - `tool_calls` ToolCall[], nullable
        - `id` string, required
        - `function` ToolCallFunction, required
          - `name` string, required
          - `arguments` string, required
    - union[]
      - union
        - TextContentPart — A text segment within a message.
          - `type` 'text'
          - `text` string, required
        - FileContentPart — Reference to a file associated with this message. The file_id can be resolved via the ``files`` dict returned on trace/span detail responses, which contains metadata such as modality, MIME type, and a presigned download URL.
          - `type` 'file'
          - `file_id` string, uuid4, required
  - `output` union — Output of the span. Overwrites previous value if present.
    - string
    - GalileoCoreSchemasLoggingLlmMessage
      - `content` union, required
        - string
        - union[]
          - union
            - TextContentPart — A text segment within a message.
              - …
            - FileContentPart — Reference to a file associated with this message. The file_id can be resolved via the ``files`` dict returned on trace/span detail responses, which contains metadata such as modality, MIME type, and a presigned download URL.
              - …
      - `role` 'agent' | 'assistant' | 'developer' | 'function' | 'system' | 'tool' | 'user', required
      - `tool_call_id` string, nullable
      - `tool_calls` ToolCall[], nullable
        - `id` string, required
        - `function` ToolCallFunction, required
          - `name` string, required
          - `arguments` string, required
    - DocumentInput[]
      - `page_content` string, required — Content of the document.
      - `metadata` object
    - union[]
      - union
        - TextContentPart — A text segment within a message.
          - `type` 'text'
          - `text` string, required
        - FileContentPart — Reference to a file associated with this message. The file_id can be resolved via the ``files`` dict returned on trace/span detail responses, which contains metadata such as modality, MIME type, and a presigned download URL.
          - `type` 'file'
          - `file_id` string, uuid4, required
    - ControlResult
      - `action` 'deny' | 'steer' | 'observe', required
      - `matched` boolean, required — Whether the control matched. False covers both non-match and error cases; use error_message to distinguish errors.
      - `confidence` number, nullable — Confidence score reported by the control evaluation result.
      - `error_message` string, nullable — Error text when control evaluation failed. This should be null for normal matches and non-matches.
  - `tags` string[], nullable — Tags to add to the span.
  - `status_code` integer, nullable — Status code of the span. Overwrites previous value if present.
  - `duration_ns` integer, nullable — Duration in nanoseconds. Overwrites previous value if present.

## Response `200`

Successful Response

- LogSpanUpdateResponse
  - `log_stream_id` string, uuid4, nullable — Log stream id associated with the traces.
  - `experiment_id` string, uuid4, nullable — Experiment id associated with the traces.
  - `metrics_testing_id` string, uuid4, nullable — Metrics testing id associated with the traces.
  - `project_id` string, uuid4, required — Project id associated with the traces.
  - `project_name` string, required — Project name associated with the traces.
  - `session_id` string, uuid4, nullable — Session id associated with the traces.
  - `records_count` integer, required — Total number of records ingested
  - `span_id` string, uuid4, required — Span id associated with the updated span.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/galileo/apis/galileo-api-server.md) · [All operations](https://skmtc.net/galileo/apis/galileo-api-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/galileo/galileo-api-server/versions/933e8c8e6366/schema)
