REST API
FilterX exposes 31 REST endpoints under the /wp-json/filterx/v1/ namespace. Public endpoints require no auth; Admin endpoints require manage_options capability.
Authentication
// Pass WP REST nonce header for admin endpoints:
// Or use cookie authentication (logged-in WordPress session)
// Frontend JS has nonce pre-loaded by wp_localize_script:
ETag Caching
All GET endpoints include ETag and Cache-Control headers. If content hasn't changed, the server returns HTTP 304 Not Modified — saving bandwidth.
// Response headers from /wp-json/filterx/v1/facets
Cache-Control: public, max-age=3600
ETag: "abc123"
// Subsequent request (browser sends If-None-Match):
If-None-Match: "abc123"
→ HTTP 304 Not Modified
All Endpoints
Facets
/wp-json/filterx/v1/facetsList all active facets
/wp-json/filterx/v1/facets/{id}Get single facet by ID
/wp-json/filterx/v1/facets/{id}/choicesGet facet values with counts, filtered by active post set
/wp-json/filterx/v1/facetsCreate a new facet
/wp-json/filterx/v1/facets/{id}Update an existing facet
/wp-json/filterx/v1/facets/{id}Delete a facet and its index data
/wp-json/filterx/v1/facets/{id}/reindexQueue a re-index for this facet
Grids
/wp-json/filterx/v1/gridsList all grids
/wp-json/filterx/v1/grids/{id}Get grid config by ID or slug
/wp-json/filterx/v1/grids/{id}/resultsGet filtered grid results (post HTML + pagination)
/wp-json/filterx/v1/grids/{id}/previewPreview grid with sample/real data
/wp-json/filterx/v1/gridsCreate grid
/wp-json/filterx/v1/grids/{id}Update grid
/wp-json/filterx/v1/grids/{id}Delete grid
Cards
/wp-json/filterx/v1/cardsList all card templates
/wp-json/filterx/v1/cards/{id}Get card template by ID
/wp-json/filterx/v1/cards/{id}/renderRender card preview with a live post
/wp-json/filterx/v1/cardsCreate card template
/wp-json/filterx/v1/cards/{id}Update card template
/wp-json/filterx/v1/cards/{id}Delete card template
Dashboard & Settings
/wp-json/filterx/v1/dashboard/statsPlugin health stats (facet count, grid count, queue size, index status)
/wp-json/filterx/v1/settingsGet all plugin settings
/wp-json/filterx/v1/settingsUpdate plugin settings
/wp-json/filterx/v1/settings/exportExport all facets/grids/cards/settings as JSON
/wp-json/filterx/v1/settings/importImport from JSON file
Index
/wp-json/filterx/v1/index/statusIndex size, queue status, last run time
/wp-json/filterx/v1/index/reindex-allQueue full re-index for all facets
/wp-json/filterx/v1/indexClear all index data
Batch Operations
/wp-json/filterx/v1/batch/facetsBulk enable, disable, or delete facets
/wp-json/filterx/v1/batch/gridsBulk enable, disable, or delete grids
WooCommerce
/wp-json/filterx/v1/wc/product-fieldsAll available WooCommerce product data fields
/wp-json/filterx/v1/wc/attributesProduct attribute taxonomies and their terms
Example: Get Filtered Results
// GET filtered grid results const response = await fetch( '/wp-json/filterx/v1/grids/product-grid/results' + '?facet_price=[0,500]' + '&facet_color=red,blue' ); const data = await response.json(); // data.html — rendered grid HTML // data.total — total items
