# Pages API ## Available Fields | Field | Type | Description | |---|---|---| | `id` | int | Page ID | | `title` | string | Page title (shown in navigation and browser tab) | | `slug` | string | URL path (e.g. `/page/about-us`) | | `description` | string | Short summary used for SEO meta description | | `content` | string | Full page HTML content (supports dynamic blocks) | | `thumbnail` | int | Media file ID for page cover image | | `status` | int | `1` = published/visible, `0` = hidden | | `total_views` | int | View count | | `created_at` | datetime | Creation date | | `updated_at` | datetime | Last update date | --- ## Embedding Media in Content The `content` field supports the same rich editor as articles. To embed images, videos, or audio inline, use dynamic blocks: ```html ``` - `MEDIA_ID` = the numeric ID of the file in the media library (returned by `media` → `upload_from_url`) - `data-size` options: `small`, `medium`, `large` - Works for images, videos, and audio files — same syntax for all three --- ## Get All Pages ```json { "resource": "page", "action": "get", "filters": { "status": 1, "search": "about" }, "fields": ["id", "title", "slug", "status", "created_at"], "limit": 20, "offset": 0, "order_by": "created_at DESC" } ``` | Filter | Description | |---|---| | `search` | Searches in title and slug | | `status` | `1` = published, `0` = hidden | --- ## Get Single Page ```json { "resource": "page", "action": "get", "id": 1 } ``` --- ## Add Page ```json { "resource": "page", "action": "add", "title": "About Us", "slug": "about-us", "description": "Learn more about our editorial team", "content": "

Who We Are

Body HTML...

", "status": 1, "thumbnail": 20 } ``` | Field | Required | Notes | |---|---|---| | `title` | Yes | Page title | | `slug` | No | Auto-generated if empty. No spaces allowed | | `description` | No | SEO meta description | | `content` | No | Full HTML content. Supports dynamic blocks (see above) | | `thumbnail` | No | Media file ID for cover image | | `status` | No | `1` = published, `0` = hidden | --- ## Edit Page All fields are optional except `id`. Only fields included in the request are updated. ```json { "resource": "page", "action": "edit", "id": 5, "title": "About Us - Updated", "slug": "about-us", "description": "Updated SEO description", "content": "

Updated heading

Updated body...

", "thumbnail": 10, "status": 1 } ``` > Note: The default homepage (ID 1) cannot be edited or deleted via API. --- ## Delete Page ```json { "resource": "page", "action": "delete", "id": 5 } ```