REST API
All routes are under /wp-json/searchsync/v1.
| Route | Method | Who can use it | What it does |
|---|---|---|---|
/search | POST | Anyone | Runs searches against the Local backend |
/user-context/favorites | GET | Anyone, scoped to the current user | Returns the current user's favourites |
/views | POST | Administrators | Creates a view |
/views/{id} | GET, PUT, DELETE | Administrators | Reads, updates or deletes a view |
/card-template/list, /card-template/get, /card-template/theme-list | GET | Administrators | Lists and loads card templates |
/icons | GET | Administrators | Searches the icon library |
"Administrators" means users with the manage_options capability.
/search
Search is public, since it only returns published content. It uses InstantSearch's multi-query format:
{
"requests": [
{
"indexName": "courses_index",
"params": { "query": "design", "page": 0, "hitsPerPage": 20 }
}
]
}
and returns { "results": [ … ] }, one result per request. To sort, add a suffix to the index name: courses_index:sort_date:desc.