Create meta for specific page
Creates a new meta for a specific page
HTTP Request
POST/api/pages/base/:page_id/meta
Authorization
Authorization
- Required: Yes
- Permission: Staff with PageMetaPermission or Admin
- Permission Code: 3021
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page_id | Integer | Yes | Unique ID of the page |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| key | String | Yes | The meta key name |
| value_text | String | No | The text value of the meta data(nullable) |
| value_file | integer | No | The `id` of the file related to the key(nullable) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Create a new meta with text value for a page
4response = requests.post('http://www.example.com/api/pages/38/meta',
5 json={
6 "key": "contact_us_url",
7 "value_text": "https://www.example.com/contact_us",
8 "value_file": null
9 },
10 headers={'Authorization': 'Token <your_api_key>'}
11)
12print(response.json())1# Create a new meta with file value for a page
2curl -X POST "http://www.example.com/api/pages/" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "key": "tob_image",
7 "value_file": 10
8}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Id of the page meta(unique) |
| key | String | The key name of the meta(unique for the page) |
| value_text | String | The text value of the meta (nullable) |
| value_file_data | Object | The file related to the meta (nullable) |
| created_at | String (ISO 8601) | Timestamp when the page was created |
| updated_at | String (ISO 8601) | Timestamp when the page was last updated |
Value File Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Id of the file (unique) |
| type | String | Type of the file (image, text, video, ...) |
| name | String | File name (nullable) |
| size | String | Size of the file(nullable) |
| human_readable_size | String | A human readable size for the file |
| f | String | url to the file |
Example Response: with text value
{
"id": 11,
"key": "contact_us_title",
"value_text": "contact us here",
"value_file_data": null,
"created_at": "2025-12-20T13:44:32.675793Z",
"updated_at": "2025-12-20T13:44:32.675801Z"
}
Example Response: with file value
{
"id": 10,
"key": "contact_us_img",
"value_text": null,
"value_file_data": {
"id": 4,
"type": "image",
"name": "rams",
"size": 118805,
"human_readable_size": "116.02 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/11/29/RAMFeatured.jpg"
},
"created_at": "2025-12-20T13:41:07.046727Z",
"updated_at": "2025-12-20T13:41:07.046735Z"
}
NOTES
- Each page meta must have one and only one value (either text value or file value)