> ## 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: Get Saved Search

> Get one of your team's Lemlist People Database saved searches, with its filters. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Get one of your team's Lemlist People Database saved searches, with its filters.

> [!NOTE]
>
> Tool ID: `lemlist_get_saved_search`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'lemlist_get_saved_search',
  {
    "savedSearchId": "saved_search_123"
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute lemlist_get_saved_search --input '{
  "savedSearchId": "saved_search_123"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "data": {
      "_id": "_123",
      "name": "Example",
      "mode": "leads"
    }
  }
}
```

Use `deepline describe lemlist_get_saved_search --json` for the latest machine-readable contract.

## Input reference

Retrieves one of your team's saved searches. An unknown id and a saved search belonging to another team answer the same `404`.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.savedSearchId` | `string` | Yes | — | Id of the saved search Minimum length: 1. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Retrieves one of your team's saved searches. An unknown id and a saved search belonging to another team answer the same `404`.",
    "properties": {
      "savedSearchId": {
        "type": "string",
        "description": "Id of the saved search",
        "minLength": 1
      }
    },
    "required": [
      "savedSearchId"
    ],
    "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 | — | A People Database saved search: a named set of People Database filters saved by your team. It appears in the "Saved searches" menu of the People Database. |
| `result.data.data._id` | `string` | No | — | Unique saved search identifier |
| `result.data.data.name` | `string` | No | — | Display name. Unique within your team. |
| `result.data.data.mode` | `"leads" \| "companies"` | No | — | Search mode the filters target. Always set: saved searches created before modes existed read as `leads`. Allowed: `leads`, `companies`. |
| `result.data.data.filters` | `array` | No | — | People Database filters of the saved search. Same shape as the search endpoints accept, so they can be sent back as is to [Search People Database](https://deepline.com/docs/api-reference/endpoints/people-database/search-people-database) or [Search Companies Database](https://deepline.com/docs/api-reference/endpoints/people-database/search-companies-database). |
| `result.data.data.filters[].filterId` | `string` | Yes | — | People Database filter identifier. Use [Get Database Filters](https://deepline.com/docs/api-reference/endpoints/people-database/get-database-filters) to discover the valid ids. |
| `result.data.data.filters[].in` | `array` | No | — | Values to include |
| `result.data.data.filters[].out` | `array` | No | — | Values to exclude |
| `result.data.data.filters[].exactMatch` | `boolean` | No | — | Exact-match toggle, for the text filters that support it |
| `result.data.data.createdAt` | `string` | No | — | Date the saved search was created Format: `date-time`. |
| `result.data.data.lastResultsCount` | `number` | No | — | Number of results the saved search returned the last time it was saved or run |
| `result.data.data.lastResultsCountUpdatedAt` | `string` | No | — | Date `lastResultsCount` was last computed Format: `date-time`. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

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

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "data": {
            "type": "object",
            "description": "A People Database saved search: a named set of People Database filters saved by your team. It appears in the \"Saved searches\" menu of the People Database.",
            "properties": {
              "_id": {
                "type": "string",
                "description": "Unique saved search identifier"
              },
              "name": {
                "type": "string",
                "description": "Display name. Unique within your team."
              },
              "mode": {
                "type": "string",
                "description": "Search mode the filters target. Always set: saved searches created before modes existed read as `leads`.",
                "enum": [
                  "leads",
                  "companies"
                ]
              },
              "filters": {
                "type": "array",
                "description": "People Database filters of the saved search. Same shape as the search endpoints accept, so they can be sent back as is to [Search People Database](/api-reference/endpoints/people-database/search-people-database) or [Search Companies Database](/api-reference/endpoints/people-database/search-companies-database).",
                "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
                }
              },
              "createdAt": {
                "type": "string",
                "description": "Date the saved search was created",
                "format": "date-time"
              },
              "lastResultsCount": {
                "type": "number",
                "description": "Number of results the saved search returned the last time it was saved or run"
              },
              "lastResultsCountUpdatedAt": {
                "type": "string",
                "description": "Date `lastResultsCount` was last computed",
                "format": "date-time"
              }
            },
            "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](https://deepline.com/docs/providers/lemlist/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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