Skip to main content
POST
https://api.respan.ai
/
api
/
datasets
/
{dataset_id}
/
logs
/
list
List spans with filters
curl --request POST \
  --url https://api.respan.ai/api/datasets/{dataset_id}/logs/list/ \
  --header 'Authorization: Bearer <token>'

Authentication

  • API key: Authorization: Bearer <API key>
For complete filter operators and examples, see the Filters API Reference.
Request body:
{
  "filters": {
    "model": "gpt-4",
    "metadata.user_id": "user123",
    "created_at": {
      "gte": "2024-01-01T00:00:00Z",
      "lte": "2024-01-31T23:59:59Z"
    }
  },
  "page": 1,
  "page_size": 50
}
Request example:
curl -X POST "https://api.respan.ai/api/datasets/{dataset_id}/logs/list/" \
  -H "Authorization: Bearer <API key>" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": {
      "model": "gpt-4",
      "metadata.user_id": "user123",
      "created_at": {
        "gte": "2024-01-01T00:00:00Z",
        "lte": "2024-01-31T23:59:59Z"
      }
    },
    "page": 1,
    "page_size": 50
  }'
Response (200 OK): The response uses the same paginated shape as the GET endpoint: count, next, previous, results, and filters_data.
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "unique_id": "log_12345",
      "dataset_id": "dataset_67890",
      "input": "...",
      "output": "...",
      "metadata": { "user_id": "user123", "session_id": "session456" },
      "model": "gpt-4",
      "timestamp": "2024-01-15T10:30:00Z",
      "annotation_status": "pending",
      "scores": []
    }
  ],
  "filters_data": {
    "model": {...},
    "status_code": {...}
  }
}
Response Fields:
  • count (integer): Total number of spans matching the filters
  • next (string|null): URL for the next page of results
  • previous (string|null): URL for the previous page of results
  • results (array): Array of span objects matching the filters
  • filters_data (object): Available filter options for building filter UIs
Errors:
  • 401 Unauthorized — Missing/invalid authentication
  • 404 Not Found — Dataset not found or not in your organization
Notes:
  • Supports complex filtering with nested metadata fields
  • Date filters support gte (greater than or equal) and lte (less than or equal)