Skip to main content

REST API

All routes are under /wp-json/searchsync/v1.

RouteMethodWho can use itWhat it does
/searchPOSTAnyoneRuns searches against the Local backend
/user-context/favoritesGETAnyone, scoped to the current userReturns the current user's favourites
/viewsPOSTAdministratorsCreates a view
/views/{id}GET, PUT, DELETEAdministratorsReads, updates or deletes a view
/card-template/list, /card-template/get, /card-template/theme-listGETAdministratorsLists and loads card templates
/iconsGETAdministratorsSearches the icon library

"Administrators" means users with the manage_options capability.

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.