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:

X-WP-Nonce:<nonce from wp_create_nonce('wp_rest')>

// Or use cookie authentication (logged-in WordPress session)

// Frontend JS has nonce pre-loaded by wp_localize_script:

filterx.nonce— available globally

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

GET
/wp-json/filterx/v1/facets

List all active facets

Public
GET
/wp-json/filterx/v1/facets/{id}

Get single facet by ID

Public
GET
/wp-json/filterx/v1/facets/{id}/choices

Get facet values with counts, filtered by active post set

Public
POST
/wp-json/filterx/v1/facets

Create a new facet

Admin
PATCH
/wp-json/filterx/v1/facets/{id}

Update an existing facet

Admin
DELETE
/wp-json/filterx/v1/facets/{id}

Delete a facet and its index data

Admin
POST
/wp-json/filterx/v1/facets/{id}/reindex

Queue a re-index for this facet

Admin

Grids

GET
/wp-json/filterx/v1/grids

List all grids

Public
GET
/wp-json/filterx/v1/grids/{id}

Get grid config by ID or slug

Public
GET
/wp-json/filterx/v1/grids/{id}/results

Get filtered grid results (post HTML + pagination)

Public
GET
/wp-json/filterx/v1/grids/{id}/preview

Preview grid with sample/real data

Admin
POST
/wp-json/filterx/v1/grids

Create grid

Admin
PATCH
/wp-json/filterx/v1/grids/{id}

Update grid

Admin
DELETE
/wp-json/filterx/v1/grids/{id}

Delete grid

Admin

Cards

GET
/wp-json/filterx/v1/cards

List all card templates

Admin
GET
/wp-json/filterx/v1/cards/{id}

Get card template by ID

Admin
GET
/wp-json/filterx/v1/cards/{id}/render

Render card preview with a live post

Admin
POST
/wp-json/filterx/v1/cards

Create card template

Admin
PATCH
/wp-json/filterx/v1/cards/{id}

Update card template

Admin
DELETE
/wp-json/filterx/v1/cards/{id}

Delete card template

Admin

Dashboard & Settings

GET
/wp-json/filterx/v1/dashboard/stats

Plugin health stats (facet count, grid count, queue size, index status)

Admin
GET
/wp-json/filterx/v1/settings

Get all plugin settings

Admin
PATCH
/wp-json/filterx/v1/settings

Update plugin settings

Admin
POST
/wp-json/filterx/v1/settings/export

Export all facets/grids/cards/settings as JSON

Admin
POST
/wp-json/filterx/v1/settings/import

Import from JSON file

Admin

Index

GET
/wp-json/filterx/v1/index/status

Index size, queue status, last run time

Admin
POST
/wp-json/filterx/v1/index/reindex-all

Queue full re-index for all facets

Admin
DELETE
/wp-json/filterx/v1/index

Clear all index data

Admin

Batch Operations

POST
/wp-json/filterx/v1/batch/facets

Bulk enable, disable, or delete facets

Admin
POST
/wp-json/filterx/v1/batch/grids

Bulk enable, disable, or delete grids

Admin

WooCommerce

GET
/wp-json/filterx/v1/wc/product-fields

All available WooCommerce product data fields

Admin
GET
/wp-json/filterx/v1/wc/attributes

Product attribute taxonomies and their terms

Admin

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