Search Content
curl --request POST \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search \
--header 'Content-Type: application/json' \
--data '
{
"filter": {},
"filter.status": {},
"filter.name": {},
"filter.typeId": {},
"filter.isTemplate": {},
"filter.tags": {},
"filter.updatedAt": {},
"filter.hasPublishedVersion": {},
"sort": [
{}
],
"pagination": {},
"query": "<string>"
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search"
payload = {
"filter": {},
"filter.status": {},
"filter.name": {},
"filter.typeId": {},
"filter.isTemplate": {},
"filter.tags": {},
"filter.updatedAt": {},
"filter.hasPublishedVersion": {},
"sort": [{}],
"pagination": {},
"query": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {},
'filter.status': {},
'filter.name': {},
'filter.typeId': {},
'filter.isTemplate': {},
'filter.tags': {},
'filter.updatedAt': {},
'filter.hasPublishedVersion': {},
sort: [{}],
pagination: {},
query: '<string>'
})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
],
'filter.status' => [
],
'filter.name' => [
],
'filter.typeId' => [
],
'filter.isTemplate' => [
],
'filter.tags' => [
],
'filter.updatedAt' => [
],
'filter.hasPublishedVersion' => [
],
'sort' => [
[
]
],
'pagination' => [
],
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search"
payload := strings.NewReader("{\n \"filter\": {},\n \"filter.status\": {},\n \"filter.name\": {},\n \"filter.typeId\": {},\n \"filter.isTemplate\": {},\n \"filter.tags\": {},\n \"filter.updatedAt\": {},\n \"filter.hasPublishedVersion\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {},\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {},\n \"filter.status\": {},\n \"filter.name\": {},\n \"filter.typeId\": {},\n \"filter.isTemplate\": {},\n \"filter.tags\": {},\n \"filter.updatedAt\": {},\n \"filter.hasPublishedVersion\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {},\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {},\n \"filter.status\": {},\n \"filter.name\": {},\n \"filter.typeId\": {},\n \"filter.isTemplate\": {},\n \"filter.tags\": {},\n \"filter.updatedAt\": {},\n \"filter.hasPublishedVersion\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {},\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyContent
Search Content
Search content using advanced filters
POST
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
search
Search Content
curl --request POST \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search \
--header 'Content-Type: application/json' \
--data '
{
"filter": {},
"filter.status": {},
"filter.name": {},
"filter.typeId": {},
"filter.isTemplate": {},
"filter.tags": {},
"filter.updatedAt": {},
"filter.hasPublishedVersion": {},
"sort": [
{}
],
"pagination": {},
"query": "<string>"
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search"
payload = {
"filter": {},
"filter.status": {},
"filter.name": {},
"filter.typeId": {},
"filter.isTemplate": {},
"filter.tags": {},
"filter.updatedAt": {},
"filter.hasPublishedVersion": {},
"sort": [{}],
"pagination": {},
"query": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {},
'filter.status': {},
'filter.name': {},
'filter.typeId': {},
'filter.isTemplate': {},
'filter.tags': {},
'filter.updatedAt': {},
'filter.hasPublishedVersion': {},
sort: [{}],
pagination: {},
query: '<string>'
})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
],
'filter.status' => [
],
'filter.name' => [
],
'filter.typeId' => [
],
'filter.isTemplate' => [
],
'filter.tags' => [
],
'filter.updatedAt' => [
],
'filter.hasPublishedVersion' => [
],
'sort' => [
[
]
],
'pagination' => [
],
'query' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search"
payload := strings.NewReader("{\n \"filter\": {},\n \"filter.status\": {},\n \"filter.name\": {},\n \"filter.typeId\": {},\n \"filter.isTemplate\": {},\n \"filter.tags\": {},\n \"filter.updatedAt\": {},\n \"filter.hasPublishedVersion\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {},\n \"query\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {},\n \"filter.status\": {},\n \"filter.name\": {},\n \"filter.typeId\": {},\n \"filter.isTemplate\": {},\n \"filter.tags\": {},\n \"filter.updatedAt\": {},\n \"filter.hasPublishedVersion\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {},\n \"query\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/content/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {},\n \"filter.status\": {},\n \"filter.name\": {},\n \"filter.typeId\": {},\n \"filter.isTemplate\": {},\n \"filter.tags\": {},\n \"filter.updatedAt\": {},\n \"filter.hasPublishedVersion\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {},\n \"query\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySearch content using filters. Supports both GET (query parameters) and POST (request body) methods.
GET Method
GET
Use query parameters for simple searches.
/app/v1/organizations//projects//content/searchPOST Method
POST
Use request body for advanced filtering with operators.
/app/v1/organizations//projects//content/searchPath Parameters
string
required
Organization ID
string
required
Project ID
Query Parameters (GET)
string
Filter by status:
draft, published, modified, deletedstring
Filter by name (minimum 3 characters)
string
Filter by content type ID
string
Filter templates:
true or falsestring | string[]
Filter by tag(s)
string
Filter by updated date (from)
string
Filter by updated date (to)
string
Natural language query for semantic search (1-500 characters)
string
Sort field and order (e.g.,
updatedAt:desc)string
Page number
string
Items per page (max 100)
Request Body (POST)
object
Filter conditions
object
Status filter with operators:
eq, neq, inobject
Name filter with operators:
eq, neq, likeobject
Content type filter with operators:
eq, neq, inobject
Template filter with operators:
eq, neqobject
Tags filter with operators:
eq, any, allobject
Updated date filter with operators:
lt, lte, gt, gteobject
Filter by whether content has a published version:
eqarray
Sort configuration array
object
Pagination options with
page, limitstring
Natural language query for semantic search
Example Request (POST)
{
"filter": {
"status": { "eq": "published" },
"typeId": { "in": ["ct-article", "ct-blog"] },
"tags": { "any": ["featured", "trending"] }
},
"sort": [
{ "field": "updatedAt", "order": "desc" }
],
"pagination": {
"limit": 20,
"page": 1
}
}
Response
{
"data": [
{
"id": "cont123",
"name": "Getting Started Guide",
"typeId": "ct-article",
"status": "published",
"version": 3,
"lastPublishedVersion": 3,
"content": { ... },
"tags": ["featured", "guide"],
"isTemplate": false,
"metadata": { ... },
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-22T10:00:00Z"
}
],
"pagination": {
"lastKey": "eyJwayI6Ik9SR..."
}
}
Filter Operators
| Operator | Description | Example |
|---|---|---|
eq | Equals | {"status": {"eq": "published"}} |
neq | Not equals | {"status": {"neq": "deleted"}} |
like | Contains (case-insensitive) | {"name": {"like": "guide"}} |
in | In array | {"typeId": {"in": ["ct1", "ct2"]}} |
any | Has any of tags | {"tags": {"any": ["featured"]}} |
all | Has all of tags | {"tags": {"all": ["featured", "guide"]}} |
lt | Less than | {"updatedAt": {"lt": "2024-03-22"}} |
lte | Less than or equal | {"updatedAt": {"lte": "2024-03-22"}} |
gt | Greater than | {"updatedAt": {"gt": "2024-03-20"}} |
gte | Greater than or equal | {"updatedAt": {"gte": "2024-03-20"}} |
Code Examples
curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/search?status=published&limit=20" \
-H "Authorization: Bearer YOUR_JWT"
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/search" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"status": {"eq": "published"},
"tags": {"any": ["featured"]}
},
"pagination": {"limit": 20}
}'
// GET method
const searchParams = new URLSearchParams({
status: 'published',
tag: 'featured',
limit: '20'
});
const response = await fetch(
`https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/search?${searchParams}`,
{
headers: {
'Authorization': 'Bearer YOUR_JWT'
}
}
);
// POST method for complex queries
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/search',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filter: {
status: { eq: 'published' },
tags: { any: ['featured'] }
},
pagination: { limit: 20 }
})
}
);
const { data, pagination } = await response.json();