POST
/
v1
/
assets
/
search
curl --request POST \
  --url https://api.mixpeek.com/v1/assets/search \
  --header 'Content-Type: application/json' \
  --data '{
  "query": {
    "key": [
      "title",
      "description"
    ],
    "value": "search term"
  },
  "collections": [
    "col_123",
    "my_collection"
  ],
  "filters": {
    "case_sensitive": true,
    "AND": [
      {
        "key": "name",
        "operator": "eq",
        "value": "John"
      },
      {
        "key": "age",
        "operator": "gte",
        "value": 30
      }
    ],
    "OR": [
      {
        "key": "status",
        "operator": "eq",
        "value": "active"
      },
      {
        "key": "role",
        "operator": "eq",
        "value": "admin"
      }
    ],
    "NOR": [
      {
        "key": "department",
        "operator": "eq",
        "value": "HR"
      },
      {
        "key": "location",
        "operator": "eq",
        "value": "remote"
      }
    ]
  },
  "sort": {
    "field": "score",
    "direction": "desc"
  },
  "select": [
    "<string>"
  ],
  "return_url": true
}'
{
  "results": [
    {
      "asset_id": "ast_123",
      "collection_id": "col_123",
      "status": "processing",
      "file_data": {
        "file_size_bytes": 1000000,
        "file_type": "image/jpeg"
      },
      "metadata": {
        "description": "A new description",
        "title": "New Title"
      },
      "error": "<any>",
      "modality": "image",
      "task_id": "task123",
      "file_hash": "hash123",
      "updated_at": "2023-01-01T00:00:00.000Z",
      "created_at": "2023-01-01T00:00:00.000Z",
      "score": 0.5,
      "url": "<string>",
      "preview_url": "<string>",
      "duplicate_of": "<string>"
    }
  ],
  "pagination": {
    "total": 123,
    "page": 123,
    "page_size": 123,
    "total_pages": 123,
    "next_page": "<string>",
    "previous_page": "<string>"
  }
}

Headers

Authorization
string | null

Bearer token authentication using your API key. Format: 'Bearer your_api_key'. To get an API key, create an account at mixpeek.com/start and generate a key in your account settings. Example: 'Bearer sk_1234567890abcdef'

X-Namespace
string | null

Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.

Body

application/json
collections
string[]
required

List of Collection IDs or Names to search within, required

query
object | null

Structured query object specifying which fields to search in and what to search for

filters
object | null

Complex nested query filters

sort
object | null

List of fields to sort by

select
string[] | null

List of fields to return in results

return_url
boolean | null
default:
false

Return the presigned URL for the asset and preview asset, this will introduce additional latency

Response

200
application/json
Successful Response
results
object[]
required
pagination
object
required