Skip to main content
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": [
    {}
  ],
  "lastKey": "<string>",
  "limit": 123
}
'
For complex queries, use the POST method with a JSON request body that provides greater expressiveness than query parameters.

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID

Request Body

filter
object
Filter conditions using operators
sort
array
Array of sort objects with field and order
lastKey
string
Pagination cursor from previous response
limit
number
default:"10"
Items per page (default: 10)

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" }
  ],
  "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=createdAt: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": { "like": "image/%" },
      "status": { "eq": "active" }
    },
    "sort": [{ "field": "updatedAt", "order": "desc" }],
    "limit": 50
  }'