Skip to main content
A view turns a search into something durable and reusable. Create one from an existing search handle or from a full search request. See Views for the concepts; this guide shows the calls.

From a search handle

If you just ran a search, pass its search_id:
curl https://api.withsplendor.com/v1/views \
  -H "Authorization: Bearer $SPLENDOR_TOKEN" \
  -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID" \
  -H "Content-Type: application/json" \
  -d '{"name": "Timeout errors", "from_search_id": "srch_8f2c..."}'

From a search request

Or define the query inline so the view captures it directly:
curl https://api.withsplendor.com/v1/views \
  -H "Authorization: Bearer $SPLENDOR_TOKEN" \
  -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Timeout errors",
    "search_request": {"text": "timeout", "datasets": ["app-logs"]}
  }'

Read the records

Fetch a view’s records by its view_id:
curl https://api.withsplendor.com/v1/views/view_.../records \
  -H "Authorization: Bearer $SPLENDOR_TOKEN" \
  -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID"

Cluster a result space

To group a large, fuzzy result set into coherent clusters, create a cluster view from seed queries:
curl https://api.withsplendor.com/v1/views/cluster \
  -H "Authorization: Bearer $SPLENDOR_TOKEN" \
  -H "X-Splendor-Tenant-Id: $SPLENDOR_TENANT_ID" \
  -H "Content-Type: application/json" \
  -d '{"seed_queries": ["login failures", "password reset"], "datasets": ["support-tickets"]}'
Use a materialized view when you need fixed membership for deterministic SQL or analysis. A live view re-runs its query on read for freshness. See Views.