Pages API
Endpoints for managing pages in the system.
Get Pages List
Get the complete list of pages.
Request
GET /api/flute-pages
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"pages": [
{
"id": 1,
"title": "Home Page",
"slug": "home",
"is_active": true,
"created_at": "2023-01-01T00:00:00Z"
},
{
"id": 2,
"title": "About Us",
"slug": "about",
"is_active": true,
"created_at": "2023-01-02T00:00:00Z"
}
]
}
Response Fields
Field | Type | Description |
---|---|---|
pages | array | Array of pages |
id | integer | Page ID |
title | string | Page title |
slug | string | URL-compatible identifier |
is_active | boolean | Page active status |
created_at | string | Creation date |
Response Codes
Code | Description |
---|---|
200 | Successful request |
401 | Invalid or missing API key |
403 | Insufficient permissions to perform request |
Get Page Data
Get detailed information about a specific page.
Request
GET /api/flute-pages/{id}
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | Page ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"page": {
"id": 1,
"title": "Home Page",
"slug": "home",
"content": "<h1>Welcome!</h1><p>This is our website's home page.</p>",
"meta_title": "Home - Our Site",
"meta_description": "Home page of our project",
"is_active": true,
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-10T00:00:00Z"
}
}
Response Fields
Field | Type | Description |
---|---|---|
page | object | Page object |
id | integer | Page ID |
title | string | Page title |
slug | string | URL-compatible identifier |
content | string | HTML page content |
meta_title | string | META title for SEO |
meta_description | string | META description for SEO |
is_active | boolean | Page active status |
created_at | string | Creation date |
updated_at | string | Update date |
Response Codes
Code | Description |
---|---|
200 | Successful request |
401 | Invalid or missing API key |
403 | Insufficient permissions to perform request |
404 | Page not found |
Create Page
Create a new page in the system.
Request
POST /api/flute-pages
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request Body
{
"title": "New Page",
"slug": "new-page",
"content": "<h1>New Page</h1><p>New page content.</p>",
"meta_title": "New Page - Our Site",
"meta_description": "New page description",
"is_active": true
}
Request Body Parameters
Name | Type | Description |
---|---|---|
title | string | Required. Page title |
slug | string | Required. URL identifier |
content | string | Required. HTML content |
meta_title | string | Optional. META title |
meta_description | string | Optional. META description |
is_active | boolean | Optional. Active status |
Response
{
"message": "Page created successfully",
"page": {
"id": 3,
"title": "New Page",
"slug": "new-page",
"content": "<h1>New Page</h1><p>New page content.</p>",
"meta_title": "New Page - Our Site",
"meta_description": "New page description",
"is_active": true,
"created_at": "2023-03-15T12:00:00Z"
}
}
Response Codes
Code | Description |
---|---|
201 | Page successfully created |
401 | Invalid or missing API key |
403 | Insufficient permissions to perform request |
422 | Invalid request parameters |
Update Page
Update data of an existing page.
Request
PUT /api/flute-pages/{id}
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | Page ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Content-Type | string | Required. application/json |
Request Body
{
"title": "Updated Page",
"content": "<h1>Updated Page</h1><p>Updated page content.</p>",
"meta_title": "Updated Page - Our Site",
"meta_description": "Updated page description",
"is_active": true
}
Request Body Parameters
Name | Type | Description |
---|---|---|
title | string | Optional. Page title |
slug | string | Optional. URL identifier |
content | string | Optional. HTML content |
meta_title | string | Optional. META title |
meta_description | string | Optional. META description |
is_active | boolean | Optional. Active status |
Response
{
"message": "Page updated successfully",
"page": {
"id": 3,
"title": "Updated Page",
"slug": "new-page",
"content": "<h1>Updated Page</h1><p>Updated page content.</p>",
"meta_title": "Updated Page - Our Site",
"meta_description": "Updated page description",
"is_active": true,
"updated_at": "2023-03-16T14:30:00Z"
}
}
Response Codes
Code | Description |
---|---|
200 | Page successfully updated |
401 | Invalid or missing API key |
403 | Insufficient permissions to perform request |
404 | Page not found |
422 | Invalid request parameters |
Delete Page
Delete a page from the system.
Request
DELETE /api/flute-pages/{id}
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | Page ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"message": "Page deleted successfully"
}
Response Codes
Code | Description |
---|---|
200 | Page successfully deleted |
401 | Invalid or missing API key |
403 | Insufficient permissions to perform request |
404 | Page not found |
Get Page Blocks
Get the list of blocks attached to a page.
Request
GET /api/flute-pages/{id}/blocks
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | Page ID |
Headers
Name | Type | Description |
---|---|---|
X-API-Key | string | Required. API key |
Response
{
"blocks": [
{
"id": 1,
"type": "text",
"content": "<p>This is the first text block</p>",
"order": 1
},
{
"id": 2,
"type": "image",
"content": {
"url": "/uploads/image.jpg",
"alt": "Image",
"width": 800,
"height": 600
},
"order": 2
}
]
}
Response Fields
Field | Type | Description |
---|---|---|
blocks | array | Array of blocks |
id | integer | Block ID |
type | string | Block type (text, image, etc) |
content | mixed | Block content |
order | integer | Display order |
Response Codes
Code | Description |
---|---|
200 | Successful request |
401 | Invalid or missing API key |
403 | Insufficient permissions to perform request |
404 | Page not found |