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

# search create

> Start a Clay search from structured filters.

Start a Clay search from a source type and a set of structured filter fields. Discover the available fields with [`clay search fields`](/cli/reference/search-fields). The command returns a search id — page through results with [`clay search next`](/cli/reference/search-next).

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay search create --source-type <type> --filters '<json>'
```

## Flags

| Flag                   | Description                                                                                                                                                        |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--source-type <type>` | What to search for. One of `people` or `companies`.                                                                                                                |
| `--filters <json>`     | JSON object whose keys are filter field names for the given source type. Run [`clay search fields`](/cli/reference/search-fields) to list valid fields and values. |

## Output

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "searchId": "search_abc123"
}
```

| Field      | Type   | Description                                                                       |
| ---------- | ------ | --------------------------------------------------------------------------------- |
| `searchId` | string | Pass to [`clay search next`](/cli/reference/search-next) to page through results. |

## Errors

| Code               | Exit | Notes                                                                                                                   |
| ------------------ | ---- | ----------------------------------------------------------------------------------------------------------------------- |
| `validation_error` | 2    | `--filters` is not a JSON object, a filter field or value is invalid, or the workspace's usage quota would be exceeded. |
| `auth_forbidden`   | 3    | The API key lacks access, or the public-API beta is not enabled for the workspace.                                      |
| `not_found`        | 6    | Workspace not found.                                                                                                    |

## Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
clay search create --source-type people --filters '{"job_title_keywords":["growth engineer"],"location_cities_include":["San Francisco"]}'
clay search fields --source-type companies | jq '.fields[].name'
clay search create --source-type companies --filters '{"industries":["Software Development"]}' | jq -r '.searchId'
```
