3. REST API Overview | Form Forge - Build Forms with AI in Seconds
Download Log in

3. REST API Overview

Developer Guide

All endpoints are under the namespace formforge/v1. Admin endpoints require manage_options capability. Authentication uses WordPress nonces or application passwords.

Authentication

There are two authentication methods depending on whether the request originates from the browser (admin panel JavaScript) or an external tool.

Application passwords (recommended for external tools, CLI scripts, and third-party integrations):
bash
# Using application passwords
curl -s -u "admin:XXXX XXXX XXXX XXXX" 
  https://example.com/wp-json/formforge/v1/forms
Nonce-based authentication (for JavaScript in the admin panel):
javascript
// Using nonce from the admin page
fetch( formforgeAdmin.restUrl + '/forms', {
    headers: { 'X-WP-Nonce': formforgeAdmin.restNonce }
} )
.then( r => r.json() )
.then( data => console.log( data ) );
Cookie authentication (for logged-in requests from the same domain):
javascript
// jQuery with cookie auth — nonce is still required
jQuery.ajax( {
    url: formforgeAdmin.restUrl + '/forms',
    method: 'GET',
    beforeSend: function( xhr ) {
        xhr.setRequestHeader( 'X-WP-Nonce', formforgeAdmin.restNonce );
    },
    success: function( data ) {
        console.log( 'Forms:', data );
    }
} );

Error Response Format

All error responses follow a consistent structure:

json
{
  "code": "error_code",
  "message": "Human-readable error description.",
  "data": { "status": 403 }
}

Common error codes:

CodeHTTP StatusDescription
rest_forbidden403Missing manage_options capability
not_found404Form or submission does not exist
pro_only403Endpoint requires PRO license
invalid_param400Missing or invalid parameter
rest_no_route404Endpoint does not exist

Endpoint Summary Table

MethodEndpointAuthPlanDescription
GET/formsmanage_optionsFreeList all forms
GET/forms/{id}manage_optionsFreeGet single form
POST/formsmanage_optionsFreeCreate form
PUT/forms/{id}manage_optionsFreeUpdate form
DELETE/forms/{id}manage_optionsFreeDelete form + data
POST/forms/{id}/submitPublic (AJAX)FreeSubmit form
GET/submissions/{form_id}manage_optionsFreeList submissions
GET/analytics/{form_id}manage_optionsPROGet form analytics
POST/generatemanage_optionsPROAI form generation
GET/templatesPublicFreeList templates
GET/templates/categoriesPublicFreeList template categories
POST/stripe/webhookStripe HMACPROStripe event handler

Forge AI Assistant Online

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

Just now
Powered by Forge AI · Browse docs