> ## 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.

# SavedSearch

> Reusable search configurations

The `SavedSearch` type represents stored search configurations that can be executed to retrieve content or assets.

## Type Definition

```graphql theme={null}
type SavedSearch {
  id: ID!
  name: String!
  description: String
  type: SavedSearchType!
}
```

## Fields

| Field         | Type             | Description                    |
| ------------- | ---------------- | ------------------------------ |
| `id`          | ID!              | Unique identifier              |
| `name`        | String!          | Search name                    |
| `description` | String           | Optional description           |
| `type`        | SavedSearchType! | Search type (CONTENT or ASSET) |

## SavedSearchType Enum

```graphql theme={null}
enum SavedSearchType {
  CONTENT
  ASSET
}
```

| Value     | Description                  |
| --------- | ---------------------------- |
| `CONTENT` | Search returns content items |
| `ASSET`   | Search returns asset items   |

## Example Queries

### List Saved Searches

```graphql theme={null}
query GetSavedSearches($type: SavedSearchType, $cursor: String) {
  savedSearches(type: $type, cursor: $cursor, limit: 20) {
    data {
      id
      name
      description
      type
    }
    pagination {
      cursor
      hasMore
      limit
    }
  }
}
```

### Get Single Saved Search

```graphql theme={null}
query GetSavedSearch($id: ID!) {
  savedSearch(id: $id) {
    id
    name
    description
    type
  }
}
```

Response:

```json theme={null}
{
  "data": {
    "savedSearch": {
      "id": "ss123",
      "name": "Recent Tutorials",
      "description": "Tutorials updated in the last 30 days",
      "type": "CONTENT"
    }
  }
}
```

### Execute Saved Search

```graphql theme={null}
query ExecuteSavedSearch($id: ID!, $cursor: String) {
  executeSavedSearch(id: $id, cursor: $cursor, limit: 20) {
    ... on ContentList {
      data {
        id
        name
        tags
      }
      pagination {
        cursor
        hasMore
        limit
      }
    }
    ... on AssetList {
      data {
        id
        name
        url
      }
      pagination {
        cursor
        hasMore
        limit
      }
    }
  }
}
```

## SavedSearchResult Union

The `executeSavedSearch` query returns a union type:

```graphql theme={null}
union SavedSearchResult = ContentList | AssetList
```

Use inline fragments to handle each result type:

```graphql theme={null}
... on ContentList {
  data { id name }
}
... on AssetList {
  data { id url }
}
```

## Related Types

* [Content](/graphql/types/content) - Content items returned by CONTENT searches
* [Asset](/graphql/types/asset) - Assets returned by ASSET searches
