> ## 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.

# Flagging users for review via API

export const plans_0 = "Any"

export const deployments_0 = "Any"

export const data_plane_version_0 = undefined

export const use_case_0 = undefined

<Note>
  **Applies to:**

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

Summary

**Goal:** Flag logs for review and assign them to specific users via the project logs API.

**Features:** Project logs insert endpoint, metadata merge operations, review list management, and user assignments.

## Configuration Steps

### Step 1: Flag a log for review

Use the project logs insert endpoint with the review list metadata structure and merge operation.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl --location 'https://api.braintrust.dev/v1/project_logs/{project_id}/insert' \
--header 'Authorization: Bearer sk-your-api-key' \
--header 'Content-Type: application/json' \
--data '{
    "events": [{
        "id": "your-log-id",
        "metadata": {
            "~__bt_review_lists": {
                "__bt_default_review_list": {
                    "status": "PENDING"
                }
            }
        },
        "_is_merge": true,
        "_merge_paths": [
            ["metadata", "~__bt_review_lists"]
        ]
    }]
}'

```

### Step 2: Assign a user to the flagged log

Add the user ID to the \~\_\_bt\_assignments array in the metadata field.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl --location 'https://api.braintrust.dev/v1/project_logs/{project_id}/insert' \
--header 'Authorization: Bearer sk-your-api-key' \
--header 'Content-Type: application/json' \
--data '{
    "events": [{
        "id": "your-log-id",
        "metadata": {
            "~__bt_assignments": [
                "user-id-here"
            ],
            "~__bt_review_lists": {
                "__bt_default_review_list": {
                    "status": "PENDING"
                }
            }
        },
        "_is_merge": true,
        "_merge_paths": [
            ["metadata", "~__bt_assignments"]
        ]
    }]
}'

```

### Step 3: Obtain user IDs

Retrieve user IDs from the Braintrust organization settings or users API endpoint before assignment.

## Key Fields

* **\~\_\_bt\_review\_lists:** Contains review list configuration with status (PENDING, APPROVED, REJECTED)
* **\~\_\_bt\_assignments:** Array of user IDs assigned to review the log
* **\_is\_merge:** Must be true to update existing log entries
* **\_merge\_paths:** Specifies which metadata fields to merge

<Note>
  Setting `~__bt_assignments` alone is sufficient for assigned rows to be marked complete from the [**<Icon icon="list-checks" /> Review**](https://www.braintrust.dev/app/~/review) page. Setting the `~__bt_review_lists` status to `PENDING` remains recommended so the rows also appear in status-based review filters such as **Awaiting review**.
</Note>
