Back to Docs

REST API

Overview

RAVENCIBuilder registers several REST API endpoints under the zionbuilder/v1 namespace. These endpoints power the editor and can be used for custom integrations.

Authentication

All endpoints require a valid WordPress nonce. The editor passes this automatically. For external requests, include the X-WP-Nonce header.

Key Endpoints

Save Page Data

POST /wp-json/zionbuilder/v1/save-page

Saves the builder data for a specific page. Requires edit permissions for the post.

Get Page Data

GET /wp-json/zionbuilder/v1/get-page/{post_id}

Returns the builder data for a specific page.

Get Elements

GET /wp-json/zionbuilder/v1/elements

Returns all registered elements and their configurations.

Render Element

POST /wp-json/zionbuilder/v1/render-element

Server-side renders an element and returns HTML. Used by the editor for dynamic previews.

Media Upload

POST /wp-json/zionbuilder/v1/upload

Upload media files (images, fonts) through the builder.

Custom Endpoints

You can register your own endpoints that integrate with the builder using standard register_rest_route:

add_action('rest_api_init', function() {
    register_rest_route('my-plugin/v1', '/data', [
        'methods' => 'GET',
        'callback' => 'my_callback',
        'permission_callback' => function() {
            return current_user_can('edit_posts');
        },
    ]);
});