Support Log in

20. REST API Overview

Developer Guide
Prefer video? Watch the Field Forge tutorials 8 short guides covering every feature Watch

Field Forge exposes a full REST API at /wp-json/fieldforge/v1/. Field group schema reads (GET /field-groups and GET /field-groups/{id}) require manage_options by default. A headless or decoupled frontend either sends the credentials of an administrator (see Authentication below) or widens the check with the fieldforge/rest/read_groups_permission filter. The per-post values endpoint requires a logged-in user who can read that post, GET /options/{page} requires manage_options, write endpoints (POST/PUT/DELETE) require manage_options, and the REST layer also enforces plan gates for locked PRO field types (compound types, PHP Blocks), Options Pages, and AI Schema generation. (Field groups are unlimited on every plan, so there is no group-count gate.)

Authentication: Use cookie authentication (logged-in user with nonce) or Application Passwords with Basic Auth for value reads and mutations. Anonymous requests get 401 on every endpoint of the fieldforge/v1 namespace, unless a site widens the schema check with the fieldforge/rest/read_groups_permission filter or the check of GET /aggregate with the fieldforge/rest/aggregate_permission filter. Caching: Field group schema GETs include ETag and Cache-Control: private, max-age=60 headers. Authenticated GET responses also include ETags, but WordPress may add its standard logged-in no-cache directives. Send the previous ETag back via If-None-Match to receive a 304 Not Modified where the client cache is valid.
bash
# Application Passwords (WordPress 5.6+)
AUTH="admin:xxxx xxxx xxxx xxxx xxxx xxxx"

curl -s -u "$AUTH" \
  -H "If-None-Match: \"$LAST_ETAG\"" \
  "https://example.com/wp-json/fieldforge/v1/field-groups"

REST API Endpoint Summary

MethodEndpointCapabilityDescription
GET/fieldforge/v1/field-groupsmanage_options (filterable)List field groups
POST/fieldforge/v1/field-groupsmanage_optionsCreate a field group
GET/fieldforge/v1/field-groups/{id}manage_options (filterable)Get a single field group
PUT/fieldforge/v1/field-groups/{id}manage_optionsUpdate a field group
DELETE/fieldforge/v1/field-groups/{id}manage_optionsDelete a field group
GET/fieldforge/v1/fields/{post_id}read_post (per-post)Get all values for a post
PUT/fieldforge/v1/fields/{post_id}manage_optionsUpdate values for a post
GET/fieldforge/v1/options/{page}manage_optionsGet options page values
POST/fieldforge/v1/import/acfmanage_optionsImport from ACF
POST/fieldforge/v1/generatemanage_optionsAI schema generation (PRO, starts at 2 credits)

When the permission check is widened with the filter, GET /field-groups leaves out groups marked private (or with location rules limited to administrators) for users without manage_options, and GET /field-groups/{id} answers 403 for such a group.

—

Forge AI Assistant Online

Hi! I'm the Field Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs