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

# Discover Lead Filters

> List supported filter schemas and search or paginate all bundled filter values without spending credits.

Requires `leads:read`. Omit `filter` to list the 90 supported public filter definitions. Use `filter` plus optional `search` to inspect its values. `offset` starts at 0; `limit` defaults to 50 and is capped at 100.

Each definition includes its primary `name`, `input_schema`, `value_mode` and REST compatibility aliases. `enum` has a fixed allowed list; `catalog` provides the bundled vocabulary; `free_form` has no exhaustive list. Use primary names in MCP, whose schema does not advertise REST aliases.

```bash theme={null}
curl 'https://api.sendpilot.ai/v1/lead-database/filters?filter=industries&search=software&limit=25' \
  -H "X-API-Key: $SENDPILOT_API_KEY"
```

The response supplies exact `value` entries and readable labels, with `total` and `has_more`. SIC/NAICS include filters use code objects; exclude filters use code strings. Company-size exclusions use numeric codes. Copy the value appropriate to the field's input schema.

All bundled job-title values are reachable through pagination, including beyond the first 70,000 entries. MCP offers this endpoint as `get_lead_search_filters`, with `query` and an opaque `cursor`. Neither form starts a search or spends credits.


## OpenAPI

````yaml GET /v1/lead-database/filters
openapi: 3.0.0
info:
  title: SendPilot External API
  description: >

    # SendPilot External API v1


    Public API for integrating with SendPilot programmatically.


    ## Authentication


    Requests authenticate with a workspace API key in the `X-API-Key` header:


    ```

    X-API-Key: sp_live_your_api_key_here

    ```


    `Authorization: Bearer sp_live_...` (or `sp_test_...`) is also accepted.
    Prefer one header; `X-API-Key` takes precedence. Clerk OAuth tokens for MCP
    connection URLs are not public REST API keys.


    A key only reaches what its scopes and creator's current workspace
    permissions allow. Each operation lists the scopes it needs in
    `x-sp-scopes`. Use `GET /v1/me` to inspect the effective permissions and
    subscription state.


    ## Rate Limits


    - **Per API Key**: 300 requests/minute

    - **Per Workspace**: 50,000 requests/day


    Responses that reach the rate limiter include these headers; early
    authentication failures may not:

    - `X-RateLimit-Limit`: Max requests per minute

    - `X-RateLimit-Remaining`: Remaining requests in current window

    - `X-RateLimit-Reset`: Epoch timestamp when limit resets


    ## LinkedIn Sender Limits


    When using messaging endpoints, these headers show account limits:

    - `X-LinkedIn-Messages-Remaining`: Messages left today

    - `X-LinkedIn-Connections-Remaining`: Connection requests left today

    - `X-LinkedIn-Quota-Reset-At`: When daily limits reset


    ## Retries


    Send an `Idempotency-Key` header on POST and PATCH requests. A retry with
    the same key within 24 hours returns the first result (with
    `Idempotent-Replayed: true`) instead of acting twice. The same key with a
    different request answers 422 `IDEMPOTENCY_KEY_REUSED`; a retry while the
    first request still runs answers 409 `IDEMPOTENCY_IN_PROGRESS`.


    Once execution is attempted, its response (including errors) is retained. If
    a process stops or result storage fails after the attempt, the durable
    record blocks another execution for the replay window and returns 409
    `IDEMPOTENCY_IN_PROGRESS` or `IDEMPOTENCY_REPLAY_UNAVAILABLE`. Check the
    operation's status before using a new key: an uncertain outcome may already
    have acted. Requests refused before execution is claimed, such as
    authentication or rate-limit refusals, can be retried with the same key.


    ## Webhooks


    Configure webhooks in the SendPilot app to receive real-time events:

    - `lead.tag.updated`

    - `lead.updated`

    - `message.sent`

    - `reply.received`

    - `connection_request.sent`

    - `connection_request.accepted`

    - `campaign.started`

    - `campaign.paused`

    - `campaign.resumed`

    - `campaign.finished`


    ## Error Codes


    Errors return a JSON body. Use the machine-readable `code` when supplied;
    validation messages can be arrays, and some legacy errors omit `code`. A
    typical error is:

    ```json

    {
      "statusCode": 400,
      "error": "Bad Request",
      "code": "SPECIFIC_ERROR_CODE",
      "message": "Human-readable description"
    }

    ```
  version: '1.0'
  contact:
    name: SendPilot Support
    url: https://sendpilot.ai
    email: support@sendpilot.ai
servers:
  - url: https://api.sendpilot.ai
security: []
tags: []
paths:
  /v1/lead-database/filters:
    get:
      tags:
        - External API - Lead Database
      summary: Discover supported lead filters and values
      description: >-
        Lists supported filter schemas or searches/paginates the complete
        bundled value catalog. Does not start a search or spend credits.
      operationId: leadDatabase.filters
      parameters:
        - name: filter
          required: false
          in: query
          description: Filter name. Omit to list supported filters.
          schema:
            type: string
        - name: search
          required: false
          in: query
          description: Case-insensitive filter-name or value search.
          schema:
            type: string
        - name: offset
          required: false
          in: query
          schema:
            minimum: 0
            maximum: 1000000
            default: 0
            type: number
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: number
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadFilterCatalogResponseDto'
        '400':
          description: Unsupported filter or invalid pagination
        '401':
          description: Invalid or missing API key
        '403':
          description: Key lacks leads:read
      security:
        - api-key: []
components:
  schemas:
    LeadFilterCatalogResponseDto:
      type: object
      properties:
        filters:
          type: array
          items:
            type: object
            additionalProperties: true
          description: >-
            Filter names, descriptions, input_schema, value_mode and
            compatibility aliases.
        filter:
          type: string
          nullable: true
        values:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Exact input values and readable labels. Empty for free-form filters.
        total:
          type: number
        offset:
          type: number
        limit:
          type: number
        has_more:
          type: boolean
      required:
        - filters
        - filter
        - values
        - total
        - offset
        - limit
        - has_more
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key for authentication (prefix: sp_live_ or sp_test_)'

````

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