Skip to main content
Applies to:


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