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

# Scores added via API not displaying in UI

export const plans_0 = "Any"

export const deployments_0 = "Braintrust-hosted"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Programmatically adding scores to existing traces via API"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## Summary

**Issue:** Scores submitted via the Braintrust feedback API do not appear in the UI for existing traces, and instead create new trace entries with the provided `span_id` and `root_span_id`.

**Cause:** The `span_id` used in the API payload does not match the actual `id` property in the raw trace data.

**Resolution:** Use the correct `id` from the raw span data when submitting scores via the feedback API.

## Resolution Steps

### Step 1: Get the correct span ID

Navigate to the trace in the Braintrust UI and click the "Raw span and trace data" button to view the underlying JSON.

### Step 2: Identify the ID field

Locate the `id` property in the raw trace data JSON - this is the value you need to use in your API calls.

### Step 3: Update your API payload

Use the `id` from the raw data as the `span_id` in your feedback API payload:

```text theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
payload = {
    "events": [
        {
            "span_id": "correct-id-from-raw-data",
            "root_span_id": "correct-id-from-raw-data",
            "scores": 0.0,
            "metadata": feedback_update["metadata"],
            "_is_merge": True,
            "_merge_paths": merge_paths,
        }
    ]
}

```

### Step 4: Verify the score appears

Refresh the trace view in the UI to confirm the score is now attached to the existing trace instead of creating a new one.
