Update PageMeta
Update a page meta
HTTP Request
PATCH/api/pages/base/:page_id/meta/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff with PageMetaPermission or Admin
- Permission Code: 3023
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page_id | Integer | Yes | Unique ID of the page |
| id | Integer | Yes | Unique ID of the page meta to update |
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# update a meta, replacing a text value with file value
4response = requests.post('http://www.example.com/api/pages/38/meta/9',
5 json={
6 "key": "contact_us_url",
7 "value_text": null,
8 "value_file": 4
9 },
10 headers={'Authorization': 'Token <your_api_key>'}
11)
12print(response.json())1# update a meta, replacing a text value with file value
2curl -X POST "http://www.example.com/api/pages/38/meta/9" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "key": "tob_image",
7 "value_text": null
8 "value_file": 4
9}'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 |
Response Example
{
"id": 9,
"key": "contact_us_url_edited",
"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-20T12:58:59.259960Z",
"updated_at": "2025-12-20T15:39:12.606302Z"
}
NOTE
- Either one of value_file or value_text must be provided
- If you need to set a file value for a page meta with an existing text value, you should set the text value to null in the same request and vice versa
keyis unique for each page not among all pages, so there may be two keys namedfoofor two different pages