Overview#
This page documents the Media resource endpoints in the Jalpi Page Builder REST API. All endpoints are registered under the jalpi-page-builder/v1 route namespace and accept JSON payloads with WordPress REST nonce authorization.
See also: REST API Overview, AJAX Actions Reference, and Error Codes Reference.
Endpoints Summary#
| Method | Endpoint | Capability | Description |
|---|---|---|---|
| POST | /wp-json/jalpi-page-builder/v1/media/upload | upload_files | Upload Media |
| GET | /wp-json/jalpi-page-builder/v1/media | edit_posts | List Media |
Upload Media#
POST
{site_url}/wp-json/jalpi-page-builder/v1/media/uploadPermissions & Authentication
Authentication: WordPress cookie session + REST nonce
Capability: upload_files
Permission Callback: Jalpi_API::upload_permission
Parameters#
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
file | body | file | Yes | The image, sent as a multipart file field named exactly 'file'. Read via $request->get_file_params(). |
X-WP-Nonce | header | string | Yes | WordPress REST nonce. |
Content-Type | header | string | Yes | multipart/form-data. This is the one route where the editor's apiFetch wrapper does not set application/json β let the browser set the boundary itself. |
List Media#
GET
{site_url}/wp-json/jalpi-page-builder/v1/mediaPermissions & Authentication
Authentication: WordPress cookie session + REST nonce
Capability: edit_posts
Permission Callback: Jalpi_API::edit_permission
Parameters#
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
X-WP-Nonce | header | string | Yes | WordPress REST nonce. |
Last updated: November 2026