Search and list spans matching a set of filters, returning a keyset-paginated page.
Filters in the request body include trace and span ids, names, statuses,
types, free-text search, metadata, duration bounds, and more, scoped to an
optional time window. Results are keyset-paginated on indexed columns rather
than offset-paginated, and total is not computed (it is always 0); use the
pagination cursors to page through results. Reads route to the legacy trace
store or the tracing service per account (with fallback to the legacy trace
store outside strict mode), and results are narrowed to traces the caller is authorized to
read — a filter that resolves to no authorized traces yields an empty page
rather than an error. A reversed time window (from_ts after to_ts) is
rejected with 422, as is a request whose combined trace_ids, span_ids,
excluded_span_ids, excluded_trace_ids, and parent_ids count exceeds
10000. sort_by accepts start_timestamp, duration_ms,
input_tokens and output_tokens; the token counts are read from usage
reported at ingest, and a span whose producer reported none sorts as zero, so
it lands last descending and first ascending. The two token sorts are rejected
for an account still served by the legacy trace store, which keeps no token count
to order by. Any other unsupported sort falls back to timestamp order there.
Spans sharing a sort key are ordered by trace_id and id bytewise on both
tracing-service engines. Text search tokenization, indexed-prefix, word-length,
locale and metadata-bytes behavior differs between Postgres and ClickHouse
deployments of the tracing service as the search_texts field describes.
x-project-id narrows the result to traces whose root span carries that project,
when PROJECT_SCOPED_SPAN_LISTING is on for the account, on either store.
Return however many spans fit the server byte budget instead of a 400 SEARCH_RESULT_TOO_LARGE, reporting the rest through has_more plus next_cursor going forward or prev_cursor going back. A search that spends its time budget before the page fills also returns what it found, with search_status partial, searched_through and a next_cursor that resumes from there. Send it only if the client reads has_more, because under it a page shorter than limit no longer means the end of the list. Honored by the tracing service on either of its storage engines. Accounts still served by the legacy trace store ignore it and page by item count, where a short page still means the end of the list.
Filter by trace IDs. The combined count of trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, parent_ids, and (trace_id, span_id) pairs (each pair counting 2) may not exceed 10000. A request over that returns 422.
Filter by exact (trace_id, span_id) identity. Unlike span_ids, a pair never matches a same-id span from another trace. ANDs with span_ids when both are set.
List of (trace_id, span_id) identities to exclude from results. Unlike excluded_span_ids, a pair never excludes a same-id span from another trace. Takes precedence over excluded_span_ids when both are set.
Case-insensitive text search across span name, input, output, and metadata. A single-word term of ASCII letters and digits matches as a whole word in input, output, and metadata, and as a substring of the name. A term of up to 8 such words matches as a contiguous phrase whose words each appear as whole words. All other terms (punctuated, non-ASCII, longer) match as substrings, where mid-word fragments match and an inflected form such as a plural matches only where it appears literally. Wrapping a term in double quotes makes it a phrase: the quotes mark the phrase and are never matched, a backslash escapes a quote or a backslash inside them, the phrase must appear contiguously inside one searched value (the input, the output, or the metadata), a phrase of up to 8 ASCII letter-and-digit words additionally requires each of those words to appear there as a whole word, and a UUID-shaped phrase stays a text search. A term whose quote is unterminated or left unescaped mid-term is matched literally, quotes included. Multiple terms are ANDed, and UUID-shaped terms match trace IDs instead. A span must match every non-UUID term, and each term may match any of the searched fields. UUID matches are ORed onto the text match. Each term must be at least 2 characters, measured between the quotes and ignoring outer whitespace for a phrase, and at most 10 terms are supported. For exact trace ID lookup, use the trace_ids filter. The tracing service runs on either ClickHouse or Postgres, and the two engines match differently. On Postgres deployments the whole-word match uses the simple text-search parser, which keeps hosts, e-mail addresses, file paths, version strings, hyphenated compounds, URLs and query strings as single words (https://x.com/path?q=1 yields x.com/path?q=1, x.com and /path?q=1, never path, q or 1; user@example.com and v1.2.3 are one word each; gpt-4o yields the compound and its parts), whereas ClickHouse deployments split on every non-alphanumeric ASCII byte. A single word inside such a value is a whole-word hit on ClickHouse and a miss on Postgres; the substring forms behave identically on both. On Postgres deployments a value over 80000 bytes has only its first 20000 characters indexed for whole-word matching; text past that is reachable only by the substring forms. Words longer than 2047 bytes are matched as substrings, never as whole words. Case folding of non-ASCII text follows the database's LC_CTYPE on Postgres deployments, for the whole-word index, the quoted-phrase and substring forms and the word-boundary check alike; under a C-locale database non-ASCII letters are not folded. ASCII folds everywhere. Input and output behave identically on both engines. A substring-form term, or a text-filtered metrics request, reads every row of the time window that survives the other filters. A term that matches too many rows in the window is refused by the tracing service as QUERY_TOO_BROAD, at an engine-specific threshold, and on Postgres deployments a read whose sorts or hashes, the text candidate sets included, outgrow the deployment's work memory and its temp-file bound is refused as QUERY_TEMP_FILE_LIMIT_EXCEEDED, a code ClickHouse deployments never return and one a read without text can also earn. This API relays either refusal as a 400 carrying the tracing service's detail, never as a page from the legacy trace store, and an export's refusal is reported as the failed export's reason on the export status, not on the POST. On Postgres deployments each term is counted on its own, in every class (whole word, phrase and substring alike) and on every read that carries text, and is refused when it alone matches more than 50000 rows of the window that survive the other filters, with or without assessment_types. On ClickHouse deployments the refusal is the candidate-set cap, a deployment-configured limit counted over the matches of all terms together: a search page bounds its candidates to the page, so there the cap is a backstop rather than a limit a common term meets; metrics and by-span resolve every match and can trip it; and an export runs under its own 2000000-row set cap on every request, assessment_types included. Accounts still served by the legacy trace store match differently until migrated: every term matches as stemmed whole words (so inflected forms match and multi-word terms match word-adjacent), only input and output are searched, the 2-character minimum is not enforced, quoting a term changes nothing (the quotes are stripped and a multi-word term is already matched word-adjacent), and characters like :, |, or ! inside a term may be interpreted as query operators or cause an error.
Filter on custom metadata: each key must equal its value, or any value of an array, and keys are ANDed. On the ClickHouse read path $or and $and also compose nested groups of predicates. On Postgres a $-prefixed key is an ordinary metadata key matched literally. Array values match element-wise; a negative zero inside an array equals zero on Postgres-served accounts and not on ClickHouse-served ones.
Filter to the business spans that executed in any of these observability traces (the obs-to-business reverse lookup). Each id must be 32 lowercase hex characters. Served only by the sgp-traces service, so a request using this filter against an account still on the legacy store returns 422 rather than silently ignoring it.
Filter to the business spans that executed in any of these observability spans. Each id must be 16 lowercase hex characters. A W3C span id is unique per trace only, so combine with obs_trace_ids for exact identity, the same looseness span_ids carries versus the spans pair filter. ANDs with obs_trace_ids when both are set. Served only by the sgp-traces service, so a request using this filter against an account still on the legacy store returns 422 rather than silently ignoring it.
Minimum span duration in milliseconds (inclusive). Matched on completed duration, so a span with no end time is not reliably returned: fetch it by its own id or in its trace's span list.
Maximum span duration in milliseconds (inclusive). Matched on completed duration, so a span with no end time is never returned: fetch it by its own id or in its trace's span list.
Accounts still served by the legacy trace store keyset-paginate on the span
id and leave these unset, except that a page the legacy store serves as a
fallback for a tracing-service account, or in continuation of a fallback
cursor, carries cursors this API mints so later pages stay on the legacy
store. The tracing service, on either of its storage engines, returns opaque
cursors that clients must round-trip.
Whether more items remain in the direction of travel. Under allow_partial_results this is the only end-of-list signal, since the byte or time budget can serve a page shorter than limit with rows still left.
True when the requested window exceeded the 90 day maximum and was clamped, so results cover only effective_from_ts..effective_to_ts. null when no clamp occurred.
complete when the page holds every match from the request's position to its last item or the end of the window. partial when an allow_partial_results search spent its time budget first: the page holds every match up to searched_through, and next_cursor resumes from there. null on accounts still served by the legacy trace store.
On a partial page, the start_timestamp the search covered up to in its scan order, oldest first for a descending sort. null on a complete page.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Scale AI","colors":{"primary":"#3f2e7b","light":"#ca62ff","dark":"#3f2e7b"},"logo":{"light":"https://mintcdn.com/scalegp/TBmst1qiYXwYqUB5/logo/light.png?fit=max\u0026auto=format\u0026n=TBmst1qiYXwYqUB5\u0026q=85\u0026s=46027042c16b373ac463148db5ad1d6b","dark":"https://mintcdn.com/scalegp/TBmst1qiYXwYqUB5/logo/dark.png?fit=max\u0026auto=format\u0026n=TBmst1qiYXwYqUB5\u0026q=85\u0026s=02733f39d684d796ec742853eabf0de5"},"favicon":"https://mintcdn.com/scalegp/1vQnbXFkjbQbcgd1/favicon.png?fit=max\u0026auto=format\u0026n=1vQnbXFkjbQbcgd1\u0026q=85\u0026s=f52c84ba46a7cca58551673616dabe9c","background":{"decoration":"windows"},"navbar":{"links":[],"primary":{"type":"button","label":"Platform","href":"https://app.sgp.scale.com/"}},"footer":{"socials":{"x":"https://x.com/scale_ai","facebook":"https://www.facebook.com/scaleapi","linkedin":"https://www.linkedin.com/company/scaleai"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"scalegp","hasAudioNarration":false,"actualSubdomain":"scalegp","customDomains":["docs.gp.scale.com"],"gitSource":{"type":"github","owner":"scaleapi","repo":"sgp-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aecf0ec6829c68a2fb0d3c8","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"API Reference","count":235},{"language":"default","tag":"AgentOps API","count":141},{"language":"default","tag":"Guides","count":131},{"language":"default","tag":"Agentex API","count":97},{"language":"default","tag":"Evaluations","count":72},{"language":"default","tag":"Dex API","count":48},{"language":"default","tag":"Agents","count":44},{"language":"default","tag":"Evaluation Datasets","count":34},{"language":"default","tag":"Models","count":32},{"language":"default","tag":"Knowledge Bases","count":31}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"@font-face{font-family:'Aeonik';src:url('https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2');font-weight:normal;font-style:normal;font-display:swap}h1,h2,h3{font-family:'aeonik';letter-spacing:normal!important}"}],"page":{"pagePath":"reference/v5/spans/search-spans","slug":"/reference/v5/spans/search-spans","pageMetadata":{"title":"Search spans","description":"Search and list spans matching a set of filters, returning a keyset-paginated page.\n\nFilters in the request body include trace and span ids, names, statuses,\ntypes, free-text search, metadata, duration bounds, and more, scoped to an\noptional time window. Results are keyset-paginated on indexed columns rather\nthan offset-paginated, and ``total`` is not computed (it is always 0); use the\npagination cursors to page through results. Reads route to the legacy trace\nstore or the tracing service per account (with fallback to the legacy trace\nstore outside strict mode), and results are narrowed to traces the caller is authorized to\nread — a filter that resolves to no authorized traces yields an empty page\nrather than an error. A reversed time window (``from_ts`` after ``to_ts``) is\nrejected with 422, as is a request whose combined ``trace_ids``, ``span_ids``,\n``excluded_span_ids``, ``excluded_trace_ids``, and ``parent_ids`` count exceeds\n10000. ``sort_by`` accepts ``start_timestamp``, ``duration_ms``,\n``input_tokens`` and ``output_tokens``; the token counts are read from usage\nreported at ingest, and a span whose producer reported none sorts as zero, so\nit lands last descending and first ascending. The two token sorts are rejected\nfor an account still served by the legacy trace store, which keeps no token count\nto order by. Any other unsupported sort falls back to timestamp order there.\nSpans sharing a sort key are ordered by ``trace_id`` and ``id`` bytewise on both\ntracing-service engines. Text search tokenization, indexed-prefix, word-length,\nlocale and metadata-bytes behavior differs between Postgres and ClickHouse\ndeployments of the tracing service as the ``search_texts`` field describes.\n\n``x-project-id`` narrows the result to traces whose root span carries that project,\nwhen ``PROJECT_SCOPED_SPAN_LISTING`` is on for the account, on either store.","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/search","href":"/reference/v5/spans/search-spans","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Search and list spans matching a set of filters, returning a keyset-paginated page.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Filters in the request body include trace and span ids, names, statuses,\\ntypes, free-text search, metadata, duration bounds, and more, scoped to an\\noptional time window. Results are keyset-paginated on indexed columns rather\\nthan offset-paginated, and \", _jsx(_components.code, {\n children: \"total\"\n }), \" is not computed (it is always 0); use the\\npagination cursors to page through results. Reads route to the legacy trace\\nstore or the tracing service per account (with fallback to the legacy trace\\nstore outside strict mode), and results are narrowed to traces the caller is authorized to\\nread — a filter that resolves to no authorized traces yields an empty page\\nrather than an error. A reversed time window (\", _jsx(_components.code, {\n children: \"from_ts\"\n }), \" after \", _jsx(_components.code, {\n children: \"to_ts\"\n }), \") is\\nrejected with 422, as is a request whose combined \", _jsx(_components.code, {\n children: \"trace_ids\"\n }), \", \", _jsx(_components.code, {\n children: \"span_ids\"\n }), \",\\n\", _jsx(_components.code, {\n children: \"excluded_span_ids\"\n }), \", \", _jsx(_components.code, {\n children: \"excluded_trace_ids\"\n }), \", and \", _jsx(_components.code, {\n children: \"parent_ids\"\n }), \" count exceeds\\n10000. \", _jsx(_components.code, {\n children: \"sort_by\"\n }), \" accepts \", _jsx(_components.code, {\n children: \"start_timestamp\"\n }), \", \", _jsx(_components.code, {\n children: \"duration_ms\"\n }), \",\\n\", _jsx(_components.code, {\n children: \"input_tokens\"\n }), \" and \", _jsx(_components.code, {\n children: \"output_tokens\"\n }), \"; the token counts are read from usage\\nreported at ingest, and a span whose producer reported none sorts as zero, so\\nit lands last descending and first ascending. The two token sorts are rejected\\nfor an account still served by the legacy trace store, which keeps no token count\\nto order by. Any other unsupported sort falls back to timestamp order there.\\nSpans sharing a sort key are ordered by \", _jsx(_components.code, {\n children: \"trace_id\"\n }), \" and \", _jsx(_components.code, {\n children: \"id\"\n }), \" bytewise on both\\ntracing-service engines. Text search tokenization, indexed-prefix, word-length,\\nlocale and metadata-bytes behavior differs between Postgres and ClickHouse\\ndeployments of the tracing service as the \", _jsx(_components.code, {\n children: \"search_texts\"\n }), \" field describes.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"x-project-id\"\n }), \" narrows the result to traces whose root span carries that project,\\nwhen \", _jsx(_components.code, {\n children: \"PROJECT_SCOPED_SPAN_LISTING\"\n }), \" is on for the account, on either store.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Search spans","description":"Search and list spans matching a set of filters, returning a keyset-paginated page.\n\nFilters in the request body include trace and span ids, names, statuses,\ntypes, free-text search, metadata, duration bounds, and more, scoped to an\noptional time window. Results are keyset-paginated on indexed columns rather\nthan offset-paginated, and ``total`` is not computed (it is always 0); use the\npagination cursors to page through results. Reads route to the legacy trace\nstore or the tracing service per account (with fallback to the legacy trace\nstore outside strict mode), and results are narrowed to traces the caller is authorized to\nread — a filter that resolves to no authorized traces yields an empty page\nrather than an error. A reversed time window (``from_ts`` after ``to_ts``) is\nrejected with 422, as is a request whose combined ``trace_ids``, ``span_ids``,\n``excluded_span_ids``, ``excluded_trace_ids``, and ``parent_ids`` count exceeds\n10000. ``sort_by`` accepts ``start_timestamp``, ``duration_ms``,\n``input_tokens`` and ``output_tokens``; the token counts are read from usage\nreported at ingest, and a span whose producer reported none sorts as zero, so\nit lands last descending and first ascending. The two token sorts are rejected\nfor an account still served by the legacy trace store, which keeps no token count\nto order by. Any other unsupported sort falls back to timestamp order there.\nSpans sharing a sort key are ordered by ``trace_id`` and ``id`` bytewise on both\ntracing-service engines. Text search tokenization, indexed-prefix, word-length,\nlocale and metadata-bytes behavior differs between Postgres and ClickHouse\ndeployments of the tracing service as the ``search_texts`` field describes.\n\n``x-project-id`` narrows the result to traces whose root span carries that project,\nwhen ``PROJECT_SCOPED_SPAN_LISTING`` is on for the account, on either store.","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/search","href":"/reference/v5/spans/search-spans","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Spans"],"summary":"Search spans","description":"Search and list spans matching a set of filters, returning a keyset-paginated page.\n\nFilters in the request body include trace and span ids, names, statuses,\ntypes, free-text search, metadata, duration bounds, and more, scoped to an\noptional time window. Results are keyset-paginated on indexed columns rather\nthan offset-paginated, and ``total`` is not computed (it is always 0); use the\npagination cursors to page through results. Reads route to the legacy trace\nstore or the tracing service per account (with fallback to the legacy trace\nstore outside strict mode), and results are narrowed to traces the caller is authorized to\nread — a filter that resolves to no authorized traces yields an empty page\nrather than an error. A reversed time window (``from_ts`` after ``to_ts``) is\nrejected with 422, as is a request whose combined ``trace_ids``, ``span_ids``,\n``excluded_span_ids``, ``excluded_trace_ids``, and ``parent_ids`` count exceeds\n10000. ``sort_by`` accepts ``start_timestamp``, ``duration_ms``,\n``input_tokens`` and ``output_tokens``; the token counts are read from usage\nreported at ingest, and a span whose producer reported none sorts as zero, so\nit lands last descending and first ascending. The two token sorts are rejected\nfor an account still served by the legacy trace store, which keeps no token count\nto order by. Any other unsupported sort falls back to timestamp order there.\nSpans sharing a sort key are ordered by ``trace_id`` and ``id`` bytewise on both\ntracing-service engines. Text search tokenization, indexed-prefix, word-length,\nlocale and metadata-bytes behavior differs between Postgres and ClickHouse\ndeployments of the tracing service as the ``search_texts`` field describes.\n\n``x-project-id`` narrows the result to traces whose root span carries that project,\nwhen ``PROJECT_SCOPED_SPAN_LISTING`` is on for the account, on either store.","operationId":"POST-V5-/v5/spans/search","security":["bbd634fa-5a38-44e4-bc27-e5fe38f870b9"],"parameters":["be7f1d4b-61b8-409c-abe4-a52c3c47783a","9c2875ca-a569-462a-840d-cc1067b3cf05","56f9a139-f02d-4cfa-ac01-ac2e6fe00c73","14721522-8e88-4552-b198-16ebc82e472a","6702ba4e-49fb-4544-b5b5-1ceb68df2f3e","442056a2-0eb7-4583-99fa-fda42c29ba04","91d9d1cc-6cef-46ac-8f68-6fd2acbb2bda","ab01d998-5536-4a48-a376-076a32ebf404","19344925-5b0e-43b5-9209-82e573a5799f","4275b87b-cdf6-45ec-9347-09e7b121ae06"],"requestBody":"0def3f68-9968-47a3-b220-eb10d12ddcd8","responses":{"200":"cec22d21-e551-4d80-8a43-c470ac2943a3","400":"7d183be5-3099-40cc-9e3f-39151166843d","422":"f548a995-3316-45a9-9fa6-8bf75741a1f7","503":"910d70ea-de94-4519-93ec-4efc22fa70b3"},"method":"post","type":"path","servers":["53d4b40c-6ecb-41f0-8721-9b4723f67775"],"path":"/v5/spans/search","baseUrlOptions":["https://api.egp.scale.com"],"title":"Search spans","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"be7f1d4b-61b8-409c-abe4-a52c3c47783a":{"name":"allow_partial_results","in":"query","required":false,"schema":{"type":"boolean","description":"Return however many spans fit the server byte budget instead of a 400 SEARCH_RESULT_TOO_LARGE, reporting the rest through has_more plus next_cursor going forward or prev_cursor going back. A search that spends its time budget before the page fills also returns what it found, with search_status partial, searched_through and a next_cursor that resumes from there. Send it only if the client reads has_more, because under it a page shorter than limit no longer means the end of the list. Honored by the tracing service on either of its storage engines. Accounts still served by the legacy trace store ignore it and page by item count, where a short page still means the end of the list.","default":false,"title":"Allow Partial Results","isRequired":false,"uniqueKey":"","typeLabel":"boolean"},"description":"Return however many spans fit the server byte budget instead of a 400 SEARCH_RESULT_TOO_LARGE, reporting the rest through has_more plus next_cursor going forward or prev_cursor going back. A search that spends its time budget before the page fills also returns what it found, with search_status partial, searched_through and a next_cursor that resumes from there. Send it only if the client reads has_more, because under it a page shorter than limit no longer means the end of the list. Honored by the tracing service on either of its storage engines. Accounts still served by the legacy trace store ignore it and page by item count, where a short page still means the end of the list."},"9c2875ca-a569-462a-840d-cc1067b3cf05":{"name":"starting_after","in":"query","required":false,"schema":{"oneOf":[{"type":"string","title":"Starting After","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Starting After","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}},"56f9a139-f02d-4cfa-ac01-ac2e6fe00c73":{"name":"ending_before","in":"query","required":false,"schema":{"oneOf":[{"type":"string","title":"Ending Before","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Ending Before","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}},"14721522-8e88-4552-b198-16ebc82e472a":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":100,"title":"Limit","isRequired":false,"uniqueKey":"","typeLabel":"integer"}},"6702ba4e-49fb-4544-b5b5-1ceb68df2f3e":{"name":"sort_by","in":"query","required":false,"schema":{"oneOf":[{"type":"string","title":"Sort By","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Sort By","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}},"442056a2-0eb7-4583-99fa-fda42c29ba04":{"name":"sort_order","in":"query","required":false,"schema":{"oneOf":[{"type":"string","title":"SortOrder","default":"asc","enum":["asc","desc"],"uniqueKey":"oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Sort Order","default":"asc","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"enum\u003cstring> | null"}},"91d9d1cc-6cef-46ac-8f68-6fd2acbb2bda":{"name":"from_ts","in":"query","required":false,"schema":{"oneOf":[{"type":"string","title":"From Ts","description":"The starting (oldest) timestamp in ISO format.","format":"date-time","uniqueKey":"oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"From Ts","description":"The starting (oldest) timestamp in ISO format.","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string\u003cdate-time> | null"},"description":"The starting (oldest) timestamp in ISO format."},"ab01d998-5536-4a48-a376-076a32ebf404":{"name":"to_ts","in":"query","required":false,"schema":{"oneOf":[{"type":"string","title":"To Ts","description":"The ending (most recent) timestamp in ISO format.","format":"date-time","uniqueKey":"oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"To Ts","description":"The ending (most recent) timestamp in ISO format.","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string\u003cdate-time> | null"},"description":"The ending (most recent) timestamp in ISO format."},"19344925-5b0e-43b5-9209-82e573a5799f":{"name":"x-selected-account-id","in":"header","required":false,"schema":{"oneOf":[{"type":"string","title":"Account ID Header","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Account ID Header","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}},"4275b87b-cdf6-45ec-9347-09e7b121ae06":{"name":"x-project-id","in":"header","required":false,"schema":{"oneOf":[{"type":"string","title":"Project ID Header","uniqueKey":"oneOf.0","typeLabel":"string"},{"type":"null","title":"Project ID Header","uniqueKey":"oneOf.1","typeLabel":"null"}],"isRequired":false,"uniqueKey":"","typeLabel":"string | null"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"parents_only":{"oneOf":[{"type":"boolean","title":"Parents Only","description":"Only fetch spans that are the top-level (ie. have no parent_id)","uniqueKey":"parents_only.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Parents Only","description":"Only fetch spans that are the top-level (ie. have no parent_id)","uniqueKey":"parents_only.oneOf.1","typeLabel":"null"}],"uniqueKey":"parents_only","typeLabel":"boolean | null"},"span_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"span_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Span Ids","description":"Filter by span IDs","uniqueKey":"span_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Span Ids","description":"Filter by span IDs","uniqueKey":"span_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"span_ids","typeLabel":"string[] | null"},"trace_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"trace_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Trace Ids","description":"Filter by trace IDs. The combined count of trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, parent_ids, and (trace_id, span_id) pairs (each pair counting 2) may not exceed 10000. A request over that returns 422.","uniqueKey":"trace_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Trace Ids","description":"Filter by trace IDs. The combined count of trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, parent_ids, and (trace_id, span_id) pairs (each pair counting 2) may not exceed 10000. A request over that returns 422.","uniqueKey":"trace_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"trace_ids","typeLabel":"string[] | null"},"excluded_span_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"excluded_span_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Excluded Span Ids","description":"List of span IDs to exclude from results","uniqueKey":"excluded_span_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Excluded Span Ids","description":"List of span IDs to exclude from results","uniqueKey":"excluded_span_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"excluded_span_ids","typeLabel":"string[] | null"},"excluded_trace_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"excluded_trace_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Excluded Trace Ids","description":"List of trace IDs to exclude from results","uniqueKey":"excluded_trace_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Excluded Trace Ids","description":"List of trace IDs to exclude from results","uniqueKey":"excluded_trace_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"excluded_trace_ids","typeLabel":"string[] | null"},"spans":{"oneOf":[{"type":"array","items":{"properties":{"trace_id":{"type":"string","title":"Trace Id","description":"Trace ID of the referenced span","isRequired":true,"uniqueKey":"spans.oneOf.0.items.[INDEX].trace_id","typeLabel":"string"},"span_id":{"type":"string","title":"Span Id","description":"Span ID of the referenced span","isRequired":true,"uniqueKey":"spans.oneOf.0.items.[INDEX].span_id","typeLabel":"string"}},"type":"object","required":["trace_id","span_id"],"title":"SpanRef","description":"One span addressed by its full identity, since span ids are only unique within a trace.","uniqueKey":"spans.oneOf.0.items.[INDEX]","typeLabel":"SpanRef · object"},"title":"Spans","description":"Filter by exact (trace_id, span_id) identity. Unlike span_ids, a pair never matches a same-id span from another trace. ANDs with span_ids when both are set.","uniqueKey":"spans.oneOf.0","typeLabel":"SpanRef · object[]"},{"type":"null","title":"Spans","description":"Filter by exact (trace_id, span_id) identity. Unlike span_ids, a pair never matches a same-id span from another trace. ANDs with span_ids when both are set.","uniqueKey":"spans.oneOf.1","typeLabel":"null"}],"uniqueKey":"spans","typeLabel":"SpanRef · object[] | null"},"excluded_spans":{"oneOf":[{"type":"array","items":{"properties":{"trace_id":{"type":"string","title":"Trace Id","description":"Trace ID of the referenced span","isRequired":true,"uniqueKey":"excluded_spans.oneOf.0.items.[INDEX].trace_id","typeLabel":"string"},"span_id":{"type":"string","title":"Span Id","description":"Span ID of the referenced span","isRequired":true,"uniqueKey":"excluded_spans.oneOf.0.items.[INDEX].span_id","typeLabel":"string"}},"type":"object","required":["trace_id","span_id"],"title":"SpanRef","description":"One span addressed by its full identity, since span ids are only unique within a trace.","uniqueKey":"excluded_spans.oneOf.0.items.[INDEX]","typeLabel":"SpanRef · object"},"title":"Excluded Spans","description":"List of (trace_id, span_id) identities to exclude from results. Unlike excluded_span_ids, a pair never excludes a same-id span from another trace. Takes precedence over excluded_span_ids when both are set.","uniqueKey":"excluded_spans.oneOf.0","typeLabel":"SpanRef · object[]"},{"type":"null","title":"Excluded Spans","description":"List of (trace_id, span_id) identities to exclude from results. Unlike excluded_span_ids, a pair never excludes a same-id span from another trace. Takes precedence over excluded_span_ids when both are set.","uniqueKey":"excluded_spans.oneOf.1","typeLabel":"null"}],"uniqueKey":"excluded_spans","typeLabel":"SpanRef · object[] | null"},"group_id":{"oneOf":[{"type":"string","title":"Group Id","description":"Filter by group ID","uniqueKey":"group_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Group Id","description":"Filter by group ID","uniqueKey":"group_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"group_id","typeLabel":"string | null"},"parent_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"parent_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Parent Ids","description":"Filter to the direct children of any of these parent span IDs","uniqueKey":"parent_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Parent Ids","description":"Filter to the direct children of any of these parent span IDs","uniqueKey":"parent_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"parent_ids","typeLabel":"string[] | null"},"names":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"names.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Names","description":"Filter by trace/span name","uniqueKey":"names.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Names","description":"Filter by trace/span name","uniqueKey":"names.oneOf.1","typeLabel":"null"}],"uniqueKey":"names","typeLabel":"string[] | null"},"statuses":{"oneOf":[{"type":"array","items":{"type":"string","enum":["SUCCESS","ERROR","CANCELED"],"title":"ApplicationOperationStatus","uniqueKey":"statuses.oneOf.0.items.[INDEX]","typeLabel":"enum\u003cstring>"},"title":"Statuses","description":"Filter on span status","uniqueKey":"statuses.oneOf.0","typeLabel":"enum\u003cstring>[]"},{"type":"null","title":"Statuses","description":"Filter on span status","uniqueKey":"statuses.oneOf.1","typeLabel":"null"}],"uniqueKey":"statuses","typeLabel":"enum\u003cstring>[] | null"},"types":{"oneOf":[{"type":"array","items":{"type":"string","enum":["TEXT_INPUT","TEXT_OUTPUT","COMPLETION_INPUT","COMPLETION","KB_RETRIEVAL","KB_INPUT","RERANKING","EXTERNAL_ENDPOINT","PROMPT_ENGINEERING","DOCUMENT_INPUT","MAP_REDUCE","DOCUMENT_SEARCH","DOCUMENT_PROMPT","CUSTOM","CODE_EXECUTION","DATA_MANIPULATION","EVALUATION","FILE_RETRIEVAL","KB_ADD_CHUNK","KB_MANAGEMENT","GUARDRAIL","OUTPUT_GUARDRAIL","TRACER","AGENT_TRACER","AGENT_WORKFLOW","STANDALONE"],"title":"ApplicationOperationType","uniqueKey":"types.oneOf.0.items.[INDEX]","typeLabel":"enum\u003cstring>"},"title":"Types","uniqueKey":"types.oneOf.0","typeLabel":"enum\u003cstring>[]"},{"type":"null","title":"Types","uniqueKey":"types.oneOf.1","typeLabel":"null"}],"uniqueKey":"types","typeLabel":"enum\u003cstring>[] | null"},"search_texts":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"search_texts.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Search Texts","description":"Case-insensitive text search across span name, input, output, and metadata. A single-word term of ASCII letters and digits matches as a whole word in input, output, and metadata, and as a substring of the name. A term of up to 8 such words matches as a contiguous phrase whose words each appear as whole words. All other terms (punctuated, non-ASCII, longer) match as substrings, where mid-word fragments match and an inflected form such as a plural matches only where it appears literally. Wrapping a term in double quotes makes it a phrase: the quotes mark the phrase and are never matched, a backslash escapes a quote or a backslash inside them, the phrase must appear contiguously inside one searched value (the input, the output, or the metadata), a phrase of up to 8 ASCII letter-and-digit words additionally requires each of those words to appear there as a whole word, and a UUID-shaped phrase stays a text search. A term whose quote is unterminated or left unescaped mid-term is matched literally, quotes included. Multiple terms are ANDed, and UUID-shaped terms match trace IDs instead. A span must match every non-UUID term, and each term may match any of the searched fields. UUID matches are ORed onto the text match. Each term must be at least 2 characters, measured between the quotes and ignoring outer whitespace for a phrase, and at most 10 terms are supported. For exact trace ID lookup, use the `trace_ids` filter. The tracing service runs on either ClickHouse or Postgres, and the two engines match differently. On Postgres deployments the whole-word match uses the simple text-search parser, which keeps hosts, e-mail addresses, file paths, version strings, hyphenated compounds, URLs and query strings as single words (https://x.com/path?q=1 yields x.com/path?q=1, x.com and /path?q=1, never path, q or 1; user@example.com and v1.2.3 are one word each; gpt-4o yields the compound and its parts), whereas ClickHouse deployments split on every non-alphanumeric ASCII byte. A single word inside such a value is a whole-word hit on ClickHouse and a miss on Postgres; the substring forms behave identically on both. On Postgres deployments a value over 80000 bytes has only its first 20000 characters indexed for whole-word matching; text past that is reachable only by the substring forms. Words longer than 2047 bytes are matched as substrings, never as whole words. Case folding of non-ASCII text follows the database's LC_CTYPE on Postgres deployments, for the whole-word index, the quoted-phrase and substring forms and the word-boundary check alike; under a C-locale database non-ASCII letters are not folded. ASCII folds everywhere. Input and output behave identically on both engines. A substring-form term, or a text-filtered metrics request, reads every row of the time window that survives the other filters. A term that matches too many rows in the window is refused by the tracing service as QUERY_TOO_BROAD, at an engine-specific threshold, and on Postgres deployments a read whose sorts or hashes, the text candidate sets included, outgrow the deployment's work memory and its temp-file bound is refused as QUERY_TEMP_FILE_LIMIT_EXCEEDED, a code ClickHouse deployments never return and one a read without text can also earn. This API relays either refusal as a 400 carrying the tracing service's detail, never as a page from the legacy trace store, and an export's refusal is reported as the failed export's reason on the export status, not on the POST. On Postgres deployments each term is counted on its own, in every class (whole word, phrase and substring alike) and on every read that carries text, and is refused when it alone matches more than 50000 rows of the window that survive the other filters, with or without assessment_types. On ClickHouse deployments the refusal is the candidate-set cap, a deployment-configured limit counted over the matches of all terms together: a search page bounds its candidates to the page, so there the cap is a backstop rather than a limit a common term meets; metrics and by-span resolve every match and can trip it; and an export runs under its own 2000000-row set cap on every request, assessment_types included. Accounts still served by the legacy trace store match differently until migrated: every term matches as stemmed whole words (so inflected forms match and multi-word terms match word-adjacent), only input and output are searched, the 2-character minimum is not enforced, quoting a term changes nothing (the quotes are stripped and a multi-word term is already matched word-adjacent), and characters like `:`, `|`, or `!` inside a term may be interpreted as query operators or cause an error.","uniqueKey":"search_texts.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Search Texts","description":"Case-insensitive text search across span name, input, output, and metadata. A single-word term of ASCII letters and digits matches as a whole word in input, output, and metadata, and as a substring of the name. A term of up to 8 such words matches as a contiguous phrase whose words each appear as whole words. All other terms (punctuated, non-ASCII, longer) match as substrings, where mid-word fragments match and an inflected form such as a plural matches only where it appears literally. Wrapping a term in double quotes makes it a phrase: the quotes mark the phrase and are never matched, a backslash escapes a quote or a backslash inside them, the phrase must appear contiguously inside one searched value (the input, the output, or the metadata), a phrase of up to 8 ASCII letter-and-digit words additionally requires each of those words to appear there as a whole word, and a UUID-shaped phrase stays a text search. A term whose quote is unterminated or left unescaped mid-term is matched literally, quotes included. Multiple terms are ANDed, and UUID-shaped terms match trace IDs instead. A span must match every non-UUID term, and each term may match any of the searched fields. UUID matches are ORed onto the text match. Each term must be at least 2 characters, measured between the quotes and ignoring outer whitespace for a phrase, and at most 10 terms are supported. For exact trace ID lookup, use the `trace_ids` filter. The tracing service runs on either ClickHouse or Postgres, and the two engines match differently. On Postgres deployments the whole-word match uses the simple text-search parser, which keeps hosts, e-mail addresses, file paths, version strings, hyphenated compounds, URLs and query strings as single words (https://x.com/path?q=1 yields x.com/path?q=1, x.com and /path?q=1, never path, q or 1; user@example.com and v1.2.3 are one word each; gpt-4o yields the compound and its parts), whereas ClickHouse deployments split on every non-alphanumeric ASCII byte. A single word inside such a value is a whole-word hit on ClickHouse and a miss on Postgres; the substring forms behave identically on both. On Postgres deployments a value over 80000 bytes has only its first 20000 characters indexed for whole-word matching; text past that is reachable only by the substring forms. Words longer than 2047 bytes are matched as substrings, never as whole words. Case folding of non-ASCII text follows the database's LC_CTYPE on Postgres deployments, for the whole-word index, the quoted-phrase and substring forms and the word-boundary check alike; under a C-locale database non-ASCII letters are not folded. ASCII folds everywhere. Input and output behave identically on both engines. A substring-form term, or a text-filtered metrics request, reads every row of the time window that survives the other filters. A term that matches too many rows in the window is refused by the tracing service as QUERY_TOO_BROAD, at an engine-specific threshold, and on Postgres deployments a read whose sorts or hashes, the text candidate sets included, outgrow the deployment's work memory and its temp-file bound is refused as QUERY_TEMP_FILE_LIMIT_EXCEEDED, a code ClickHouse deployments never return and one a read without text can also earn. This API relays either refusal as a 400 carrying the tracing service's detail, never as a page from the legacy trace store, and an export's refusal is reported as the failed export's reason on the export status, not on the POST. On Postgres deployments each term is counted on its own, in every class (whole word, phrase and substring alike) and on every read that carries text, and is refused when it alone matches more than 50000 rows of the window that survive the other filters, with or without assessment_types. On ClickHouse deployments the refusal is the candidate-set cap, a deployment-configured limit counted over the matches of all terms together: a search page bounds its candidates to the page, so there the cap is a backstop rather than a limit a common term meets; metrics and by-span resolve every match and can trip it; and an export runs under its own 2000000-row set cap on every request, assessment_types included. Accounts still served by the legacy trace store match differently until migrated: every term matches as stemmed whole words (so inflected forms match and multi-word terms match word-adjacent), only input and output are searched, the 2-character minimum is not enforced, quoting a term changes nothing (the quotes are stripped and a multi-word term is already matched word-adjacent), and characters like `:`, `|`, or `!` inside a term may be interpreted as query operators or cause an error.","uniqueKey":"search_texts.oneOf.1","typeLabel":"null"}],"uniqueKey":"search_texts","typeLabel":"string[] | null"},"extra_metadata":{"oneOf":[{"type":"object","title":"Extra Metadata","description":"Filter on custom metadata: each key must equal its value, or any value of an array, and keys are ANDed. On the ClickHouse read path `$or` and `$and` also compose nested groups of predicates. On Postgres a `$`-prefixed key is an ordinary metadata key matched literally. Array values match element-wise; a negative zero inside an array equals zero on Postgres-served accounts and not on ClickHouse-served ones.","additionalProperties":true,"uniqueKey":"extra_metadata.oneOf.0","typeLabel":"Extra Metadata · object"},{"type":"null","title":"Extra Metadata","description":"Filter on custom metadata: each key must equal its value, or any value of an array, and keys are ANDed. On the ClickHouse read path `$or` and `$and` also compose nested groups of predicates. On Postgres a `$`-prefixed key is an ordinary metadata key matched literally. Array values match element-wise; a negative zero inside an array equals zero on Postgres-served accounts and not on ClickHouse-served ones.","uniqueKey":"extra_metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"extra_metadata","typeLabel":"Extra Metadata · object | null"},"application_variant_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"application_variant_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Application Variant Ids","description":"Filter by application variant IDs","uniqueKey":"application_variant_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Application Variant Ids","description":"Filter by application variant IDs","uniqueKey":"application_variant_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"application_variant_ids","typeLabel":"string[] | null"},"assessment_types":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"assessment_types.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Assessment Types","description":"Filter to spans that have at least one assessment of these types","uniqueKey":"assessment_types.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Assessment Types","description":"Filter to spans that have at least one assessment of these types","uniqueKey":"assessment_types.oneOf.1","typeLabel":"null"}],"uniqueKey":"assessment_types","typeLabel":"string[] | null"},"acp_types":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"acp_types.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Acp Types","description":"Filter by ACP types","uniqueKey":"acp_types.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Acp Types","description":"Filter by ACP types","uniqueKey":"acp_types.oneOf.1","typeLabel":"null"}],"uniqueKey":"acp_types","typeLabel":"string[] | null"},"agentex_agent_names":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"agentex_agent_names.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Agentex Agent Names","description":"Filter by Agentex agent names","uniqueKey":"agentex_agent_names.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Agentex Agent Names","description":"Filter by Agentex agent names","uniqueKey":"agentex_agent_names.oneOf.1","typeLabel":"null"}],"uniqueKey":"agentex_agent_names","typeLabel":"string[] | null"},"agentex_agent_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"agentex_agent_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Agentex Agent Ids","description":"Filter by Agentex agent IDs","uniqueKey":"agentex_agent_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Agentex Agent Ids","description":"Filter by Agentex agent IDs","uniqueKey":"agentex_agent_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"agentex_agent_ids","typeLabel":"string[] | null"},"obs_trace_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"obs_trace_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Obs Trace Ids","description":"Filter to the business spans that executed in any of these observability traces (the obs-to-business reverse lookup). Each id must be 32 lowercase hex characters. Served only by the sgp-traces service, so a request using this filter against an account still on the legacy store returns 422 rather than silently ignoring it.","uniqueKey":"obs_trace_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Obs Trace Ids","description":"Filter to the business spans that executed in any of these observability traces (the obs-to-business reverse lookup). Each id must be 32 lowercase hex characters. Served only by the sgp-traces service, so a request using this filter against an account still on the legacy store returns 422 rather than silently ignoring it.","uniqueKey":"obs_trace_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"obs_trace_ids","typeLabel":"string[] | null"},"obs_span_ids":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"obs_span_ids.oneOf.0.items.[INDEX]","typeLabel":"string"},"title":"Obs Span Ids","description":"Filter to the business spans that executed in any of these observability spans. Each id must be 16 lowercase hex characters. A W3C span id is unique per trace only, so combine with obs_trace_ids for exact identity, the same looseness span_ids carries versus the spans pair filter. ANDs with obs_trace_ids when both are set. Served only by the sgp-traces service, so a request using this filter against an account still on the legacy store returns 422 rather than silently ignoring it.","uniqueKey":"obs_span_ids.oneOf.0","typeLabel":"string[]"},{"type":"null","title":"Obs Span Ids","description":"Filter to the business spans that executed in any of these observability spans. Each id must be 16 lowercase hex characters. A W3C span id is unique per trace only, so combine with obs_trace_ids for exact identity, the same looseness span_ids carries versus the spans pair filter. ANDs with obs_trace_ids when both are set. Served only by the sgp-traces service, so a request using this filter against an account still on the legacy store returns 422 rather than silently ignoring it.","uniqueKey":"obs_span_ids.oneOf.1","typeLabel":"null"}],"uniqueKey":"obs_span_ids","typeLabel":"string[] | null"},"min_duration_ms":{"oneOf":[{"type":"integer","title":"Min Duration Ms","description":"Minimum span duration in milliseconds (inclusive). Matched on completed duration, so a span with no end time is not reliably returned: fetch it by its own id or in its trace's span list.","uniqueKey":"min_duration_ms.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Min Duration Ms","description":"Minimum span duration in milliseconds (inclusive). Matched on completed duration, so a span with no end time is not reliably returned: fetch it by its own id or in its trace's span list.","uniqueKey":"min_duration_ms.oneOf.1","typeLabel":"null"}],"uniqueKey":"min_duration_ms","typeLabel":"integer | null"},"max_duration_ms":{"oneOf":[{"type":"integer","title":"Max Duration Ms","description":"Maximum span duration in milliseconds (inclusive). Matched on completed duration, so a span with no end time is never returned: fetch it by its own id or in its trace's span list.","uniqueKey":"max_duration_ms.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Max Duration Ms","description":"Maximum span duration in milliseconds (inclusive). Matched on completed duration, so a span with no end time is never returned: fetch it by its own id or in its trace's span list.","uniqueKey":"max_duration_ms.oneOf.1","typeLabel":"null"}],"uniqueKey":"max_duration_ms","typeLabel":"integer | null"}},"type":"object","title":"TracesSearchRequest","uniqueKey":"","typeLabel":"TracesSearchRequest · object"},"examples":{"Example":{"title":"Example","value":{"parents_only":true,"span_ids":["\u003cstring>"],"trace_ids":["\u003cstring>"],"excluded_span_ids":["\u003cstring>"],"excluded_trace_ids":["\u003cstring>"],"spans":[{"trace_id":"\u003cstring>","span_id":"\u003cstring>"}],"excluded_spans":[{"trace_id":"\u003cstring>","span_id":"\u003cstring>"}],"group_id":"\u003cstring>","parent_ids":["\u003cstring>"],"names":["\u003cstring>"],"statuses":[],"types":[],"search_texts":["\u003cstring>"],"extra_metadata":{},"application_variant_ids":["\u003cstring>"],"assessment_types":["\u003cstring>"],"acp_types":["\u003cstring>"],"agentex_agent_names":["\u003cstring>"],"agentex_agent_ids":["\u003cstring>"],"obs_trace_ids":["\u003cstring>"],"obs_span_ids":["\u003cstring>"],"min_duration_ms":123,"max_duration_ms":123}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"cec22d21-e551-4d80-8a43-c470ac2943a3":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"items":{"items":{"properties":{"id":{"type":"string","title":"Id","isRequired":true,"uniqueKey":"\\items.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","title":"Name","isRequired":true,"uniqueKey":"\\items.items.[INDEX].name","typeLabel":"string"},"trace_id":{"type":"string","maxLength":256,"title":"Trace Id","description":"id for grouping traces together, uuid is recommended","isRequired":true,"uniqueKey":"\\items.items.[INDEX].trace_id","typeLabel":"string"},"start_timestamp":{"type":"string","format":"date-time","title":"Start Timestamp","isRequired":true,"uniqueKey":"\\items.items.[INDEX].start_timestamp","typeLabel":"string\u003cdate-time>"},"account_id":{"type":"string","title":"Account Id","isRequired":true,"uniqueKey":"\\items.items.[INDEX].account_id","typeLabel":"string"},"object":{"type":"string","const":"span","title":"Object","default":"span","uniqueKey":"\\items.items.[INDEX].object","typeLabel":"string"},"created_by":{"oneOf":[{"type":"object","title":"Identity","description":"The identity that created the entity.","required":["id","type"],"properties":{"id":{"type":"string","title":"Id","isRequired":true,"uniqueKey":"\\items.items.[INDEX].created_by.oneOf.0.id","typeLabel":"string"},"type":{"type":"string","enum":["user","service_account"],"title":"IdentityType","isRequired":true,"uniqueKey":"\\items.items.[INDEX].created_by.oneOf.0.type","typeLabel":"enum\u003cstring>"},"object":{"type":"string","const":"identity","title":"Object","default":"identity","uniqueKey":"\\items.items.[INDEX].created_by.oneOf.0.object","typeLabel":"string"}},"uniqueKey":"\\items.items.[INDEX].created_by.oneOf.0","typeLabel":"Identity · object"},{"type":"null","description":"The identity that created the entity.","uniqueKey":"\\items.items.[INDEX].created_by.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].created_by","typeLabel":"Identity · object | null"},"parent_id":{"oneOf":[{"type":"string","title":"Parent Id","description":"Reference to a parent span_id","uniqueKey":"\\items.items.[INDEX].parent_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Parent Id","description":"Reference to a parent span_id","uniqueKey":"\\items.items.[INDEX].parent_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].parent_id","typeLabel":"string | null"},"group_id":{"oneOf":[{"type":"string","title":"Group Id","description":"Reference to a group_id","uniqueKey":"\\items.items.[INDEX].group_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Group Id","description":"Reference to a group_id","uniqueKey":"\\items.items.[INDEX].group_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].group_id","typeLabel":"string | null"},"end_timestamp":{"oneOf":[{"type":"string","title":"End Timestamp","format":"date-time","uniqueKey":"\\items.items.[INDEX].end_timestamp.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"End Timestamp","uniqueKey":"\\items.items.[INDEX].end_timestamp.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].end_timestamp","typeLabel":"string\u003cdate-time> | null"},"input":{"oneOf":[{"type":"object","title":"Input","additionalProperties":true,"uniqueKey":"\\items.items.[INDEX].input.oneOf.0","typeLabel":"Input · object"},{"type":"null","title":"Input","uniqueKey":"\\items.items.[INDEX].input.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].input","typeLabel":"Input · object | null"},"output":{"oneOf":[{"type":"object","title":"Output","additionalProperties":true,"uniqueKey":"\\items.items.[INDEX].output.oneOf.0","typeLabel":"Output · object"},{"type":"null","title":"Output","uniqueKey":"\\items.items.[INDEX].output.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].output","typeLabel":"Output · object | null"},"metadata":{"oneOf":[{"type":"object","title":"Metadata","additionalProperties":true,"uniqueKey":"\\items.items.[INDEX].metadata.oneOf.0","typeLabel":"Metadata · object"},{"type":"null","title":"Metadata","uniqueKey":"\\items.items.[INDEX].metadata.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].metadata","typeLabel":"Metadata · object | null"},"expected":{"oneOf":[{"type":"object","title":"Expected","additionalProperties":true,"uniqueKey":"\\items.items.[INDEX].expected.oneOf.0","typeLabel":"Expected · object"},{"type":"null","title":"Expected","uniqueKey":"\\items.items.[INDEX].expected.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].expected","typeLabel":"Expected · object | null"},"status":{"oneOf":[{"type":"string","title":"ApplicationOperationStatus","default":"SUCCESS","enum":["SUCCESS","ERROR","CANCELED"],"uniqueKey":"\\items.items.[INDEX].status.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","default":"SUCCESS","uniqueKey":"\\items.items.[INDEX].status.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].status","typeLabel":"enum\u003cstring> | null"},"type":{"oneOf":[{"type":"string","title":"ApplicationOperationType","default":"STANDALONE","enum":["TEXT_INPUT","TEXT_OUTPUT","COMPLETION_INPUT","COMPLETION","KB_RETRIEVAL","KB_INPUT","RERANKING","EXTERNAL_ENDPOINT","PROMPT_ENGINEERING","DOCUMENT_INPUT","MAP_REDUCE","DOCUMENT_SEARCH","DOCUMENT_PROMPT","CUSTOM","CODE_EXECUTION","DATA_MANIPULATION","EVALUATION","FILE_RETRIEVAL","KB_ADD_CHUNK","KB_MANAGEMENT","GUARDRAIL","OUTPUT_GUARDRAIL","TRACER","AGENT_TRACER","AGENT_WORKFLOW","STANDALONE"],"uniqueKey":"\\items.items.[INDEX].type.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","default":"STANDALONE","uniqueKey":"\\items.items.[INDEX].type.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].type","typeLabel":"enum\u003cstring> | null"},"application_interaction_id":{"oneOf":[{"type":"string","title":"Application Interaction Id","description":"The interaction ID this span belongs to","uniqueKey":"\\items.items.[INDEX].application_interaction_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Application Interaction Id","description":"The interaction ID this span belongs to","uniqueKey":"\\items.items.[INDEX].application_interaction_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].application_interaction_id","typeLabel":"string | null"},"application_variant_id":{"oneOf":[{"type":"string","title":"Application Variant Id","description":"The id of the application variant this span belongs to","uniqueKey":"\\items.items.[INDEX].application_variant_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Application Variant Id","description":"The id of the application variant this span belongs to","uniqueKey":"\\items.items.[INDEX].application_variant_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].application_variant_id","typeLabel":"string | null"},"obs_trace_id":{"oneOf":[{"type":"string","title":"Obs Trace Id","description":"W3C trace id of the observability trace this span executed in. Null for spans written without the edge, and for accounts still served by the legacy trace store.","uniqueKey":"\\items.items.[INDEX].obs_trace_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Obs Trace Id","description":"W3C trace id of the observability trace this span executed in. Null for spans written without the edge, and for accounts still served by the legacy trace store.","uniqueKey":"\\items.items.[INDEX].obs_trace_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].obs_trace_id","typeLabel":"string | null"},"obs_span_id":{"oneOf":[{"type":"string","title":"Obs Span Id","description":"W3C span id of the observability span this span executed in.","uniqueKey":"\\items.items.[INDEX].obs_span_id.oneOf.0","typeLabel":"string"},{"type":"null","title":"Obs Span Id","description":"W3C span id of the observability span this span executed in.","uniqueKey":"\\items.items.[INDEX].obs_span_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].obs_span_id","typeLabel":"string | null"},"input_tokens":{"oneOf":[{"type":"integer","title":"Input Tokens","description":"Prompt tokens the producer reported for this span, absent when it reported none. Same quantity the input_tokens sort orders by.","maximum":4294967295,"minimum":0,"uniqueKey":"\\items.items.[INDEX].input_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Input Tokens","description":"Prompt tokens the producer reported for this span, absent when it reported none. Same quantity the input_tokens sort orders by.","uniqueKey":"\\items.items.[INDEX].input_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].input_tokens","typeLabel":"integer | null"},"output_tokens":{"oneOf":[{"type":"integer","title":"Output Tokens","description":"Completion tokens the producer reported for this span, absent when it reported none. Same quantity the output_tokens sort orders by.","maximum":4294967295,"minimum":0,"uniqueKey":"\\items.items.[INDEX].output_tokens.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Output Tokens","description":"Completion tokens the producer reported for this span, absent when it reported none. Same quantity the output_tokens sort orders by.","uniqueKey":"\\items.items.[INDEX].output_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"\\items.items.[INDEX].output_tokens","typeLabel":"integer | null"}},"type":"object","required":["id","name","trace_id","start_timestamp","account_id"],"uniqueKey":"\\items.items.[INDEX]","typeLabel":"object"},"type":"array","title":"Items","isRequired":true,"uniqueKey":"\\items","typeLabel":"Items · object[]"},"total":{"type":"integer","title":"Total","description":"Not computed for span search and always 0: results are keyset-paginated, so page with has_more and the cursors instead.","isRequired":true,"uniqueKey":"total","typeLabel":"integer"},"has_more":{"type":"boolean","title":"Has More","description":"Whether more items remain in the direction of travel. Under allow_partial_results this is the only end-of-list signal, since the byte or time budget can serve a page shorter than limit with rows still left.","isRequired":true,"uniqueKey":"has_more","typeLabel":"boolean"},"object":{"type":"string","const":"list","title":"Object","default":"list","uniqueKey":"object","typeLabel":"string"},"limit":{"type":"integer","title":"Limit","description":"The maximum number of items to return.","default":100,"uniqueKey":"limit","typeLabel":"integer"},"next_cursor":{"oneOf":[{"type":"string","title":"Next Cursor","description":"Pass as starting_after to fetch the next page. None when there is no next page.","uniqueKey":"next_cursor.oneOf.0","typeLabel":"string"},{"type":"null","title":"Next Cursor","description":"Pass as starting_after to fetch the next page. None when there is no next page.","uniqueKey":"next_cursor.oneOf.1","typeLabel":"null"}],"uniqueKey":"next_cursor","typeLabel":"string | null"},"prev_cursor":{"oneOf":[{"type":"string","title":"Prev Cursor","description":"Pass as ending_before to fetch the previous page. None when on the first page.","uniqueKey":"prev_cursor.oneOf.0","typeLabel":"string"},{"type":"null","title":"Prev Cursor","description":"Pass as ending_before to fetch the previous page. None when on the first page.","uniqueKey":"prev_cursor.oneOf.1","typeLabel":"null"}],"uniqueKey":"prev_cursor","typeLabel":"string | null"},"window_truncated":{"oneOf":[{"type":"boolean","title":"Window Truncated","description":"True when the requested window exceeded the 90 day maximum and was clamped, so results cover only effective_from_ts..effective_to_ts. null when no clamp occurred.","uniqueKey":"window_truncated.oneOf.0","typeLabel":"boolean"},{"type":"null","title":"Window Truncated","description":"True when the requested window exceeded the 90 day maximum and was clamped, so results cover only effective_from_ts..effective_to_ts. null when no clamp occurred.","uniqueKey":"window_truncated.oneOf.1","typeLabel":"null"}],"uniqueKey":"window_truncated","typeLabel":"boolean | null"},"effective_from_ts":{"oneOf":[{"type":"string","title":"Effective From Ts","description":"Resolved start of the searched window. null when no clamp occurred.","format":"date-time","uniqueKey":"effective_from_ts.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Effective From Ts","description":"Resolved start of the searched window. null when no clamp occurred.","uniqueKey":"effective_from_ts.oneOf.1","typeLabel":"null"}],"uniqueKey":"effective_from_ts","typeLabel":"string\u003cdate-time> | null"},"effective_to_ts":{"oneOf":[{"type":"string","title":"Effective To Ts","description":"Resolved end of the searched window. null when no clamp occurred.","format":"date-time","uniqueKey":"effective_to_ts.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Effective To Ts","description":"Resolved end of the searched window. null when no clamp occurred.","uniqueKey":"effective_to_ts.oneOf.1","typeLabel":"null"}],"uniqueKey":"effective_to_ts","typeLabel":"string\u003cdate-time> | null"},"search_status":{"oneOf":[{"type":"string","title":"Search Status","description":"complete when the page holds every match from the request's position to its last item or the end of the window. partial when an allow_partial_results search spent its time budget first: the page holds every match up to searched_through, and next_cursor resumes from there. null on accounts still served by the legacy trace store.","enum":["complete","partial"],"uniqueKey":"search_status.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","title":"Search Status","description":"complete when the page holds every match from the request's position to its last item or the end of the window. partial when an allow_partial_results search spent its time budget first: the page holds every match up to searched_through, and next_cursor resumes from there. null on accounts still served by the legacy trace store.","uniqueKey":"search_status.oneOf.1","typeLabel":"null"}],"uniqueKey":"search_status","typeLabel":"enum\u003cstring> | null"},"searched_through":{"oneOf":[{"type":"string","title":"Searched Through","description":"On a partial page, the start_timestamp the search covered up to in its scan order, oldest first for a descending sort. null on a complete page.","format":"date-time","uniqueKey":"searched_through.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Searched Through","description":"On a partial page, the start_timestamp the search covered up to in its scan order, oldest first for a descending sort. null on a complete page.","uniqueKey":"searched_through.oneOf.1","typeLabel":"null"}],"uniqueKey":"searched_through","typeLabel":"string\u003cdate-time> | null"}},"type":"object","required":["items","total","has_more"],"description":"Span search page carrying sgp-traces' opaque pagination cursors.\n\nAccounts still served by the legacy trace store keyset-paginate on the span\nid and leave these unset, except that a page the legacy store serves as a\nfallback for a tracing-service account, or in continuation of a fallback\ncursor, carries cursors this API mints so later pages stay on the legacy\nstore. The tracing service, on either of its storage engines, returns opaque\ncursors that clients must round-trip.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"items":[{"id":"\u003cstring>","name":"\u003cstring>","trace_id":"\u003cstring>","start_timestamp":"2023-11-07T05:31:56Z","account_id":"\u003cstring>","object":"span","created_by":{"id":"\u003cstring>","type":"user","object":"identity"},"parent_id":"\u003cstring>","group_id":"\u003cstring>","end_timestamp":"2023-11-07T05:31:56Z","input":{},"output":{},"metadata":{},"expected":{},"status":"SUCCESS","type":"STANDALONE","application_interaction_id":"\u003cstring>","application_variant_id":"\u003cstring>","obs_trace_id":"\u003cstring>","obs_span_id":"\u003cstring>","input_tokens":2147483647,"output_tokens":2147483647}],"total":123,"has_more":true,"object":"list","limit":100,"next_cursor":"\u003cstring>","prev_cursor":"\u003cstring>","window_truncated":true,"effective_from_ts":"2023-11-07T05:31:56Z","effective_to_ts":"2023-11-07T05:31:56Z","search_status":"complete","searched_through":"2023-11-07T05:31:56Z"}}},"exampleType":"generated"}},"exampleType":"generated"},"7d183be5-3099-40cc-9e3f-39151166843d":{"description":"The request carried a value this API or the tracing service rejected, such as a search term breaking a documented rule or a malformed pagination cursor.","content":{"application/json":{"schema":{"properties":{"detail":{"type":"string","title":"Detail","description":"A user-safe explanation of why the tracing read failed.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"error_code":{"oneOf":[{"type":"string","title":"Error Code","description":"Stable classification for a known EGP-to-tracing-service configuration failure. Omitted when the downstream failure is not safely classifiable.","const":"TRACES_SERVICE_CONFIGURATION_ERROR","uniqueKey":"error_code.oneOf.0","typeLabel":"string"},{"type":"null","title":"Error Code","description":"Stable classification for a known EGP-to-tracing-service configuration failure. Omitted when the downstream failure is not safely classifiable.","uniqueKey":"error_code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error_code","typeLabel":"string | null"}},"type":"object","required":["detail"],"title":"SpanReadErrorResponse","description":"Safe public error body for a tracing read that could not be completed.","uniqueKey":"","typeLabel":"SpanReadErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>","error_code":"TRACES_SERVICE_CONFIGURATION_ERROR"}}},"exampleType":"generated"}},"exampleType":"generated"},"f548a995-3316-45a9-9fa6-8bf75741a1f7":{"description":"A malformed request returns the validation error shape, one entry per offending field. A request this API refuses returns only detail, as when x-project-id is sent for an account whose tracing backend cannot apply the project scope.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"HTTPValidationError","properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"oneOf.0.detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"oneOf.0.detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"oneOf.0.detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"oneOf.0.detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"oneOf.0.detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"oneOf.0.detail.items.[INDEX].type","typeLabel":"string"},"input":{"oneOf":[{"title":"Input"}],"uniqueKey":"oneOf.0.detail.items.[INDEX].input","typeLabel":"any"},"ctx":{"type":"object","title":"Context","additionalProperties":true,"uniqueKey":"oneOf.0.detail.items.[INDEX].ctx","typeLabel":"Context · object"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"oneOf.0.detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"oneOf.0.detail","typeLabel":"ValidationError · object[]"}},"uniqueKey":"oneOf.0","typeLabel":"HTTPValidationError · object"},{"type":"object","title":"SpanReadErrorResponse","description":"Safe public error body for a tracing read that could not be completed.","required":["detail"],"properties":{"detail":{"type":"string","title":"Detail","description":"A user-safe explanation of why the tracing read failed.","isRequired":true,"uniqueKey":"oneOf.1.detail","typeLabel":"string"},"error_code":{"oneOf":[{"type":"string","title":"Error Code","description":"Stable classification for a known EGP-to-tracing-service configuration failure. Omitted when the downstream failure is not safely classifiable.","const":"TRACES_SERVICE_CONFIGURATION_ERROR","uniqueKey":"oneOf.1.error_code.oneOf.0","typeLabel":"string"},{"type":"null","title":"Error Code","description":"Stable classification for a known EGP-to-tracing-service configuration failure. Omitted when the downstream failure is not safely classifiable.","uniqueKey":"oneOf.1.error_code.oneOf.1","typeLabel":"null"}],"uniqueKey":"oneOf.1.error_code","typeLabel":"string | null"}},"uniqueKey":"oneOf.1","typeLabel":"SpanReadErrorResponse · object"}],"uniqueKey":"","typeLabel":"HTTPValidationError · object | SpanReadErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>","input":"\u003cunknown>","ctx":{}}]}}},"exampleType":"generated"}},"exampleType":"generated"},"910d70ea-de94-4519-93ec-4efc22fa70b3":{"description":"The configured tracing read backend is unavailable. Known service configuration failures include a stable error_code; other failures return only detail.","headers":{"x-correlation-id":{"description":"Correlation ID for this request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"properties":{"detail":{"type":"string","title":"Detail","description":"A user-safe explanation of why the tracing read failed.","isRequired":true,"uniqueKey":"detail","typeLabel":"string"},"error_code":{"oneOf":[{"type":"string","title":"Error Code","description":"Stable classification for a known EGP-to-tracing-service configuration failure. Omitted when the downstream failure is not safely classifiable.","const":"TRACES_SERVICE_CONFIGURATION_ERROR","uniqueKey":"error_code.oneOf.0","typeLabel":"string"},{"type":"null","title":"Error Code","description":"Stable classification for a known EGP-to-tracing-service configuration failure. Omitted when the downstream failure is not safely classifiable.","uniqueKey":"error_code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error_code","typeLabel":"string | null"}},"type":"object","required":["detail"],"title":"SpanReadErrorResponse","description":"Safe public error body for a tracing read that could not be completed.","uniqueKey":"","typeLabel":"SpanReadErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"detail":"\u003cstring>","error_code":"TRACES_SERVICE_CONFIGURATION_ERROR"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"bbd634fa-5a38-44e4-bc27-e5fe38f870b9":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","scopes":[],"schemeName":"APIKeyHeader"}}},"servers":{"53d4b40c-6ecb-41f0-8721-9b4723f67775":{"url":"https://api.egp.scale.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","scopes":[],"schemeName":"APIKeyHeader"},"schema":{"title":"x-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"APIKeyHeader","name":"x-api-key"}],"title":"APIKeyHeader"}]},"originalFileLocation":"openapi/v5.yaml"},"subdomain":"scalegp","siteName":"Scale AI","title":"Search spans - Scale AI","navMaps":{"firstHrefInVersion":{"V5":{"href":"/reference/v5/spans/search-spans","matchLevel":0},"V4 (legacy)":{"href":"/home","matchLevel":4}},"firstHrefInLanguage":{}},"lastModified":"2026-11-05T21:11:37.856Z","originalFileLocation":"reference/v5/spans/search-spans.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Search and list spans matching a set of filters, returning a keyset-paginated page. Filters in the request body include trace and span ids, names, statuses, types, free-text search, metadata, duration bounds, and more, scoped to an optional time window. Results are keyset-paginated on indexed columns rather than offset-paginated, and total is not computed (it is always 0); use the pagination cursors to page through results. Reads route to the legacy trace store or the tracing service per account (with fallback to the legacy trace store outside strict mode), and results are narrowed to traces the caller is authorized to read — a filter that resolves to no authorized traces yields an empty page rather than an error. A reversed time window (from_ts after to_ts) is rejected with 422, as is a request whose combined trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, and parent_ids count exceeds 10000. sort_by accepts start_timestamp, duration_ms, input_tokens and output_tokens; the token counts are read from usage reported at ingest, and a span whose producer reported none sorts as zero, so it lands last descending and first ascending. The two token sorts are rejected for an account still served by the legacy trace store, which keeps no token count to order by. Any other unsupported sort falls back to timestamp order there. Spans sharing a sort key are ordered by trace_id and id bytewise on both tracing-service engines. Text search tokenization, indexed-prefix, word-length, locale and metadata-bytes behavior differs between Postgres and ClickHouse deployments of the tracing service as the search_texts field describes. x-project-id narrows the result to traces whose root span carries that project, when PROJECT_SCOPED_SPAN_LISTING is on for the account, on either store.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Scale AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Search spans - Scale AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Search and list spans matching a set of filters, returning a keyset-paginated page. Filters in the request body include trace and span ids, names, statuses, types, free-text search, metadata, duration bounds, and more, scoped to an optional time window. Results are keyset-paginated on indexed columns rather than offset-paginated, and total is not computed (it is always 0); use the pagination cursors to page through results. Reads route to the legacy trace store or the tracing service per account (with fallback to the legacy trace store outside strict mode), and results are narrowed to traces the caller is authorized to read — a filter that resolves to no authorized traces yields an empty page rather than an error. A reversed time window (from_ts after to_ts) is rejected with 422, as is a request whose combined trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, and parent_ids count exceeds 10000. sort_by accepts start_timestamp, duration_ms, input_tokens and output_tokens; the token counts are read from usage reported at ingest, and a span whose producer reported none sorts as zero, so it lands last descending and first ascending. The two token sorts are rejected for an account still served by the legacy trace store, which keeps no token count to order by. Any other unsupported sort falls back to timestamp order there. Spans sharing a sort key are ordered by trace_id and id bytewise on both tracing-service engines. Text search tokenization, indexed-prefix, word-length, locale and metadata-bytes behavior differs between Postgres and ClickHouse deployments of the tracing service as the search_texts field describes. x-project-id narrows the result to traces whose root span carries that project, when PROJECT_SCOPED_SPAN_LISTING is on for the account, on either store.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Scale AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.gp.scale.com/reference/v5/spans/search-spans\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://scalegp.mintlify.site/_mintlify/api/og/v2?division=Spans\u0026amp;title=Search+spans\u0026amp;description=Search+and+list+spans+matching+a+set+of+filters%2C+returning+a+keyset-paginated+page.%0A%0AFilters+in+the+request+body+include+trace+and+span+ids%2C+names%2C+statuses%2C%0Aty\u0026amp;theme=b7e87dd2f9a2a23155199f59\u0026amp;signature=5085c58dfbab657d42578c99260123fedcc860f44bd669d4f5ef535d10f712f2\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Search spans - Scale AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Search and list spans matching a set of filters, returning a keyset-paginated page. Filters in the request body include trace and span ids, names, statuses, types, free-text search, metadata, duration bounds, and more, scoped to an optional time window. Results are keyset-paginated on indexed columns rather than offset-paginated, and total is not computed (it is always 0); use the pagination cursors to page through results. Reads route to the legacy trace store or the tracing service per account (with fallback to the legacy trace store outside strict mode), and results are narrowed to traces the caller is authorized to read — a filter that resolves to no authorized traces yields an empty page rather than an error. A reversed time window (from_ts after to_ts) is rejected with 422, as is a request whose combined trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, and parent_ids count exceeds 10000. sort_by accepts start_timestamp, duration_ms, input_tokens and output_tokens; the token counts are read from usage reported at ingest, and a span whose producer reported none sorts as zero, so it lands last descending and first ascending. The two token sorts are rejected for an account still served by the legacy trace store, which keeps no token count to order by. Any other unsupported sort falls back to timestamp order there. Spans sharing a sort key are ordered by trace_id and id bytewise on both tracing-service engines. Text search tokenization, indexed-prefix, word-length, locale and metadata-bytes behavior differs between Postgres and ClickHouse deployments of the tracing service as the search_texts field describes. x-project-id narrows the result to traces whose root span carries that project, when PROJECT_SCOPED_SPAN_LISTING is on for the account, on either store.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://scalegp.mintlify.site/_mintlify/api/og/v2?division=Spans\u0026amp;title=Search+spans\u0026amp;description=Search+and+list+spans+matching+a+set+of+filters%2C+returning+a+keyset-paginated+page.%0A%0AFilters+in+the+request+body+include+trace+and+span+ids%2C+names%2C+statuses%2C%0Aty\u0026amp;theme=b7e87dd2f9a2a23155199f59\u0026amp;signature=5085c58dfbab657d42578c99260123fedcc860f44bd669d4f5ef535d10f712f2\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/scalegp/UksUEh3sxckFW0X-/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Scale AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3f2e7b\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.gp.scale.com/reference/v5/spans/search-spans\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/v5/spans/search-spans.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.gp.scale.com/#organization\",\"name\":\"Scale AI\",\"url\":\"https://docs.gp.scale.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/scalegp/TBmst1qiYXwYqUB5/logo/light.png?fit=max\u0026auto=format\u0026n=TBmst1qiYXwYqUB5\u0026q=85\u0026s=46027042c16b373ac463148db5ad1d6b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.gp.scale.com#website\",\"name\":\"Scale AI\",\"url\":\"https://docs.gp.scale.com\",\"publisher\":{\"@id\":\"https://docs.gp.scale.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans#webpage\",\"url\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans\",\"name\":\"Search spans\",\"description\":\"Search and list spans matching a set of filters, returning a keyset-paginated page. Filters in the request body include trace and span ids, names, statuses, types, free-text search, metadata, duration bounds, and more, scoped to an optional time window. Results are keyset-paginated on indexed columns rather than offset-paginated, and total is not computed (it is always 0); use the pagination cursors to page through results. Reads route to the legacy trace store or the tracing service per account (with fallback to the legacy trace store outside strict mode), and results are narrowed to traces the caller is authorized to read — a filter that resolves to no authorized traces yields an empty page rather than an error. A reversed time window (from_ts after to_ts) is rejected with 422, as is a request whose combined trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, and parent_ids count exceeds 10000. sort_by accepts start_timestamp, duration_ms, input_tokens and output_tokens; the token counts are read from usage reported at ingest, and a span whose producer reported none sorts as zero, so it lands last descending and first ascending. The two token sorts are rejected for an account still served by the legacy trace store, which keeps no token count to order by. Any other unsupported sort falls back to timestamp order there. Spans sharing a sort key are ordered by trace_id and id bytewise on both tracing-service engines. Text search tokenization, indexed-prefix, word-length, locale and metadata-bytes behavior differs between Postgres and ClickHouse deployments of the tracing service as the search_texts field describes. x-project-id narrows the result to traces whose root span carries that project, when PROJECT_SCOPED_SPAN_LISTING is on for the account, on either store.\",\"dateModified\":\"2026-11-05T21:11:37.856Z\",\"isPartOf\":{\"@id\":\"https://docs.gp.scale.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Spans\",\"item\":\"https://docs.gp.scale.com/reference/v5/spans/create-a-span\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Search spans\",\"item\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans#apireference\",\"headline\":\"Search spans\",\"name\":\"Search spans\",\"description\":\"Search and list spans matching a set of filters, returning a keyset-paginated page. Filters in the request body include trace and span ids, names, statuses, types, free-text search, metadata, duration bounds, and more, scoped to an optional time window. Results are keyset-paginated on indexed columns rather than offset-paginated, and total is not computed (it is always 0); use the pagination cursors to page through results. Reads route to the legacy trace store or the tracing service per account (with fallback to the legacy trace store outside strict mode), and results are narrowed to traces the caller is authorized to read — a filter that resolves to no authorized traces yields an empty page rather than an error. A reversed time window (from_ts after to_ts) is rejected with 422, as is a request whose combined trace_ids, span_ids, excluded_span_ids, excluded_trace_ids, and parent_ids count exceeds 10000. sort_by accepts start_timestamp, duration_ms, input_tokens and output_tokens; the token counts are read from usage reported at ingest, and a span whose producer reported none sorts as zero, so it lands last descending and first ascending. The two token sorts are rejected for an account still served by the legacy trace store, which keeps no token count to order by. Any other unsupported sort falls back to timestamp order there. Spans sharing a sort key are ordered by trace_id and id bytewise on both tracing-service engines. Text search tokenization, indexed-prefix, word-length, locale and metadata-bytes behavior differs between Postgres and ClickHouse deployments of the tracing service as the search_texts field describes. x-project-id narrows the result to traces whose root span carries that project, when PROJECT_SCOPED_SPAN_LISTING is on for the account, on either store.\",\"url\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans\",\"mainEntityOfPage\":{\"@id\":\"https://docs.gp.scale.com/reference/v5/spans/search-spans#webpage\"},\"dateModified\":\"2026-11-05T21:11:37.856Z\",\"publisher\":{\"@id\":\"https://docs.gp.scale.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.gp.scale.com#website\"}}]}\u003c/script>","siteName":"Scale AI","nav":{"global":null,"versions":[{"version":"V5","tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/docs/v5/overview"}]},{"tab":"AgentOps API","groups":[{"group":"Inference","pages":[{"title":"Run inference with free-form payload","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/inference","href":"/reference/v5/inference/run-inference-with-free-form-payload"},{"title":"Generate OpenAI chat completion from messages","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/chat/completions","href":"/reference/v5/inference/generate-openai-chat-completion-from-messages"},{"title":"Run OpenAI Responses API (OpenAI only)","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/responses","href":"/reference/v5/inference/run-openai-responses-api-openai-only"},{"title":"Generate legacy text completion from prompt","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/completions","href":"/reference/v5/inference/generate-legacy-text-completion-from-prompt"},{"title":"List available chat completion models","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/chat/completions/models","href":"/reference/v5/inference/list-available-chat-completion-models"}]},{"group":"Questions","pages":[{"title":"List questions","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/questions","href":"/reference/v5/questions/list-questions"},{"title":"Create a question","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/questions","href":"/reference/v5/questions/create-a-question"},{"title":"Get a question","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/questions/{question_id}","href":"/reference/v5/questions/get-a-question"},{"title":"Archive a question","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/questions/{question_id}","href":"/reference/v5/questions/archive-a-question"},{"title":"Update a question","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/questions/{question_id}","href":"/reference/v5/questions/update-a-question"},{"title":"Restore an archived question","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/questions/{question_id}/restore","href":"/reference/v5/questions/restore-an-archived-question"}]},{"group":"Rubrics","pages":[{"title":"List rubrics","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/rubrics","href":"/reference/v5/rubrics/list-rubrics"},{"title":"Create a rubric","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/rubrics","href":"/reference/v5/rubrics/create-a-rubric"},{"title":"Get a rubric","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/rubrics/{rubric_id}","href":"/reference/v5/rubrics/get-a-rubric"},{"title":"Archive a rubric","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/rubrics/{rubric_id}","href":"/reference/v5/rubrics/archive-a-rubric"},{"title":"Update or restore a rubric","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/rubrics/{rubric_id}","href":"/reference/v5/rubrics/update-or-restore-a-rubric"},{"title":"Add a criterion to a rubric","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/rubrics/{rubric_id}/criteria","href":"/reference/v5/rubrics/add-a-criterion-to-a-rubric"},{"title":"Update a criterion","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/rubrics/{rubric_id}/criteria/{rubric_criteria_id}","href":"/reference/v5/rubrics/update-a-criterion"},{"title":"List criterion versions","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/rubrics/{rubric_id}/criteria/{rubric_criteria_id}/versions","href":"/reference/v5/rubrics/list-criterion-versions"}]},{"group":"Vector Stores","pages":[{"title":"List Vector Stores","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/vector-stores","href":"/reference/v5/vector-stores/list-vector-stores"},{"title":"Create Vector Store","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/create","href":"/reference/v5/vector-stores/create-vector-store"},{"title":"Get Vector Store","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/vector-stores/{vector_store_name}","href":"/reference/v5/vector-stores/get-vector-store"},{"title":"Configure Vector Store","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/{vector_store_name}/configure","href":"/reference/v5/vector-stores/configure-vector-store"},{"title":"Drop Vector Store","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/{vector_store_name}/drop","href":"/reference/v5/vector-stores/drop-vector-store"},{"title":"Upsert Vectors","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/{vector_store_name}/upsert","href":"/reference/v5/vector-stores/upsert-vectors"},{"title":"Delete Vectors","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/{vector_store_name}/delete","href":"/reference/v5/vector-stores/delete-vectors"},{"title":"List Vectors","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/vector-stores/{vector_store_name}/vectors","href":"/reference/v5/vector-stores/list-vectors"},{"title":"Get Vector","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/vector-stores/{vector_store_name}/vectors/{vector_id}","href":"/reference/v5/vector-stores/get-vector"},{"title":"Count Vectors","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/{vector_store_name}/count","href":"/reference/v5/vector-stores/count-vectors"},{"title":"Query Vectors","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/vector-stores/{vector_store_name}/query","href":"/reference/v5/vector-stores/query-vectors"}]},{"group":"Files","pages":[{"title":"List files","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/files","href":"/reference/v5/files/list-files"},{"title":"Upload file bytes directly","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/files","href":"/reference/v5/files/upload-file-bytes-directly"},{"title":"Import files from cloud storage","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/files/cloud_imports","href":"/reference/v5/files/import-files-from-cloud-storage"},{"title":"Get file metadata","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/files/{file_id}","href":"/reference/v5/files/get-file-metadata"},{"title":"Delete a file","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/files/{file_id}","href":"/reference/v5/files/delete-a-file"},{"title":"Update a file","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/files/{file_id}","href":"/reference/v5/files/update-a-file"},{"title":"Download file content","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/files/{file_id}/content","href":"/reference/v5/files/download-file-content"}]},{"group":"Models","pages":[{"title":"List custom models","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/models","href":"/reference/v5/models/list-custom-models"},{"title":"Create a custom model","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/models","href":"/reference/v5/models/create-a-custom-model"},{"title":"Get a custom model","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/models/{model_id}","href":"/reference/v5/models/get-a-custom-model"},{"title":"Delete a custom model","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/models/{model_id}","href":"/reference/v5/models/delete-a-custom-model"},{"title":"Update a custom model","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/models/{model_id}","href":"/reference/v5/models/update-a-custom-model"}]},{"group":"Agent Configs","pages":[{"title":"List Agent Configs","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/agent_configs","href":"/reference/v5/agent-configs/list-agent-configs"},{"title":"Create Agent Config","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/agent_configs","href":"/reference/v5/agent-configs/create-agent-config"},{"title":"List MCP Tool Names","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/agent_configs/mcp_tools","href":"/reference/v5/agent-configs/list-mcp-tool-names"},{"title":"Get Agent Config","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/agent_configs/{agent_config_id}","href":"/reference/v5/agent-configs/get-agent-config"},{"title":"Delete Agent Config (hard delete)","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/agent_configs/{agent_config_id}","href":"/reference/v5/agent-configs/delete-agent-config-hard-delete"},{"title":"Update Agent Config","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/agent_configs/{agent_config_id}","href":"/reference/v5/agent-configs/update-agent-config"}]},{"group":"Datasets","pages":[{"title":"List datasets","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/datasets","href":"/reference/v5/datasets/list-datasets"},{"title":"Create a dataset","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/datasets","href":"/reference/v5/datasets/create-a-dataset"},{"title":"Get a dataset","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/datasets/{dataset_id}","href":"/reference/v5/datasets/get-a-dataset"},{"title":"Archive a dataset","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/datasets/{dataset_id}","href":"/reference/v5/datasets/archive-a-dataset"},{"title":"Update or restore a dataset","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/datasets/{dataset_id}","href":"/reference/v5/datasets/update-or-restore-a-dataset"}]},{"group":"Dataset Items","pages":[{"title":"Add items to an existing dataset","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/dataset-items/batch","href":"/reference/v5/dataset-items/add-items-to-an-existing-dataset"},{"title":"Get a dataset item","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/dataset-items/{dataset_item_id}","href":"/reference/v5/dataset-items/get-a-dataset-item"},{"title":"Delete a dataset item","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/dataset-items/{dataset_item_id}","href":"/reference/v5/dataset-items/delete-a-dataset-item"},{"title":"Update a dataset item","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/dataset-items/{dataset_item_id}","href":"/reference/v5/dataset-items/update-a-dataset-item"},{"title":"List dataset items","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/dataset-items","href":"/reference/v5/dataset-items/list-dataset-items"}]},{"group":"Evaluations","pages":[{"title":"List Evaluations","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluations","href":"/reference/v5/evaluations/list-evaluations"},{"title":"Create Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluations","href":"/reference/v5/evaluations/create-evaluation"},{"title":"Get Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluations/{evaluation_id}","href":"/reference/v5/evaluations/get-evaluation"},{"title":"Archive Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/evaluations/{evaluation_id}","href":"/reference/v5/evaluations/archive-evaluation"},{"title":"Update or Restore Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/evaluations/{evaluation_id}","href":"/reference/v5/evaluations/update-or-restore-evaluation"},{"title":"Add Test Criteria to Evaluation","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluations/{evaluation_id}/tasks","href":"/reference/v5/evaluations/add-test-criteria-to-evaluation"},{"title":"Update Test Criteria Configuration","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/evaluations/{evaluation_id}/tasks/{alias}","href":"/reference/v5/evaluations/update-test-criteria-configuration"},{"title":"Get Available Metadata Keys","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluations/metadata-keys","href":"/reference/v5/evaluations/get-available-metadata-keys"},{"title":"Get Available Evaluation Statuses","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluations/statuses","href":"/reference/v5/evaluations/get-available-evaluation-statuses"},{"title":"Get Evaluation Data Schema","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluations/{evaluation_id}/schema","href":"/reference/v5/evaluations/get-evaluation-data-schema"},{"title":"Get Evaluation Taxonomy","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluations/{evaluation_id}/taxonomy","href":"/reference/v5/evaluations/get-evaluation-taxonomy"},{"title":"Filter Evaluations","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluations/filter","href":"/reference/v5/evaluations/filter-evaluations"},{"title":"Dry-run a custom-function evaluation task","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluations/tasks/dry-run","href":"/reference/v5/evaluations/dry-run-a-custom-function-evaluation-task"}]},{"group":"Evaluation Groups","pages":[{"title":"List Evaluation Groups","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-groups","href":"/reference/v5/evaluation-groups/list-evaluation-groups"},{"title":"Create Evaluation Group","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluation-groups","href":"/reference/v5/evaluation-groups/create-evaluation-group"},{"title":"Get Evaluation Group","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-groups/{group_id}","href":"/reference/v5/evaluation-groups/get-evaluation-group"},{"title":"Update Evaluation Group","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml put /v5/evaluation-groups/{group_id}","href":"/reference/v5/evaluation-groups/update-evaluation-group"},{"title":"Archive Evaluation Group","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/evaluation-groups/{group_id}","href":"/reference/v5/evaluation-groups/archive-evaluation-group"},{"title":"Patch Evaluation Group","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/evaluation-groups/{group_id}","href":"/reference/v5/evaluation-groups/patch-evaluation-group"},{"title":"Get Evaluation Group Schema","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-groups/{group_id}/schema","href":"/reference/v5/evaluation-groups/get-evaluation-group-schema"}]},{"group":"Evaluation Charts","pages":[{"title":"List Evaluation Charts","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-charts","href":"/reference/v5/evaluation-charts/list-evaluation-charts"},{"title":"Create Evaluation Chart","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluation-charts","href":"/reference/v5/evaluation-charts/create-evaluation-chart"},{"title":"Get Evaluation Chart","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-charts/{chart_id}","href":"/reference/v5/evaluation-charts/get-evaluation-chart"},{"title":"Replace Evaluation Chart","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml put /v5/evaluation-charts/{chart_id}","href":"/reference/v5/evaluation-charts/replace-evaluation-chart"},{"title":"Delete Evaluation Chart","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml delete /v5/evaluation-charts/{chart_id}","href":"/reference/v5/evaluation-charts/delete-evaluation-chart"},{"title":"Patch Evaluation Chart","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml patch /v5/evaluation-charts/{chart_id}","href":"/reference/v5/evaluation-charts/patch-evaluation-chart"}]},{"group":"Evaluation Dashboards","pages":[{"title":"List Evaluation Dashboards","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-dashboards","href":"/reference/v5/evaluation-dashboards/list-evaluation-dashboards"},{"title":"Create Evaluation Dashboard","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluation-dashboards","href":"/reference/v5/evaluation-dashboards/create-evaluation-dashboard"},{"title":"Get Evaluation Dashboard","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-dashboards/{dashboard_id}","href":"/reference/v5/evaluation-dashboards/get-evaluation-dashboard"},{"title":"Delete Evaluation Dashboard","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/evaluation-dashboards/{dashboard_id}","href":"/reference/v5/evaluation-dashboards/delete-evaluation-dashboard"},{"title":"Patch Evaluation Dashboard","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/evaluation-dashboards/{dashboard_id}","href":"/reference/v5/evaluation-dashboards/patch-evaluation-dashboard"},{"title":"Add Widget to Dashboard","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluation-dashboards/{dashboard_id}/widgets","href":"/reference/v5/evaluation-dashboards/add-widget-to-dashboard"},{"title":"Remove Widget from Dashboard","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/evaluation-dashboards/{dashboard_id}/widgets/{widget_id}","href":"/reference/v5/evaluation-dashboards/remove-widget-from-dashboard"},{"title":"Update Dashboard Widget","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/evaluation-dashboards/{dashboard_id}/widgets/{widget_id}","href":"/reference/v5/evaluation-dashboards/update-dashboard-widget"}]},{"group":"Evaluation Items","pages":[{"title":"Get a single evaluation item","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-items/{evaluation_item_id}","href":"/reference/v5/evaluation-items/get-a-single-evaluation-item"},{"title":"List and filter evaluation items","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/evaluation-items","href":"/reference/v5/evaluation-items/list-and-filter-evaluation-items"},{"title":"Export evaluation items to a file","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/evaluation-items/export","href":"/reference/v5/evaluation-items/export-evaluation-items-to-a-file"}]},{"group":"Spans","pages":[{"title":"Create a span","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans","href":"/reference/v5/spans/create-a-span"},{"title":"Upsert spans in a batch","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml put /v5/spans/batch","href":"/reference/v5/spans/upsert-spans-in-a-batch"},{"title":"Create spans in a batch","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/batch","href":"/reference/v5/spans/create-spans-in-a-batch"},{"title":"List trace deletion requests","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/spans/deletions","href":"/reference/v5/spans/list-trace-deletion-requests"},{"title":"Create trace deletion request","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/deletions","href":"/reference/v5/spans/create-trace-deletion-request"},{"title":"Get trace deletion request status","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/spans/deletions/{deletion_request_id}","href":"/reference/v5/spans/get-trace-deletion-request-status"},{"title":"Get a span","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml get /v5/spans/{span_id}","href":"/reference/v5/spans/get-a-span"},{"title":"Update a span","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/spans/{span_id}","href":"/reference/v5/spans/update-a-span"},{"title":"Get a span within a trace","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/traces/{trace_id}/spans/{span_id}","href":"/reference/v5/spans/get-a-span-within-a-trace"},{"title":"List span summaries for a trace","description":"List payload-free structural span summaries for rendering a trace tree.\n\nUse this endpoint to build and navigate the hierarchy without downloading\neach span's input, output, or metadata; fetch a selected span's full payload\nfrom GET /v5/traces/{trace_id}/spans/{span_id}. Pages contain at most 100\nsummaries in ascending start-time order. Both ClickHouse- and Postgres-backed\nreads return service-issued opaque continuation cursors. The cursors are\nmutually exclusive, and supplying both returns 422. Reads are authorized\nagainst the requested trace. A trace holding more spans than the tracing\nservice's Postgres engine can page is refused with 400\n``QUERY_TEMP_FILE_LIMIT_EXCEEDED`` in strict mode and served from the legacy\ntrace store otherwise, since no window or filter narrows a single trace;\nClickHouse deployments never return that code.","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/traces/{trace_id}/spans","href":"/reference/v5/spans/list-span-summaries-for-a-trace"},{"title":"Search spans","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/search","href":"/reference/v5/spans/search-spans"},{"title":"Export spans","description":"Export spans matching the given filters, either synchronously or as an async job.\n\nFor accounts on the tracing service the export runs as a\nbackground job: the endpoint returns 202 with an ``export_id`` to poll via\nGET /v5/spans/export/{export_id}, and only ``signed_url`` output is supported\n(a ``direct`` request is rejected with 422, and a request with no authorized\ntraces returns 403). For accounts still on the legacy trace store the export\nis synchronous and returns 200 with either the raw content\n(``direct``) or a pre-signed URL (``signed_url``); a ``signed_url`` request in\nan environment without object storage returns 501, and requests filtering on\n5000 or more trace ids are rejected with 422. A reversed time window (``from_ts``\nafter ``to_ts``) is rejected with 422 on either path. Set ``with_children`` to\nexpand matched root spans to their full trace and ``include_assessments`` to\nattach assessments inline.\n\n``x-project-id`` narrows the result to traces whose root span carries that project,\nwhen ``PROJECT_SCOPED_SPAN_LISTING`` is on for the account, on either store.","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/export","href":"/reference/v5/spans/export-spans"},{"title":"Get span export status","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/spans/export/{export_id}","href":"/reference/v5/spans/get-span-export-status"},{"title":"Get time-bucketed span metrics","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/metrics","href":"/reference/v5/spans/get-time-bucketed-span-metrics"},{"title":"Get span metrics grouped by name","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/spans/metrics/by-span","href":"/reference/v5/spans/get-span-metrics-grouped-by-name"}]},{"group":"Span Assessment","pages":[{"title":"List span or trace assessments","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/span-assessments","href":"/reference/v5/span-assessment/list-span-or-trace-assessments"},{"title":"Create span assessment","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/span-assessments","href":"/reference/v5/span-assessment/create-span-assessment"},{"title":"Get span assessment by ID","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/span-assessments/{span_assessment_id}","href":"/reference/v5/span-assessment/get-span-assessment-by-id"},{"title":"Permanently delete span assessment","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/span-assessments/{span_assessment_id}","href":"/reference/v5/span-assessment/permanently-delete-span-assessment"},{"title":"Update span assessment","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/span-assessments/{span_assessment_id}","href":"/reference/v5/span-assessment/update-span-assessment"}]},{"group":"Annotation Tasks","pages":[{"title":"Update or assign annotation tasks in bulk","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/annotation-tasks/batch","href":"/reference/v5/annotation-tasks/update-or-assign-annotation-tasks-in-bulk"}]},{"group":"Credentials","pages":[{"title":"List Credentials","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/credentials","href":"/reference/v5/credentials/list-credentials"},{"title":"Create Credential","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/credentials","href":"/reference/v5/credentials/create-credential"},{"title":"Get Credential by Name","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/credentials/name/{credential_name}","href":"/reference/v5/credentials/get-credential-by-name"},{"title":"Get Credential by ID","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/credentials/{credential_id}","href":"/reference/v5/credentials/get-credential-by-id"},{"title":"Delete Credential","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/credentials/{credential_id}","href":"/reference/v5/credentials/delete-credential"},{"title":"Update Credential","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml patch /v5/credentials/{credential_id}","href":"/reference/v5/credentials/update-credential"},{"title":"Get Credential Secret by ID","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/credentials/{credential_id}/secret","href":"/reference/v5/credentials/get-credential-secret-by-id"},{"title":"Get Credential Secret by Name","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/credentials/name/{credential_name}/secret","href":"/reference/v5/credentials/get-credential-secret-by-name"}]},{"group":"Agentex Cloud Build","pages":[{"title":"List container image builds","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/builds","href":"/reference/v5/agentex-cloud-build/list-container-image-builds"},{"title":"Submit container image build","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/builds","href":"/reference/v5/agentex-cloud-build/submit-container-image-build"},{"title":"List agents built but not deployed","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/builds/undeployed","href":"/reference/v5/agentex-cloud-build/list-agents-built-but-not-deployed"},{"title":"Get a build","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/builds/{build_id}","href":"/reference/v5/agentex-cloud-build/get-a-build"},{"title":"Stream build logs","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/builds/{build_id}/logs","href":"/reference/v5/agentex-cloud-build/stream-build-logs"},{"title":"Cancel a build","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/builds/{build_id}/cancel","href":"/reference/v5/agentex-cloud-build/cancel-a-build"}]},{"group":"Agentex Cloud Deploy","pages":[{"title":"List agent deployments","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/agentex/deployments","href":"/reference/v5/agentex-cloud-deploy/list-agent-deployments"},{"title":"Deploy a built agent image","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml post /v5/agentex/deployments","href":"/reference/v5/agentex-cloud-deploy/deploy-a-built-agent-image"},{"title":"Get an agent deployment","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/agentex/deployments/{deployment_id}","href":"/reference/v5/agentex-cloud-deploy/get-an-agent-deployment"},{"title":"Delete and tear down a deployment","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/agentex/deployments/{deployment_id}","href":"/reference/v5/agentex-cloud-deploy/delete-and-tear-down-a-deployment"},{"title":"Get agent deployment logs","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml get /v5/agentex/deployments/{deployment_id}/logs","href":"/reference/v5/agentex-cloud-deploy/get-agent-deployment-logs"}]},{"group":"Agentex Agent","pages":[{"title":"Delete Agent","deprecated":null,"version":null,"openapi":"/openapi/v5.yaml delete /v5/agentex/agents/{agent_id}","href":"/reference/v5/agentex-agent/delete-agent"}]},{"group":"SGP Cloud Secrets","pages":[{"title":"List Secrets","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml get /v5/sgp/secrets","href":"/reference/v5/sgp-cloud-secrets/list-secrets"},{"title":"Create Secret","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml post /v5/sgp/secrets","href":"/reference/v5/sgp-cloud-secrets/create-secret"},{"title":"Get Secret","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml get /v5/sgp/secrets/{secret_id}","href":"/reference/v5/sgp-cloud-secrets/get-secret"},{"title":"Delete Secret","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml delete /v5/sgp/secrets/{secret_id}","href":"/reference/v5/sgp-cloud-secrets/delete-secret"},{"title":"Update Secret","deprecated":true,"version":null,"openapi":"/openapi/v5.yaml patch /v5/sgp/secrets/{secret_id}","href":"/reference/v5/sgp-cloud-secrets/update-secret"}]}]},{"tab":"AgentOps SDK","href":"https://scaleapi.github.io/sgp-sdk-docs/api/python/"},{"tab":"Agentex API","pages":[{"title":"Agentex API","href":"/reference/agentex/agents/get-agent-by-id"}]},{"tab":"Agentex SDK","href":"https://scaleapi.github.io/agentex-sdk-docs/api/python/"},{"tab":"Capabilities","pages":[{"title":"Capabilities","href":"/docs/capabilities/overview"}]},{"tab":"Dex API","pages":[{"title":"Dex API","href":"/reference/dex/projects/list-projects"}]}]},{"version":"V4 (legacy)","pages":[{"title":"V4 (legacy)","href":"/home"}]}]},"basePath":"","title":"Search spans - Scale AI","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","Page-Dr40SSJq.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js","Markdown-D_k0dg6k.js","clsx-DK3K4Z1S.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DE3EVdvd.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-fN9H9n9g.js"]}