The Content API provides flexible search with both simple query parameters and advanced filtering through request bodies.
Path Parameters
Query Parameters
Filter by tag ID (can be repeated for multiple tags)
Filter by status: draft, modified, published, unpublished, or deleted
Sort field and direction (e.g., name:asc, updatedAt:desc)
Created date range start (ISO format)
Created date range end (ISO format)
Response
Example Response
{
"data": [
{
"id": "cont124",
"typeId": "ct123",
"typeVersion": 2,
"version": 1,
"lastPublishedVersion": 1,
"packageVersion": "1.0.0",
"name": "Getting Started Guide",
"status": "published",
"isTemplate": false,
"content": { ... },
"tags": ["Tutorial"],
"metadata": {
"author": "[email protected]",
"locale": "en-US"
},
"createdAt": "2024-03-21T10:00:00Z",
"updatedAt": "2024-03-21T14:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 42,
"pages": 3
}
}
Advanced Filtering (POST Method)
For complex queries, use the POST method with a JSON request body:
POST /v1/organizations/{organizationId}/projects/{projectId}/content
Request Body
{
"filter": {
"type": {
"eq": "article"
},
"tags": {
"all": ["technology", "ai"]
},
"status": {
"eq": "published"
},
"metadata.author": {
"eq": "[email protected]"
},
"createdAt": {
"gte": "2024-01-01T00:00:00Z",
"lte": "2024-12-31T23:59:59Z"
}
},
"sort": [
{ "field": "updatedAt", "order": "desc" },
{ "field": "name", "order": "asc" }
],
"page": 1,
"limit": 20
}
Filter Operators
| Operator | Description | Example |
|---|
eq | Equals | {"status": {"eq": "published"}} |
ne | Not equals | {"status": {"ne": "archived"}} |
in | In array | {"type": {"in": ["article", "blog"]}} |
nin | Not in array | {"tags": {"nin": ["draft", "private"]}} |
all | Contains all values | {"tags": {"all": ["featured", "news"]}} |
any | Contains any values | {"tags": {"any": ["tech", "ai"]}} |
gt | Greater than | {"version": {"gt": 1}} |
gte | Greater than or equal | {"createdAt": {"gte": "2024-01-01"}} |
lt | Less than | {"version": {"lt": 3}} |
lte | Less than or equal | {"updatedAt": {"lte": "2024-12-31"}} |
like | Pattern matching | {"name": {"like": "intro%"}} |
exists | Field exists | {"publishedAt": {"exists": true}} |
Available Sort Fields
| Field | Description |
|---|
name | Sort by resource name |
createdAt | Sort by creation date |
updatedAt | Sort by last modification date (default) |
type | Sort by content type |
When no sort is specified, content is sorted by updatedAt:desc by default.
Code Examples
curl -X GET "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content?type=article&status=published&sort=updatedAt:desc" \
-H "Authorization: Bearer YOUR_API_KEY"