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

# Create a Custom Alert

> Track a Sales Navigator search and get its new results on every run

Paste the URL of a LinkedIn Sales Navigator search, the same one you would paste in the app's **Custom** signal:

* A people search (`https://www.linkedin.com/sales/search/people...`) creates a `CUSTOM_LEAD` alert. Each run is a lead search.
* A company search (`https://www.linkedin.com/sales/search/company...`) creates a `CUSTOM_ACCOUNT` alert. Each run is a company list.

Pipecorn saves the search in your Sales Navigator account and runs it right away, then `daily`, `weekly` or `monthly` (default `daily`). After the first run, each run only picks up the results Sales Navigator reports as new since the previous one. `max_results` (1 to 2500, default 2500) caps the first run only.

## Get the new results

There are two ways to receive the results of each run:

* **Webhook.** Pass `webhook_url` and each run posts its results there when it finishes: lead runs post the same payload as [People search](https://docs.pipecorn.com/api-reference/endpoints/extract/leads.md), company runs the same payload as [Create a List](https://docs.pipecorn.com/api-reference/endpoints/lists/create.md). For lead alerts, `webhook_streaming: true` posts the leads one by one as they are found.
* **Polling.** Call [Retrieve an Alert](https://docs.pipecorn.com/api-reference/endpoints/alerts/show.md) with `since` set to the `checked_at` of your previous call. It returns only the runs created since then, each with a `results_url` to fetch its leads or companies. A run whose `status` is not `finished` yet is still running: fetch its `results_url` again later.

Delete the alert with [Delete an Alert](https://docs.pipecorn.com/api-reference/endpoints/alerts/destroy.md).

## Requirements and limits

* Your LinkedIn account must be connected to Pipecorn with Sales Navigator. The search runs on that account.
* A Sales Navigator account holds at most 50 saved searches.
* Each alert counts against your plan's alert limit.
* Lead runs enrich the leads they find and spend credits like [People search](https://docs.pipecorn.com/api-reference/endpoints/extract/leads.md).


## OpenAPI

````yaml POST /alerts
openapi: 3.0.1
info:
  title: Pipecorn Alerts API
  description: Pipecorn Alerts API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /alerts:
    post:
      summary: Create a Custom alert
      description: >-
        Creates a Custom alert from a LinkedIn Sales Navigator people or company
        search URL. Pipecorn saves the search in your Sales Navigator account,
        runs it right away, then at the chosen frequency. Each run only picks up
        the results Sales Navigator reports as new since the previous run. A
        people search URL creates a `CUSTOM_LEAD` alert whose runs are lead
        searches; a company search URL creates a `CUSTOM_ACCOUNT` alert whose
        runs are company lists.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - search_url
              properties:
                name:
                  type: string
                  description: Name of the alert
                  example: VP Sales in France
                search_url:
                  type: string
                  format: uri
                  description: >-
                    Sales Navigator search URL, starting with
                    `https://www.linkedin.com/sales/search/people` (leads) or
                    `https://www.linkedin.com/sales/search/company` (accounts)
                  example: >-
                    https://www.linkedin.com/sales/search/people?query=(filters:List((type:CURRENT_TITLE,values:List((text:VP%20Sales,selectionType:INCLUDED)))))
                frequency:
                  type: string
                  enum:
                    - daily
                    - weekly
                    - monthly
                  default: daily
                  description: How often the alert runs. Case-insensitive
                max_results:
                  type: integer
                  minimum: 1
                  maximum: 2500
                  default: 2500
                  description: >-
                    Maximum number of results the first run extracts. Later runs
                    pick up every new result
                webhook_url:
                  type: string
                  format: uri
                  description: >-
                    URL each run posts its results to when it finishes. Lead
                    runs post the same payload as `POST /leads`; company runs
                    post the same payload as `POST /lists`
                  example: https://hooks.example.com/pipecorn
                webhook_streaming:
                  type: boolean
                  default: false
                  description: >-
                    Lead alerts only. When `true`, leads are posted to
                    `webhook_url` one by one as they are found instead of once
                    the run finishes
            example:
              name: VP Sales in France
              search_url: >-
                https://www.linkedin.com/sales/search/people?query=(filters:List((type:CURRENT_TITLE,values:List((text:VP%20Sales,selectionType:INCLUDED)))))
              frequency: daily
              webhook_url: https://hooks.example.com/pipecorn
      responses:
        '201':
          description: The alert was created and its first run started
          content:
            application/json:
              schema:
                type: object
                required:
                  - alert
                properties:
                  alert:
                    $ref: '#/components/schemas/Alert'
              example:
                alert:
                  uuid: 3f6c2a1e-9b8d-4c1f-a2e3-5d6f7a8b9c0d
                  name: VP Sales in France
                  alert_type: CUSTOM_LEAD
                  frequency: DAILY
                  active: true
                  webhook_url: https://hooks.example.com/pipecorn
                  created_at: '2026-11-03T09:00:00.000Z'
                  latest_search_at: '2026-11-03T09:00:01.000Z'
        '400':
          description: Invalid parameters, or a plan or Sales Navigator limit is reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_name:
                  summary: Missing name
                  value:
                    error: name is required
                invalid_url:
                  summary: Not a Sales Navigator search URL
                  value:
                    error: >-
                      search_url must be a Sales Navigator people or company
                      search URL
                invalid_frequency:
                  summary: Unknown frequency
                  value:
                    error: 'frequency must be one of: daily, weekly, monthly'
                invalid_max_results:
                  summary: max_results out of range
                  value:
                    error: max_results must be an integer between 1 and 2500
                alert_limit:
                  summary: Alert limit reached
                  value:
                    error: >-
                      You have reached the maximum number of alerts in your
                      plan. Reach out to support if you need more alerts.
                saved_search_limit:
                  summary: 50 Sales Navigator saved searches reached
                  value:
                    error: You have reached the maximum number of saved searches
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_key:
                  summary: No API key present
                  value:
                    error: No API key present
                invalid_key:
                  summary: Invalid API key
                  value:
                    error: Invalid API key
        '422':
          description: >-
            Invalid `webhook_url`, LinkedIn not connected, or the alert could
            not be created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_webhook:
                  summary: Invalid webhook_url
                  value:
                    error: Invalid webhook_url format
                linkedin_missing:
                  summary: LinkedIn not connected
                  value:
                    error: >-
                      LinkedIn credentials not found. Please connect your
                      LinkedIn account.
                creation_failed:
                  summary: Sales Navigator refused the saved search
                  value:
                    error: >-
                      Failed to create alert - Sales Navigator did not create
                      the saved search for this alert
        '429':
          description: Rate limit exceeded (your plan's per-minute limit)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Rate limit exceeded. Please wait before retrying.
components:
  schemas:
    Alert:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          example: 3f6c2a1e-9b8d-4c1f-a2e3-5d6f7a8b9c0d
        name:
          type: string
          example: Signal NEW_HIRES - 2025-01-03 17:35:33
        alert_type:
          type: string
          enum:
            - NEW_HIRES
            - JOB_CHANGES
            - JOB_POSTING
            - SOCIAL_LISTENING
            - STACK
            - CUSTOM_LEAD
            - CUSTOM_ACCOUNT
            - COMPANY_SIGNAL
          example: NEW_HIRES
        frequency:
          type: string
          nullable: true
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
          example: DAILY
        active:
          type: boolean
          example: true
        webhook_url:
          type: string
          format: uri
          nullable: true
          description: >-
            URL each run posts its results to. `null` if the alert has no
            webhook
          example: https://hooks.example.com/pipecorn
        created_at:
          type: string
          format: date-time
          example: '2025-01-03T17:35:33.073Z'
        latest_search_at:
          type: string
          format: date-time
          nullable: true
          description: When the alert last produced a search. `null` if it has not run yet
          example: '2025-01-04T17:35:33.073Z'
    Error:
      required:
        - error
      type: object
      properties:
        error:
          description: >-
            Human-readable error message. A few validation errors return a list
            of messages instead of a single string.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        message:
          type: string
          description: >-
            Longer explanation, sent by validators that add context. Such errors
            may also carry extra top-level keys like `valid_values` or
            `example`.
        details:
          type: string
          description: >-
            Parser message, sent with `"Invalid JSON format in request body"`
            when the request body is not valid JSON.
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````

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