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

# Lemlist: Create Saved Search

> Create Saved Search. Lemlist Create Saved Search reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

Create Saved Search.

<Info>
  Tool ID: `lemlist_create_saved_search`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'lemlist_create_saved_search',
  {
    "name": "Example",
    "filters": [
      {
        "filterId": "filter_123"
      }
    ],
    "mode": "leads"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute lemlist_create_saved_search --input '{
  "name": "Example",
  "filters": [
    {
      "filterId": "filter_123"
    }
  ],
  "mode": "leads"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "data": {
      "_id": "_123"
    }
  }
}
```

Use `deepline tools get lemlist_create_saved_search --json` for the latest machine-readable contract.

## Input reference

Creates a People Database saved search for your team. It shows up in the "Saved searches" menu of the People Database. Filters come from [Get Database Filters](/docs/api-reference/endpoints/people-database/get-database-filters) called with `usage=ui`: a filter not usable in the People Database UI is refused with `FILTER_UNAVAILABLE_FOR_USAGE`, and the error message names the refused filters, comma-separated. Filters incompatible with the `mode` or with your team's plan are dropped silently; if none remain, the request answers `400`. Only the created id is returned. The stored `name` and `filters` are sanitized and plan-gated server-side, so echoing the request payload back would misreport what was persisted; call [Get Saved Search](/docs/api-reference/endpoints/people-database/get-saved-search) to read the stored saved search.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.name` | `string` | Yes | — | Display name, 1 to 200 characters after trimming. Unique within your team. Minimum length: 1. Maximum length: 200. |
| `payload.filters` | `array` | Yes | — | People Database filters of the saved search. 1 to 10 filters of shape `&#123; filterId, in?, out?, exactMatch? &#125;` (no other key: an unknown key such as `type` answers `API_INVALID_FILTERS`), at most 1000 values per `in` / `out` and 1000 characters per value. Minimum items: 1. Maximum items: 10. |
| `payload.mode` | `"leads" \| "companies"` | Yes | — | Search mode the filters target Allowed: `leads`, `companies`. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Creates a People Database saved search for your team. It shows up in the \"Saved searches\" menu of the People Database. Filters come from [Get Database Filters](/api-reference/endpoints/people-database/get-database-filters) called with `usage=ui`: a filter not usable in the People Database UI is refused with `FILTER_UNAVAILABLE_FOR_USAGE`, and the error message names the refused filters, comma-separated. Filters incompatible with the `mode` or with your team's plan are dropped silently; if none remain, the request answers `400`. Only the created id is returned. The stored `name` and `filters` are sanitized and plan-gated server-side, so echoing the request payload back would misreport what was persisted; call [Get Saved Search](/api-reference/endpoints/people-database/get-saved-search) to read the stored saved search.",
    "properties": {
      "name": {
        "type": "string",
        "description": "Display name, 1 to 200 characters after trimming. Unique within your team.",
        "minLength": 1,
        "maxLength": 200
      },
      "filters": {
        "type": "array",
        "description": "People Database filters of the saved search. 1 to 10 filters of shape `{ filterId, in?, out?, exactMatch? }` (no other key: an unknown key such as `type` answers `API_INVALID_FILTERS`), at most 1000 values per `in` / `out` and 1000 characters per value.",
        "minItems": 1,
        "maxItems": 10,
        "items": {
          "type": "object",
          "description": "One People Database filter, as stored in a persona or a saved search. `in` includes matching values, `out` excludes them. There is no `type` property: it is derived from `filterId` server-side.",
          "properties": {
            "filterId": {
              "type": "string",
              "description": "People Database filter identifier. Use [Get Database Filters](/api-reference/endpoints/people-database/get-database-filters) to discover the valid ids."
            },
            "in": {
              "type": "array",
              "description": "Values to include",
              "items": {
                "type": "string"
              }
            },
            "out": {
              "type": "array",
              "description": "Values to exclude",
              "items": {
                "type": "string"
              }
            },
            "exactMatch": {
              "type": "boolean",
              "description": "Exact-match toggle, for the text filters that support it"
            }
          },
          "required": [
            "filterId"
          ],
          "additionalProperties": false
        }
      },
      "mode": {
        "type": "string",
        "description": "Search mode the filters target",
        "enum": [
          "leads",
          "companies"
        ]
      }
    },
    "required": [
      "name",
      "filters",
      "mode"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.data` | `object` | No | — | — |
| `result.data.data._id` | `string` | No | — | Id of the created saved search |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "_id": {
                "type": "string",
                "description": "Id of the created saved search"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Lemlist provider guide](/docs/providers/lemlist/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.