Skip to content

REST API

Reports: 13 routes.

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

  • GET9
  • POST2
  • PUT1
  • PATCH1
  • DELETE2

/reports

POSTAccess check: require_login

Submit a new report.

Handler: submit_report()

No parameters declared in the route registration.

curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/reports"

src/domains/reports/routes.php:102

/reports

GETAccess check: require_admin

Return a paginated report list for moderation.

Handler: get_reports_list()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports"

src/domains/reports/routes.php:389

/reports/{id}

GETAccess check: require_admin

Return a single report.

Handler: get_single_report()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/{id}"

DELETEAccess check: require_admin

Delete a report.

Handler: delete_report()

No parameters declared in the route registration.

curl
curl -X DELETE -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/{id}"

src/domains/reports/routes.php:403

/reports/{id}/action

POSTAccess check: require_admin

Take an action on a report.

Handler: take_action()

Parameters of POST /reports/{id}/action
ParameterTypeRequiredDefault or allowed values
actionstringYes—
metadataobjectNoarray()
curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/{id}/action" \
  -H "Content-Type: application/json" \
  -d '{"action": "…"}'

src/domains/reports/routes.php:441

/reports/{id}/audit-log

GETAccess check: require_admin

Return the audit log for a report.

Handler: get_audit_log()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/{id}/audit-log"

src/domains/reports/routes.php:571

/reports/{id}/siblings

GETAccess check: require_admin

Return every other report on the same target as a given report.

Handler: get_sibling_reports()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/{id}/siblings"

src/domains/reports/routes.php:586

/reports/{id}/status

PUTPATCHAccess check: require_admin

Update the report status.

Handler: update_status()

Parameters of PUT/PATCH /reports/{id}/status
ParameterTypeRequiredDefault or allowed values
statusstringYes—
curl
curl -X PUT -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/{id}/status" \
  -H "Content-Type: application/json" \
  -d '{"status": "…"}'

src/domains/reports/routes.php:421

/reports/categories

GETPublic

Return the active category tree.

Handler: get_categories()

No parameters declared in the route registration.

curl
curl "https://example.com/wp-json/davo/v1/reports/categories"

src/domains/reports/routes.php:75

/reports/mine

GETAccess check: require_login

Return the current user's own report history.

Handler: get_my_reports()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/mine"

src/domains/reports/routes.php:198

/reports/mine/{id}

DELETEAccess check: require_login

Withdraw the current user's own report.

Handler: withdraw_report()

Parameters of DELETE /reports/mine/{id}
ParameterTypeRequiredDefault or allowed values
idintegerYes—
curl
curl -X DELETE -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/mine/{id}"

src/domains/reports/routes.php:230

/reports/mine/for-target

GETAccess check: require_login

Return the current user's existing report(s) for a single target — see register_mine_routes()'s docblock on this route.

Handler: get_my_reports_for_target()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/mine/for-target"

src/domains/reports/routes.php:217

/reports/status-counts

GETAccess check: require_admin

Return live report counts per status — see register_moderation_routes()'s docblock on this route.

Handler: get_status_counts()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/status-counts"

src/domains/reports/routes.php:376

/reports/target/{type}/{id}

GETAccess check: require_admin

Return reports for a target entity.

Handler: get_by_target()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/reports/target/{type}/{id}"

src/domains/reports/routes.php:628

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