> ## 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.

# Unsave Leads

> Remove leads from your saved leads in Sales Navigator

This endpoint acts on the LinkedIn Sales Navigator account connected to your Pipecorn account, so it needs valid LinkedIn credentials. Identify each lead by its LinkedIn member URN (`urn:li:member:<id>`).

When LinkedIn rejects the request, the endpoint answers with LinkedIn's status and an `error` message: `401` for an expired LinkedIn cookie, `429` when LinkedIn rate-limits you, and `502` otherwise (see [Rate Limiting](/essentials/rate-limiting#rate-limit-responses)).


## OpenAPI

````yaml POST /leads/bulk_unsave
openapi: 3.0.1
info:
  title: Pipecorn Leads API
  description: Pipecorn Accounts API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /leads/bulk_unsave:
    post:
      summary: Unsave leads in Sales Navigator
      description: >-
        Removes leads from the saved leads of your connected LinkedIn Sales
        Navigator account.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - members
              properties:
                members:
                  type: array
                  items:
                    type: string
                  description: LinkedIn member URNs of the leads to unsave
                  example:
                    - urn:li:member:123456789
      responses:
        '200':
          description: Leads unsaved on LinkedIn
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Members unsaved successfully
              example:
                message: Members unsaved successfully
        '400':
          description: Missing `members` or invalid body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing:
                  summary: 'Missing required key: members'
                  value:
                    error: 'Missing required key: members'
                invalid_json:
                  summary: Invalid JSON
                  value:
                    error: Invalid JSON
        '401':
          description: Missing or invalid API key, or LinkedIn cookie expired
          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
                linkedin_expired:
                  summary: LinkedIn cookie expired
                  value:
                    error: >-
                      LinkedIn cookie has expired. Please reconnect your
                      LinkedIn account.
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          description: Missing or expired LinkedIn credentials, or plan limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                no_credentials:
                  summary: >-
                    LinkedIn credentials not found. Please connect your LinkedIn
                    account.
                  value:
                    error: >-
                      LinkedIn credentials not found. Please connect your
                      LinkedIn account.
                expired_credentials:
                  summary: >-
                    LinkedIn credentials expired. Update your connection on
                    Pipecorn interface, or set parameter 'live' to false in your
                    request body
                  value:
                    error: >-
                      LinkedIn credentials expired. Update your connection on
                      Pipecorn interface, or set parameter 'live' to false in
                      your request body
                plan_limit:
                  summary: Can't proceed with the request. Plan limit reached.
                  value:
                    error: Can't proceed with the request. Plan limit reached.
        '429':
          description: >-
            Rate limit exceeded: your plan's per-minute limit, or LinkedIn
            rate-limited the request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                plan_rate_limit:
                  summary: Plan rate limit
                  value:
                    error: Rate limit exceeded. Please wait before retrying.
                linkedin_rate_limit:
                  summary: Rate limited by LinkedIn
                  value:
                    error: >-
                      Rate limited by LinkedIn. Please wait a few hours before
                      retrying.
        '502':
          description: >-
            LinkedIn failed to process the request. Other upstream failures
            answer their own status (`403`, `404`, `503`, `504`) with the same
            body shape.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: LinkedIn request failed. Please retry later.
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        A unique value you generate per operation, such as a UUID. Retrying with
        the same key and the same body returns the stored response instead of
        running the request again, so a retry after a timeout never charges
        twice. Successful responses are kept for 24 hours; a failed request is
        not stored and can be retried with the same key.
      schema:
        type: string
        maxLength: 255
        example: 4f1c2e9a-8a7d-4c1b-9f63-2d6e0b5a7c11
  schemas:
    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.
  responses:
    IdempotencyConflict:
      description: >-
        A request with this `Idempotency-Key` is still being processed. Wait for
        the `Retry-After` delay and retry with the same key.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              code:
                type: string
                enum:
                  - idempotency_key_in_use
          example:
            error: A request with this Idempotency-Key is still being processed
            code: idempotency_key_in_use
  headers:
    Retry-After:
      description: >-
        Seconds to wait before retrying. Sent when the plan limit or a request
        still in progress caused the error.
      schema:
        type: integer
        example: 42
  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.