Skip to content

REST API

Custom fields: 12 routes.

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

  • GET6
  • POST6
  • PUT2
  • PATCH2
  • DELETE2

/custom-fields/{owner_type}/definitions

GETAccess check: auth_require_manage

Lists the field definitions for an owner type, for the admin screens.

Handler: cb_get_definitions()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions"

POSTAccess check: auth_require_manage

Creates a field definition for an owner type.

Handler: cb_create_definition()

No parameters declared in the route registration.

curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions"

src/domains/custom-fields/routes.php:111

/custom-fields/{owner_type}/definitions/{field_id}

PUTPATCHAccess check: auth_require_manage

Updates a field definition.

Handler: cb_update_definition()

No parameters declared in the route registration.

curl
curl -X PUT -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions/{field_id}"

DELETEAccess check: auth_require_manage

Deletes a custom field definition. Pass purge_values to also delete the values already stored for it.

Handler: cb_delete_definition()

Parameters of DELETE /custom-fields/{owner_type}/definitions/{field_id}
ParameterTypeRequiredDefault or allowed values
purge_valuesboolean—false
curl
curl -X DELETE -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions/{field_id}"

src/domains/custom-fields/routes.php:146

/custom-fields/{owner_type}/definitions/{field_id}/duplicate

POSTAccess check: auth_require_manage

Duplicates a field definition.

Handler: cb_duplicate_definition()

No parameters declared in the route registration.

curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions/{field_id}/duplicate"

src/domains/custom-fields/routes.php:180

/custom-fields/{owner_type}/definitions/{field_id}/toggle

POSTAccess check: auth_require_manage

Turns a field definition on or off with the enabled flag.

Handler: cb_toggle_definition()

Parameters of POST /custom-fields/{owner_type}/definitions/{field_id}/toggle
ParameterTypeRequiredDefault or allowed values
enabledbooleanYes—
curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions/{field_id}/toggle" \
  -H "Content-Type: application/json" \
  -d '{"enabled": true}'

src/domains/custom-fields/routes.php:190

/custom-fields/{owner_type}/definitions/{field_id}/usage

GETAccess check: auth_require_manage

Returns where a custom field definition is used.

Handler: cb_get_definition_usage()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions/{field_id}/usage"

src/domains/custom-fields/routes.php:170

/custom-fields/{owner_type}/definitions/reorder

POSTAccess check: auth_require_manage

Reorders the field definitions for an owner type from a list of field ids.

Handler: cb_reorder_definitions()

Parameters of POST /custom-fields/{owner_type}/definitions/reorder
ParameterTypeRequiredDefault or allowed values
field_idsarrayYes—
curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/definitions/reorder" \
  -H "Content-Type: application/json" \
  -d '{"field_ids": []}'

src/domains/custom-fields/routes.php:129

/custom-fields/{owner_type}/owner

GETAccess check: auth_require_manage

GET /custom-fields/{owner_type}/owner — the owner type's label and placement declarations.

Handler: cb_get_owner()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/owner"

src/domains/custom-fields/routes.php:101

/custom-fields/{owner_type}/schema

GETPublic

Returns the public field schema for an owner type.

Handler: cb_get_schema()

Parameters of GET /custom-fields/{owner_type}/schema
ParameterTypeRequiredDefault or allowed values
owner_typestringYes—
curl
curl "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/schema"

src/domains/custom-fields/routes.php:85

/custom-fields/{owner_type}/sections

GETAccess check: auth_require_manage

Lists the sections for an owner type.

Handler: cb_get_sections()

No parameters declared in the route registration.

curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/sections"

POSTAccess check: auth_require_manage

Creates a section for an owner type.

Handler: cb_create_section()

No parameters declared in the route registration.

curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/sections"

src/domains/custom-fields/routes.php:206

/custom-fields/{owner_type}/sections/{section_id}

PUTPATCHAccess check: auth_require_manage

Updates a section.

Handler: cb_update_section()

No parameters declared in the route registration.

curl
curl -X PUT -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/sections/{section_id}"

DELETEAccess check: auth_require_manage

Deletes a custom field section.

Handler: cb_delete_section()

No parameters declared in the route registration.

curl
curl -X DELETE -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/sections/{section_id}"

src/domains/custom-fields/routes.php:241

/custom-fields/{owner_type}/sections/reorder

POSTAccess check: auth_require_manage

Reorders the sections for an owner type from a list of section ids.

Handler: cb_reorder_sections()

Parameters of POST /custom-fields/{owner_type}/sections/reorder
ParameterTypeRequiredDefault or allowed values
section_idsarrayYes—
curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/custom-fields/{owner_type}/sections/reorder" \
  -H "Content-Type: application/json" \
  -d '{"section_ids": []}'

src/domains/custom-fields/routes.php:224

/custom-fields/types

GETPublic

Returns the available field types.

Handler: cb_get_types()

No parameters declared in the route registration.

curl
curl "https://example.com/wp-json/davo/v1/custom-fields/types"

src/domains/custom-fields/routes.php:75

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