threads

Query Thread Traces

Alpha: The request and response contract may change; Retrieve all traces belonging to a specific thread within a project.

get/v2/threads/{thread_id}/traces

Path parameters

thread_idstring required

Thread ID

Query parameters

cursorstring

cursor is the opaque string from a previous response's next_cursor. Omit on the first request; pass the returned cursor to fetch the next page.

filterstring

filter narrows which traces are returned for this thread, using a LangSmith filter expression evaluated against each root trace run. For example: eq(status, "success") or has(tags, "production"). See https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language for syntax.

page_sizeinteger

page_size is the maximum number of traces to return in this response. Defaults to 20 when omitted; must be between 1 and 100 inclusive when set.

project_idstring uuid required

project_id is the tracing project UUID (required).

selectsstring[]

selects lists which properties to include on each returned trace (repeatable query parameter). Accepts any value of the ThreadTraceSelectField enum. Properties not listed are omitted from each trace object; trace_id is always returned.

Response

items and pagination

next_cursorstring

next_cursor is the opaque cursor to pass as cursor on the next request. Omitted on the final page.

Example response

{
  "items": [
    {
      "end_time": "2025-01-15T12:00:01.500Z",
      "first_token_time": "2024-01-15T10:30:00.312Z",
      "start_time": "2025-01-15T12:00:00.000Z",
      "thread_id": "d4e5f6a7-b8c9-4d5e-1f2a-3b4c5d6e7f8a",
      "trace_id": "018e4c7e-a9fb-7ef0-a5b6-6ea3a82e9327"
    }
  ],
  "next_cursor": "eyJydW5zX2N1cnNvciI6Imx0KGN1cnNvciwiLi4uIikifQ=="
}

Changes

Changed in 2 of the 48 revisions of this API.1433

  • a0acb3a6a101128See the full diff
    • removed the optional property has_more from the response with the 200 status

      response-optional-property-removed

    • the endpoint scheme security API Key AND Tenant ID was added to the API

      api-security-added

    • the endpoint scheme security Bearer Auth AND Tenant ID was added to the API

      api-security-added

    • the endpoint scheme security API Key was removed from the API

      api-security-removed

    • the endpoint scheme security Bearer Auth was removed from the API

      api-security-removed

    • the endpoint scheme security Tenant ID was removed from the API

      api-security-removed

    • added the non-success response with the status 401

      response-non-success-status-added

    • added the non-success response with the status 404

      response-non-success-status-added

    • added the non-success response with the status 500

      response-non-success-status-added

    • added the non-success response with the status 503

      response-non-success-status-added

    • added the non-success response with the status 504

      response-non-success-status-added

    • added the optional property detail to the response with the 400 status

      response-optional-property-added

    • added the optional property detail to the response with the 403 status

      response-optional-property-added

    • added the optional property detail to the response with the 422 status

      response-optional-property-added

    • added the optional property instance to the response with the 400 status

      response-optional-property-added

    • added the optional property instance to the response with the 403 status

      response-optional-property-added

    • added the optional property instance to the response with the 422 status

      response-optional-property-added

    • added the optional property remedy to the response with the 400 status

      response-optional-property-added

    • added the optional property remedy to the response with the 403 status

      response-optional-property-added

    • added the optional property remedy to the response with the 422 status

      response-optional-property-added

    • added the optional property status to the response with the 400 status

      response-optional-property-added

    • added the optional property status to the response with the 403 status

      response-optional-property-added

    • added the optional property status to the response with the 422 status

      response-optional-property-added

    • added the optional property title to the response with the 400 status

      response-optional-property-added

    • added the optional property title to the response with the 403 status

      response-optional-property-added

    • added the optional property title to the response with the 422 status

      response-optional-property-added

    • added the optional property type to the response with the 400 status

      response-optional-property-added

    • added the optional property type to the response with the 403 status

      response-optional-property-added

    • added the optional property type to the response with the 422 status

      response-optional-property-added

    This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 99490d1e837e135See the full diff
    • added the new required query request parameter project_id

      new-required-request-parameter

    • deleted the query request parameter limit

      request-parameter-removed

    • deleted the query request parameter select

      request-parameter-removed

    • deleted the query request parameter session_id

      request-parameter-removed

    • added the new optional query request parameter page_size

      new-optional-request-parameter

    • added the new optional query request parameter selects

      new-optional-request-parameter

    • added the optional property has_more to the response with the 200 status

      response-optional-property-added

    • added the optional property items to the response with the 200 status

      response-optional-property-added

    • added the optional property next_cursor to the response with the 200 status

      response-optional-property-added

    This revision also has 15 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog