Skip to contentSkip to page list

Docs

Discover what the trace filter fields hold

Discover what the trace filter fields hold in this project. Without field, every facet with its top values. With field, that field's values, paged.

GET/api/v1/traces/facets
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/traces/facets"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.get(    origin + path,    headers=headers,)print(response.json())

Without field, every facet the project has with its top values and whether the payload is still being computed. With field, that field's values and counts plus the distinct total and whether more remain.

application/json · Generated from schema

{  "facets": [    {      "key": "string",      "kind": "categorical",      "label": "string",      "group": "trace",      "topValues": [        null      ],      "totalDistinct": 0    }  ],  "pending": false}
api-reference/traces/discover-what-the-trace-filter-fields-hold

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Query parameters

fieldstring
At least 1 characterUp to 512 characters
prefixstring
Up to 512 characters
limitinteger
Minimum 1Maximum 1000
offsetinteger
Minimum 0Maximum 9007199254740991
startDatestring

Epoch milliseconds, or an ISO 8601 date string.

endDatestring

Epoch milliseconds, or an ISO 8601 date string.

Responses

200

Without field, every facet the project has with its top values and whether the payload is still being computed. With field, that field's values and counts plus the distinct total and whether more remain.

application/json

One of 2
Option 1object
facetsobject[]required
pendingbooleanrequired

True when the payload is still being computed and what you have is the last committed one, possibly empty. Call again shortly.

Option 2object
valuesobject[]required
totalnumberrequired

Distinct values the field holds in the window, before paging.

hasMorebooleanrequired
400

Bad Request

application/json

errorstringrequired
messagestring
401

Unauthorized

application/json

errorstringrequired
messagestring
403

Forbidden

application/json

errorstringrequired
messagestring
422

Unprocessable Entity

application/json

errorstringrequired
messagestring
500

Internal Server Error

application/json

errorstringrequired
messagestring

Documentation