Skip to main content

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

ParameterTypeRequiredDescription
page_idIntegerYesUnique ID of the page

Request Body

FieldTypeRequiredDescription
keyStringYesThe meta key name
value_textStringNoThe text value of the meta data(nullable)
value_fileintegerNoThe `id` of the file related to the key(nullable)

Example Requests

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())

Response Fields

FieldTypeDescription
idIntegerId of the page meta(unique)
keyStringThe key name of the meta(unique for the page)
value_textStringThe text value of the meta (nullable)
value_file_dataObjectThe file related to the meta (nullable)
created_atString (ISO 8601)Timestamp when the page was created
updated_atString (ISO 8601)Timestamp when the page was last updated

Value File Structure

FieldTypeDescription
idIntegerId of the file (unique)
typeStringType of the file (image, text, video, ...)
nameStringFile name (nullable)
sizeStringSize of the file(nullable)
human_readable_sizeStringA human readable size for the file
fStringurl 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)