Skip to content

REST API

Search: 5 routes.

All under /wp-json/davo/v1. Every route has a description in the source.

  • GET4
  • POST1

/search

GETPublic

Response body is an object, not a bare results array — {results, search_mode, suggested_query, type_counts} — specifically so the frontend can tell a fuzzy fallback apart from a normal match and show "Did you mean…"/"Showing results for…" only when that's actually what happened, per the explicit requirement that fuzzy matching must never silently replace the user's query. type_counts (object_type => count) backs the Content Type filter's own per-option counts — see Search_Database:: count_by_type()'s own docblock. Pagination stays in headers (X-WP-Total/X-WP-TotalPages), matching the convention every other paginated endpoint in this codebase already uses.

Handler: cb_search()

Parameters of GET /search
ParameterTypeRequiredDefault or allowed values
qsee source——
scopesee source——
typesstringNo—
pagesee source——
per_pageinteger——
date_fromstringNo—
date_tostringNo—
sortstring—relevance | newest | popular
termsstringNo—
statusstringNo—
answeredstringNo—
acceptedstringNo—
curl
curl "https://example.com/wp-json/davo/v1/search"

src/domains/search/routes.php:59

/search/recent

GETPublic

Returns the current user's recent searches for the given keys and scope.

Handler: cb_recent()

Parameters of GET /search/recent
ParameterTypeRequiredDefault or allowed values
keysstringYes—
scopesee source——
curl
curl "https://example.com/wp-json/davo/v1/search/recent?keys=…"

src/domains/search/routes.php:146

/search/reindex-all/batch

POSTAccess check: require_admin

Admin-only. Processes exactly one bounded batch of one source's backfill and returns immediately — see Search_Repository:: reindex_next_batch()'s own docblock for why this is one call per batch rather than one long-running request: Davo has no WP-CLI, so this route (driven by the admin Tools screen, one call at a time) is the real product surface for the cold-start/buyer-onboarding reindex, and it has to survive shared hosting's PHP execution-time limits.

Handler: cb_reindex_all_batch()

Parameters of POST /search/reindex-all/batch
ParameterTypeRequiredDefault or allowed values
object_typestringYes—
cursorinteger—0
batch_sizeinteger——
curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/search/reindex-all/batch" \
  -H "Content-Type: application/json" \
  -d '{"object_type": "…"}'

src/domains/search/routes.php:177

/search/reindex-all/manifest

GETAccess check: require_admin

Admin-only. Lists every registered source the reindex-all Tools action can back-fill — see Search_Repository:: get_reindexable_sources_manifest()'s own docblock. The admin screen walks this list, calling POST /search/reindex-all/batch repeatedly for each entry until it's fully done.

Handler: cb_reindex_all_manifest()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/search/reindex-all/manifest"

src/domains/search/routes.php:166

/search/suggest

GETPublic

Response body is now the same envelope shape as GET /search — {results, search_mode, suggested_query} — since Search_Repository:: suggest() can now also fall through to the fuzzy fallback on zero results (with its own smaller candidate limit; see Search_Helpers::get_suggest_fuzzy_candidate_limit()). No pagination headers here — the dropdown was never paginated and still isn't.

Handler: cb_suggest()

Parameters of GET /search/suggest
ParameterTypeRequiredDefault or allowed values
qsee source——
scopesee source——
curl
curl "https://example.com/wp-json/davo/v1/search/suggest"

src/domains/search/routes.php:131

Note. Generated from the plugin source. Parameters are the ones declared when the route is registered; a parameter marked “see source” uses a shared definition. Responses are not documented here. Authenticate as for any WordPress REST route, for example with an application password over HTTPS; the example paths use https://example.com.

See it on your own site.

Davo is a WordPress theme and plugin by Exorex.

  • Runs on your own WordPress
  • Guided setup wizard
  • AI is off until you switch it on
  • Read the licence on the marketplace first