Advanced Filtering
curl --request POST \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/search \
--header 'Content-Type: application/json' \
--data '
{
"filter": {},
"sort": [
{}
],
"pagination": {
"lastKey": "<string>",
"limit": 123
}
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/search"
payload = {
"filter": {},
"sort": [{}],
"pagination": {
"lastKey": "<string>",
"limit": 123
}
}
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: {}, sort: [{}], pagination: {lastKey: '<string>', limit: 123}})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/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}/assets/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' => [
],
'sort' => [
[
]
],
'pagination' => [
'lastKey' => '<string>',
'limit' => 123
]
]),
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}/assets/search"
payload := strings.NewReader("{\n \"filter\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {\n \"lastKey\": \"<string>\",\n \"limit\": 123\n }\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}/assets/search")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {\n \"lastKey\": \"<string>\",\n \"limit\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/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 \"sort\": [\n {}\n ],\n \"pagination\": {\n \"lastKey\": \"<string>\",\n \"limit\": 123\n }\n}"
response = http.request(request)
puts response.read_bodyAsset Searching
Advanced Filtering
Complex asset queries using filter operators
POST
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
assets
/
search
Advanced Filtering
curl --request POST \
--url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/search \
--header 'Content-Type: application/json' \
--data '
{
"filter": {},
"sort": [
{}
],
"pagination": {
"lastKey": "<string>",
"limit": 123
}
}
'import requests
url = "https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/search"
payload = {
"filter": {},
"sort": [{}],
"pagination": {
"lastKey": "<string>",
"limit": 123
}
}
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: {}, sort: [{}], pagination: {lastKey: '<string>', limit: 123}})
};
fetch('https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/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}/assets/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' => [
],
'sort' => [
[
]
],
'pagination' => [
'lastKey' => '<string>',
'limit' => 123
]
]),
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}/assets/search"
payload := strings.NewReader("{\n \"filter\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {\n \"lastKey\": \"<string>\",\n \"limit\": 123\n }\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}/assets/search")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {},\n \"sort\": [\n {}\n ],\n \"pagination\": {\n \"lastKey\": \"<string>\",\n \"limit\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/assets/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 \"sort\": [\n {}\n ],\n \"pagination\": {\n \"lastKey\": \"<string>\",\n \"limit\": 123\n }\n}"
response = http.request(request)
puts response.read_bodyFor complex queries, use the POST method with a JSON request body that provides greater expressiveness than query parameters.
Path Parameters
Request Body
Example Request
{
"filter": {
"type": {
"in": ["image/jpeg", "image/png"]
},
"tags": {
"any": ["hero", "product"]
},
"status": {
"eq": "active"
},
"updatedAt": {
"gte": "2024-01-01T00:00:00Z",
"lte": "2024-12-31T23:59:59Z"
}
},
"sort": [
{ "field": "updatedAt", "order": "desc" }
],
"pagination": {
"limit": 10
}
}
Response
Returns paginated asset results matching the filter criteria.{
"data": [
{
"id": "asset123",
"name": "hero-image.jpg",
"type": "image/jpeg",
"size": 245760,
"status": "active",
"tags": ["hero", "homepage"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-20T10:00:00Z"
}
],
"pagination": {
"lastKey": "eyJwayI6Ik9SR..."
}
}
Combined Approach
You can combine query parameters with a request body. Body filters take precedence when there are conflicts.POST /app/v1/organizations/:organizationId/projects/:projectId/assets/search?status=active&sort=updatedAt:desc
{
"filter": {
"type": {
"in": ["image/jpeg", "image/png"]
},
"tags": {
"any": ["hero", "product"]
}
}
}
Code Examples
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/search" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"type": { "in": ["image/jpeg", "image/png", "image/webp"] },
"status": { "eq": "active" }
},
"sort": [{ "field": "updatedAt", "order": "desc" }],
"pagination": { "limit": 50 }
}'
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/search',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filter: {
type: { in: ['image/jpeg', 'image/png', 'image/webp'] },
status: { eq: 'active' }
},
sort: [{ field: 'updatedAt', order: 'desc' }],
pagination: { limit: 50 }
})
}
);
const { data: assets, pagination } = await response.json();
console.log(`Found ${assets.length} matching assets`);