MAPI Documentation
The Meta API (MAPI) enables you to create dynamic data structures (entities) and manage content records programmatically.
Authentication
MAPI requests require both a Bearer token AND an X-Project-ID header for meta operations:
Authorization: Bearer {your_api_token}
X-Project-ID: {your_project_id} // Required for /mapi/entities endpoints
Base URL
https://api.websitepublisher.ai
Entities
Entities are like database tables. You define the structure, MAPI creates it.
List all entities in the project.
Headers: Authorization, X-Project-ID
Create a new entity with properties.
Request Body
{
"name": "blogpost",
"plural": "blogposts",
"properties": [
{"name": "title", "type": "varchar", "length": 200, "required": true},
{"name": "content", "type": "text", "required": true},
{"name": "published", "type": "tinyint", "default": 0},
{"name": "published_at", "type": "datetime"}
]
}
Delete an entity and all its records.
Properties
Add a new property to an existing entity.
{
"name": "author",
"type": "varchar",
"length": 100
}
Remove a property from an entity.
Note: Use the property ID, not the name.
Property Types
| Type | Description | Parameters |
|---|---|---|
varchar |
Short text string | length (max 255) |
text |
Long text content | None |
int |
Integer number | None |
tinyint |
Boolean (0/1) | None |
datetime |
Date and time | Format: YYYY-MM-DD HH:MM:SS |
Records (CRUD)
Once you've created an entity, manage its records:
List all records. Supports pagination.
Query params: ?limit=10&offset=0
Create a new record.
{
"title": "My First Blog Post",
"content": "This is the content...",
"published": 1,
"published_at": "2026-01-13 10:00:00"
}
Get a specific record by ID.
Update a record.
Delete a record.
Search & Filter
Search records with filters.
{
"filters": {
"published": 1
}
}
Get the total count of records.
Complete Example
Creating a blog system:
# 1. Create the blogpost entity
curl -X POST "https://api.websitepublisher.ai/mapi/entities" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Project-ID: 22253" \
-H "Content-Type: application/json" \
-d '{
"name": "blogpost",
"plural": "blogposts",
"properties": [
{"name": "title", "type": "varchar", "length": 200, "required": true},
{"name": "slug", "type": "varchar", "length": 100, "required": true},
{"name": "content", "type": "text", "required": true},
{"name": "published", "type": "tinyint", "default": 0}
]
}'
# 2. Create a blog post
curl -X POST "https://api.websitepublisher.ai/mapi/project/22253/blogpost" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Hello World",
"slug": "hello-world",
"content": "This is my first blog post!",
"published": 1
}'
# 3. List published posts
curl -X POST "https://api.websitepublisher.ai/mapi/project/22253/blogpost/search" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"filters": {"published": 1}}'
Powered by WebSumo