curl --location --request POST 'https://api.stateset.com/v1/search' \ --header 'Content-Type: application/json' \ --header 'Authorization: Token <token>' \ --data-raw '{ "query": "john doe refund", "resources": ["orders", "customers", "returns"], "filters": { "date_range": { "field": "created_at", "from": "2024-01-01", "to": "2024-12-31" }, "status": ["active", "pending"] }, "facets": ["resource_type", "status", "tags"], "sort": { "field": "created_at", "order": "desc" }, "pagination": { "page": 1, "per_page": 20 }, "highlight": true, "suggest": true }'
{ "results": [ { "id": "ord_123abc", "resource_type": "order", "score": 0.95, "data": { "id": "ord_123abc", "customer_name": "John Doe", "total": 299.99, "status": "pending", "created_at": "2024-03-15T10:30:00Z" }, "highlights": { "customer_name": "<em>John Doe</em>", "notes": "Customer requested <em>refund</em> for damaged item" } }, { "id": "cust_456def", "resource_type": "customer", "score": 0.88, "data": { "id": "cust_456def", "name": "John Doe", "email": "[email protected]", "status": "active" }, "highlights": { "name": "<em>John Doe</em>" } } ], "facets": { "resource_type": { "order": 5, "customer": 3, "return": 2 }, "status": { "active": 6, "pending": 4 }, "tags": { "vip": 2, "priority": 3 } }, "suggestions": [ { "text": "john doe refunded", "score": 0.92 } ], "total_results": 10, "page": 1, "per_page": 20, "query_time_ms": 23 }
Powerful search endpoint for finding records across multiple resources with advanced filtering and faceting.
Show properties