Skip to main content
These methods add runs to annotation queues and read them back, share runs publicly, and create feedback. For deprecation dates, minimum SDK versions, and the agent prompt that applies to every method, see Migrate to SmithDB-backed APIs.

Annotation queues: add runs

Add runs to an annotation queue. The legacy POST /api/v1/annotation-queues/{queue_id}/runs and POST /api/v1/annotation-queues/{queue_id}/runs/by-key endpoints are both deprecated. Use the annotation queue items API instead: each run is one RUN item with its ID plus the project_id (project UUID) and start_time lookup keys, so the run can be located directly instead of scanned for.
In Python and TypeScript, the items API is on the new client resources (client.annotation_queues.items / client.annotationQueues.items), so the Exceptions table applies. On self-hosted, the items endpoints need LangSmith v0.16.14 or later.

Main changes

Method name

Inputs

The request takes a list of items (up to 100 per call) instead of a list of run IDs. Each run becomes one item: extend_trace_retention is unchanged. It stays an optional query parameter and defaults to false. When omitted, adding runs does not change their retention. Set it to true to upgrade the traces of added runs from base to extended retention, as described in Data retention auto-upgrades. Thread items are not upgraded.

Response

The items API returns {"items": [...]}, one created queue item per input (id, queue_id, item_type, run_id, project_id, start_time, added_at, last_reviewed_time). Use the item id with the other items endpoints (update, delete, status). The legacy Python and TypeScript methods returned nothing.

Examples

Add runs to a queue

Build one RUN item per run from the run objects you already have.
Before

Annotation queues: read runs

List and count the runs in an annotation queue. The legacy GET /api/v1/annotation-queues/{queue_id}/runs, GET /api/v1/annotation-queues/{queue_id}/run/{index}, and GET /api/v1/annotation-queues/{queue_id}/size endpoints are deprecated, as are total_size and total_archived. Use the annotation queue items API instead: list or count the items in one review status, then fetch each run with the lookup keys on its item.
In Python and TypeScript, the items API is on the new client resources (client.annotation_queues.items / client.annotationQueues.items). The Exceptions table applies to them. On self-hosted, listing items needs LangSmith v0.16.17 or later. retrieve_placement needs v0.16.20 or later. The count endpoint needs v0.17.1 or later. No 0.16 release includes it.

Main changes

Method name

There is no lookup by index. To read the run at a position, page through the list with page_size and the cursor from the previous page. To find an item’s position, use retrieve_placement. The method is retrievePlacement in TypeScript and Java, GetPlacement in Go, and GET /api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/placement in cURL. It returns the item’s review status (section), zero-based position, and a cursor for listing from that point. The cursor counts runs and threads together and ignores start-time bounds. Pass it only to a list request without item_type, min_start_time, or max_start_time.

Review status

The items API requires a status. The legacy endpoints defaulted to needs_my_review when you omitted it. The legacy archived=true flag on the list endpoint also maps to archived. The items API does not accept completed. needs_my_review and needs_others_review are relative to the caller. A personal access token returns its owner’s split. A service key returns the split for its service account, not for any human reviewer. Together they cover every item still in the queue. For counts, the legacy totals map to:

Item type

The items API returns runs and threads. Pass item_type as RUN to list only runs, as the legacy endpoints did. The count endpoint has no item_type filter, so counts include thread items.

Response

Each item holds the run’s lookup keys (run_id, project_id, start_time) and queue metadata (id, added_at, last_reviewed_time, reserved_by, completed_by), not the run itself. To read a run’s name, inputs, or outputs, pass those keys to the run retrieve method. The list returns an opaque next_cursor for pagination. The SDKs iterate across pages for you. The count endpoint returns {"count": <n>} instead of {"size": <n>}.

Examples

List and count runs waiting for review

The legacy Python client had no size method, so the count is new.
Before

Share and read public runs

Share a trace, remove its public access, or read the runs in a publicly shared trace. The v2 methods use explicit SmithDB coordinates and return select-driven run objects. Public read methods do not require a LangSmith API key. Treat the share token as a secret because anyone with the token can read the shared trace.

Main changes

Method names

The v2 resource methods are async. Call them with await.

Share and unshare parameters

  • runs.share.create takes the run ID as its positional argument. Pass session_id (the tracing project UUID) and trace_id (the root trace UUID).
  • runs.share.delete takes the root trace ID, not an arbitrary child run ID. Pass the tracing project UUID as session_id.
  • share_id is removed. The server generates the share token.
Although generated parameter types may mark these coordinates as optional, provide session_id and trace_id when sharing, and provide session_id when unsharing. SmithDB uses these coordinates for the lookup.

Public read parameters

  • public.runs.query takes the share token and a selects list. The token scopes the query to the complete shared trace. The legacy run-ID filter and cursor response are removed.
  • public.runs.retrieve requires the run ID, share token, exact run start_time, and a selects list. Obtain the exact stored start time from public.runs.query.
  • The public point read returns only selected fields. Use ID, NAME, RUN_TYPE, STATUS, and START_TIME for the examples below.
  • To retrieve the public URL for an authenticated run, call runs.retrieve with selects=["SHARE_URL"], then read run.share_url. Supplying start_time gives SmithDB the most efficient lookup.
Do not construct the public URL from the API origin. Retrieving share_url uses the deployment’s configured application origin and works for both Cloud and self-hosted deployments.

Responses

Examples

The examples query the public trace before the point read because public.runs.retrieve requires the run’s exact stored start_time.

Feedback: create

Create feedback (a score, correction, or comment) for a run.

Main changes

Required parameter

The method name and endpoint are unchanged. Only the session (project) ID requirement changes.
create_feedback now requires session_id, the UUID of the project (session) that owns the run. It was previously optional.
SmithDB-only self-hosted below v0.18: also pass the run’s start time. Without it, feedback on a run that started more than a few hours ago (6 hours with the default Helm chart settings) can fail or be dropped.

Examples

Provide session_id when creating feedback

On SmithDB-only self-hosted below v0.18, also pass the run’s start time, as described in the preceding note.
create_feedback now requires session_id in addition to run_id.
Before

See also