List thread

This endpoint retrieves log threads based on specified filters and pagination parameters. ## Authentication Requires API key authentication via Bearer token in the Authorization header. ## Query Params - `page` *integer*: The page number to retrieve. - `page_size` *integer*: The number of items per page. Maximum is 1000. - `environment` *string*: This is controlled by the API key. A `prod` API key creates `prod` threads, `test` key creates `test` threads. ## Post params - `filters` *object*: The filters to apply to the threads. For complete filter operators and examples, see the [Filters API Reference](/api-reference/reference/filters-api-reference). **Properties** - `thread_identifier` *string*: The identifier of the thread. Operators: "" (is), "in" (is in list) **Properties** - `operator` *string*: The operator to use. Operators: "" (is), "in" (is in list) - `value` *array*: The value to filter by. - `organization_key_id` *string*: The ID of the organization. Operators: "" (is), "not" (is not) **Properties** - `operator` *string*: The operator to use. Operators: "" (is), "not" (is not) - `value` *array*: The value to filter by. - `customer_identifier` *string*: Filter by customer ID Operators: "" (is), "not" (is not) **Properties** - `operator` *string*: The operator to use. Operators: "" (is), "not" (is not) - `value` *array*: The value to filter by. ## Example ```python Python url = "https://api.respan.ai/api/log_threads/?page_size=100" payload = json.dumps({ "filters": { "thread_identifier": { "operator": "in", "value": [ "thread_identifier_1" ] } } }) headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ## Response ```json { "results": [ { "thread_identifier": "thread_id_1", "environment": "prod", "log_count": 21 } ], "count": 1, "previous": null, "next": null, "current_filters": { "thread_identifier": { "operator": "in", "value": ["thread_id_1"] } }, "filters_data": { "thread_identifier": { "display_name": "Thread ID", "metric": "thread_identifier", "operator_choices": [ {"name": "is", "value": ""}, {"name": "in", "value": "in"} ], "value_choices": [], "value_field_type": "text", "hidden": false }, // Other available filters and their options... } } ```

Authentication

AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys

Query parameters

pageintegerOptionalDefaults to 1
The page number to retrieve.
page_sizeintegerOptionalDefaults to 100
The number of items per page. Maximum is 1000.
environmentstringOptional
This is controlled by the API key. A prod API key creates prod threads, test key creates test threads.

Request

This endpoint expects an object.
filtersobjectOptional
The filters to apply to the threads. For complete filter operators and examples, see the Filters API Reference.

Response

Successful response for List thread
countinteger
Total number of results
resultslist of objects
Array of results for the current page
nextstring or null
URL for the next page of results
previousstring or null
URL for the previous page of results

Errors

401
Unauthorized Error