> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Assets

> Search and filter assets with query parameters

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

## Query Parameters

<ParamField query="lastKey" type="string">
  Pagination cursor from previous response
</ParamField>

<ParamField query="limit" type="number">
  Items per page (default: 10)
</ParamField>

<ParamField query="type" type="string">
  Filter by MIME type (e.g., `image/jpeg`, `video/mp4`)
</ParamField>

<ParamField query="tags" type="string">
  Filter by tag IDs (comma-separated)
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `active` or `deleted`
</ParamField>

<ParamField query="search" type="string">
  Search term for name/description
</ParamField>

<ParamField query="sort" type="string">
  Sort field and direction (e.g., `name:asc`, `createdAt:desc`)
</ParamField>

<ParamField query="from" type="string">
  Updated date range start (ISO 8601 format)
</ParamField>

<ParamField query="to" type="string">
  Updated date range end (ISO 8601 format)
</ParamField>

## Response

Returns a paginated list of Asset objects.

```json theme={null}
{
  "data": [
    {
      "id": "asset123",
      "name": "hero-image.jpg",
      "type": "image/jpeg",
      "size": 245760,
      "url": "https://cdn.metabind.ai/assets/asset123/hero-image.jpg",
      "status": "active",
      "tags": ["tag1", "tag2"],
      "metadata": {
        "width": 1920,
        "height": 1080
      },
      "createdAt": "2024-03-20T10:00:00Z",
      "updatedAt": "2024-03-21T15:30:00Z"
    }
  ],
  "pagination": {
    "lastKey": "eyJwayI6Ik9SR..."
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets?type=image/jpeg&sort=createdAt:desc&limit=10" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets?type=image/jpeg&sort=createdAt:desc',
    {
      headers: {
        'Authorization': 'Bearer YOUR_JWT'
      }
    }
  );

  const { data, pagination } = await response.json();
  console.log(`Found ${data.length} assets`);
  ```

  ```swift Swift theme={null}
  var components = URLComponents(string: "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets")!
  components.queryItems = [
      URLQueryItem(name: "type", value: "image/jpeg"),
      URLQueryItem(name: "sort", value: "createdAt:desc")
  ]

  var request = URLRequest(url: components.url!)
  request.setValue("Bearer YOUR_JWT", forHTTPHeaderField: "Authorization")

  let (data, _) = try await URLSession.shared.data(for: request)
  let result = try JSONDecoder().decode(AssetListResponse.self, from: data)
  ```

  ```kotlin Kotlin theme={null}
  val response = client.get("https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets") {
      header("Authorization", "Bearer YOUR_JWT")
      parameter("type", "image/jpeg")
      parameter("sort", "createdAt:desc")
  }

  val result = response.body<AssetListResponse>()
  println("Found ${result.data.size} assets")
  ```
</CodeGroup>
