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

> Creates a company list and starts matching the companies in the background. Poll `GET /lists/{id}` or pass a `webhook_url` to know when it is `FINISHED`.

`name` and `companies` are required, and each company needs at least a `name`. Adding a `domain`, `country_code` or `linkedin_url` improves the match.

By default (`live: true`) the list is also created in LinkedIn Sales Navigator, which needs valid LinkedIn credentials on your account; otherwise the request fails with `422`. Send `live: false` to match the companies against the Pipecorn database only.

The response returns the list right away with `status: "NOT_STARTED"`. Poll [Retrieve a List](https://docs.pipecorn.com/api-reference/endpoints/lists/show.md) or pass a `webhook_url` (http or https) to be notified when the import is finished.


## OpenAPI

````yaml POST /lists
openapi: 3.0.1
info:
  title: Pipecorn List API
  description: Pipecorn List API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /lists:
    post:
      summary: Create a new list
      description: >-
        Creates a company list and starts matching the companies in the
        background. Poll `GET /lists/{id}` or pass a `webhook_url` to know when
        it is `FINISHED`.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewList'
      responses:
        '201':
          description: List created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/List'
              example:
                name: Tech Companies 2024
                id: 8e1dcba0-f0bb-4071-99fc-f18ba6559ccc
                linkedin_id: '7123456789012345678'
                type: companies
                status: NOT_STARTED
                companies_requested_count: 2
                companies_found_count: 0
                companies_not_found: []
                created_at: '2024-01-01T00:00:00Z'
                updated_at: '2024-01-02T00:00:00Z'
                companies: []
        '400':
          description: >-
            Invalid request body: malformed JSON, or missing or invalid `name`
            or `companies`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_json:
                  summary: Invalid JSON
                  value:
                    error: Invalid JSON
                name_missing:
                  summary: name is required
                  value:
                    error: name is required
                companies_missing:
                  summary: companies is required
                  value:
                    error: companies is required
                invalid_company:
                  summary: each company must be an object with a name
                  value:
                    error: each company must be an object with a name
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
        '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
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          description: >-
            Invalid `live` or `webhook_url`, missing or expired LinkedIn
            credentials in live mode, plan limit reached, or the list could not
            be saved (returns the list of validation messages)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_live:
                  summary: Invalid live value. Must be a boolean (true/false)
                  value:
                    error: Invalid live value. Must be a boolean (true/false)
                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.
                invalid_webhook:
                  summary: Invalid webhook_url format
                  value:
                    error: Invalid webhook_url format
        '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.
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
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:
    NewList:
      type: object
      required:
        - name
        - companies
      properties:
        name:
          type: string
          description: Name of the list
          example: Tech Companies 2024
        webhook_url:
          type: string
          format: uri
          description: http(s) URL notified when the list import is complete
          example: https://your-company.com/webhooks/lists
        live:
          type: boolean
          default: true
          description: >-
            `true` (default) also creates or updates a LinkedIn Sales Navigator
            list, which requires valid LinkedIn credentials on your account.
            `false` matches the companies against the Pipecorn database only,
            without touching LinkedIn
        companies:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - name
            properties:
              name:
                description: The name of the company
                type: string
                example: Pipecorn
              country_code:
                description: >-
                  The country code where the company is located. Optional but
                  increases the chance of a match.
                type: string
                example: FR
              domain:
                description: >-
                  The company's domain address. Website URL can work as well.
                  Optional but increases the chance of a match.
                type: string
                example: pipecorn.com
              linkedin_url:
                description: >-
                  The company's LinkedIn profile URL (regular or Sales
                  Navigator). Adding it provides a 100% match.
                type: string
                format: uri
                example: https://www.linkedin.com/company/pipecorn
          example:
            - name: Pipecorn
              country_code: FR
              domain: pipecorn.com
              linkedin_url: https://www.linkedin.com/company/pipecorn
            - name: Google
              country_code: US
              domain: google.com
              linkedin_url: https://www.linkedin.com/company/google
    List:
      type: object
      properties:
        name:
          type: string
          description: Name of the list
          example: Tech Companies 2024
        id:
          type: string
          format: uuid
          description: UUID of the list
          example: 8e1dcba0-f0bb-4071-99fc-f18ba6559ccc
        linkedin_id:
          type: string
          description: >-
            ID of the LinkedIn Sales Navigator list, as a string. Empty when the
            list was created with `live: false`
          example: '7123456789012345678'
        type:
          type: string
          enum:
            - companies
            - leads
          description: What the list contains
          example: companies
        status:
          type: string
          enum:
            - NOT_STARTED
            - ONGOING
            - FINISHED
            - ERROR
            - NOT_ENOUGH_CREDITS
            - FORBIDDEN
            - LIMIT_REACHED
            - UNAUTHORIZED
            - SCHEDULED
          description: Status of the list import
          example: FINISHED
        companies_requested_count:
          type: integer
          description: >-
            Number of companies submitted, or for a list built by `POST
            /accounts/search`, the number of companies the search imports
            (company lists only)
          example: 2
        companies_found_count:
          type: integer
          description: Number of companies matched so far (company lists only)
          example: 1
        companies_not_found:
          type: array
          items:
            type: string
          description: >-
            Names of the submitted companies that could not be matched,
            lowercased and trimmed (not the objects you submitted). Empty until
            the list is `FINISHED` (company lists only)
          example:
            - google
        created_at:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00Z'
        updated_at:
          type: string
          format: date-time
          example: '2024-01-02T00:00:00Z'
        companies:
          type: array
          nullable: true
          description: >-
            Matched companies. `null` for lead lists. Fields the source has no
            value for are `null`
          items:
            type: object
            properties:
              linkedin_url:
                type: string
                example: https://www.linkedin.com/company/pipecorn
              linkedin_id:
                type: string
                example: '12345678'
              company_name:
                type: string
                example: Pipecorn
              company_website:
                type: string
                example: https://pipecorn.com
              domain:
                type: string
                nullable: true
                example: pipecorn.com
              description:
                type: string
                nullable: true
              industry:
                type: string
                nullable: true
                example: Technology, Information and Internet
              location:
                type: string
                nullable: true
                example: Paris, France
              employee_count:
                type: integer
                nullable: true
                example: 12
              employee_range:
                type: string
                nullable: true
                example: 11-50
              company_type:
                type: string
                nullable: true
                example: Privately Held
              year_founded:
                type: integer
                nullable: true
                example: 2024
    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.
  headers:
    RateLimit-Limit:
      description: >-
        Requests allowed per minute on your plan for this group of endpoints.
        Absent for unlimited accounts and on endpoints exempt from the plan
        limit.
      schema:
        type: integer
        example: 100
    RateLimit-Remaining:
      description: Requests left in the current one-minute window.
      schema:
        type: integer
        example: 97
    RateLimit-Reset:
      description: >-
        Seconds until the current window resets and `RateLimit-Remaining` is
        back to `RateLimit-Limit`.
      schema:
        type: integer
        example: 42
    Idempotent-Replayed:
      description: >-
        `true` when this response is a replay of an earlier request sent with
        the same `Idempotency-Key`. Nothing was run or charged again.
      schema:
        type: string
        enum:
          - 'true'
    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
  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
  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.