> ## Documentation Index
> Fetch the complete documentation index at: https://lemlist-feat-add-assistant-to-contextual-options.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Retrieves contacts by IDs/emails, or searches by name, email, contact list, or campaign membership.

# Get Many Contacts

export const SnippetObjectReference = ({objectName, objectPath = null}) => {
  const lowerCaseObjectName = objectName.toLowerCase();
  if (lowerCaseObjectName === 'lead' || lowerCaseObjectName === 'leads') {
    return <Note>
        This endpoint uses the <a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object</a>. Make sure to also check the <a href={`/api-reference/objects-definitions/${lowerCaseObjectName === 'lead' ? 'contact' : 'lead'}`}>{lowerCaseObjectName === 'lead' ? 'Contact' : 'Lead'} object</a> to understand the distinction between the two.
      </Note>;
  }
  return <Note>
      This endpoint uses the <a href={`/api-reference/objects-definitions/${objectPath}`}>{objectName} object</a>.
    </Note>;
};

<SnippetObjectReference objectName="Contact" objectPath="contact" />

## Query modes

This endpoint supports two query modes:

| Mode              | Parameters                                             | Response format                                              |
| ----------------- | ------------------------------------------------------ | ------------------------------------------------------------ |
| **By IDs/emails** | `idsOrEmails`                                          | Array of contacts                                            |
| **Search/filter** | `search`, `email`, `listId`, and/or `notInAnyCampaign` | Paginated object with `contacts`, `total`, `limit`, `offset` |

At least one of `idsOrEmails`, `search`, `email`, `listId`, or `notInAnyCampaign` is required.

### Filtering by contact list

Use the `listId` parameter to retrieve contacts belonging to a specific list. Get valid list IDs from `GET /contacts/lists`.

You can combine `listId` with `search` or `email` to further narrow results within a list.

### Filtering contacts not in any campaign

Use `notInAnyCampaign=true` to find contacts that are not part of any campaign (orphan contacts). This can be used alone or combined with other filters like `search`, `email`, or `listId`.


## OpenAPI

````yaml get /contacts
openapi: 3.0.0
info:
  title: lemlist API
  version: 1.0.0
  description: >-
    Welcome to the lemlist Developer Documentation.


    lemlist is very customizable and open. You'll find on this page all the API
    and integration you can do with lemlist.


    # Rate Limit


    lemlist's API rate limits requests in order to prevent abuse and overload of
    our services.  

    Rate limits are applied on all routes and per API key performing the
    request.  

    The rate limits are **20** requests per **2** seconds.  

    The response provides any information you may need about it:


    | Header | Description |

    | --- | --- |

    | Retry-After | The number of seconds in which you can retry |

    | X-RateLimit-Limit | The maximum requests in that time |

    | X-RateLimit-Remaining | The number of remaining requests you can make |

    | X-RateLimit-Reset | The date when the rate limit will reset |


    _Example of values for the rate limit headers_


    ``` json

    {
        "Retry-After": 2,
        "X-RateLimit-Limit": 20,
        "X-RateLimit-Remaining": 7,
        "X-RateLimit-Reset" : "Tue Feb 16 2021 09:02:42 GMT+0100 (Central European Standard Time)"
    }

     ```

    # Definitions


    ## Team


    A team is the entity of lemlist that can handle users and billing.


    ## Credits


    Credits are the coins a team uses to enrich emails, LinkedIn URLs, etc. via
    the enrich route. Each enrichment feature needs a certain amount of credits
    to run.


    ## User


    You use a user account to connect to lemlist and send messages via the
    connected emails or LinkedIn account.


    ## Campaign


    A campaign is the entity to automate outreach. A campaign has multiple
    sequences composed of steps.


    ## Lead


    A lead is a person that you try to contact via a campaign.


    ## Activity


    An activity is the history of all the steps.


    ## Unsubscribe


    An unsubscribe occurs when a person decides they don't want to receive
    emails from you anymore.


    # Authentication


    All API routes use the dedicated subdomain `api.lemlist.com`.


    lemlist uses API keys to allow access to the API. You can get your lemlist
    API key at our [integration
    page](https://app.lemlist.com/settings/integrations).


    You need to add the `Authorization` header using the `Basic` authentication
    type. `login:password` **where the login is always empty and the password is
    the API key**.


    ⚠️ **Don't forget to add the semicolon (**`:`**) before your API key in curl
    command.**


    > To authorize, use this code: 
      

    ``` shell

    curl https://api.lemlist.com/api/team \
      --user ":YourApiKey"

     ```

    **Make sure to replace** **`YourApiKey`** **with your API key.**


    # Give feedback


    If you want to report a bug, ask for data, or share with us a use case,
    please fill this [form](https://lemlist.typeform.com/to/mfVlkyGf). It will
    help us centralize your needs!
servers:
  - url: https://api.lemlist.com/api
security:
  - basicAuth: []
paths:
  /contacts:
    get:
      tags:
        - Contacts
      summary: Get Many Contacts
      description: >-
        Retrieves contacts by IDs/emails, or searches contacts by name, email,
        contact list, or campaign membership.


        When using `idsOrEmails`, returns an array of matching contacts
        directly.


        When using `search`, `email`, `listId`, or `notInAnyCampaign`, returns a
        paginated response with `contacts`, `total`, `limit`, and `offset`
        fields. You can combine filters together to narrow results (e.g.
        `listId` with `search`, or `notInAnyCampaign` with `search`).
      parameters:
        - name: idsOrEmails
          in: query
          required: false
          description: >-
            A comma separated string of either valid contact IDs (MongoDB
            ObjectId) or valid email addresses. At least one of `idsOrEmails`,
            `search`, `email`, `listId`, or `notInAnyCampaign` is required.
          example: ctc_xW8Ou6C03Csv8vatp,riley@example.com
          schema:
            type: string
          style: form
          explode: false
        - name: search
          in: query
          required: false
          description: >-
            Search contacts by name or other text fields. Must be at least 2
            characters. At least one of `idsOrEmails`, `search`, `email`,
            `listId`, or `notInAnyCampaign` is required.
          schema:
            type: string
        - name: email
          in: query
          required: false
          description: >-
            Search contacts by exact email address. At least one of
            `idsOrEmails`, `search`, `email`, `listId`, or `notInAnyCampaign` is
            required.
          schema:
            type: string
            format: email
        - name: listId
          in: query
          required: false
          description: >-
            Filter contacts by contact list ID (`clt_xxx` format). Can be
            combined with `search` or `email`, or used alone to list all
            contacts in a list. Get valid IDs from `GET /contacts/lists`.
          example: clt_abc123def456ghi78
          schema:
            type: string
            pattern: ^clt_[a-zA-Z0-9]+$
        - name: notInAnyCampaign
          in: query
          required: false
          description: >-
            When set to `true`, only returns contacts that are not part of any
            campaign (orphan contacts). Can be used alone or combined with other
            filters such as `search`, `email`, or `listId`.
          schema:
            type: boolean
        - name: limit
          in: query
          required: false
          description: Maximum number of contacts to return (1–100). Defaults to 20.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: offset
          in: query
          required: false
          description: Number of contacts to skip for pagination. Defaults to 0.
          schema:
            type: integer
            minimum: 0
            default: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Contact'
              example:
                - _id: ctc_xW8Ou6C03Csv8vatp
                  teamId: tea_8QvkOiBfPdb2ZRhHi
                  fullName: John Doe
                  email: support@lemlist.com
                  fields:
                    firstName: John
                    jobTitle: Growth Engineer
                    lastName: Doe
                    industry: Technology
                    isActiveInCampaigns: false
                    lastCampaign: NEW TO DELETE
                    lastLeadMarkedAsInterestedDate: '2025-10-28T02:12:31.971Z'
                    leadStatus: Marked as not Interested by api
                  campaigns:
                    - campaignId: cam_bSn8EORHQxbWPjHvu
                      campaignState: running
                      leadState: review
                      leadId: lea_fiDpiGV585wy3Oii2
                  ownerId: usr_ahfFktBBHUIxbVG5P
                  createdAt: '2025-10-28T00:40:37.917Z'
                  createdBy: usr_ahfFktBBHUIxbVG5P
                  unsubscribed: false
                - _id: ctc_a9RxJNa7pmMd85H9b
                  teamId: tea_8QvkOiBfPdb2ZRhHi
                  fullName: Casey
                  email: riley@example.com
                  fields:
                    firstName: Casey
                    isActiveInCampaigns: false
                  campaigns:
                    - campaignId: cam_jwm7THjgGFE3ylR85
                      campaignState: running
                      leadState: done
                      leadId: lea_XKjAytuJhBKZhxhWh
                    - campaignId: cam_eF4DlNERV0CW1TwRd
                      campaignState: running
                      leadState: done
                      leadId: lea_fJcS9D3UtEqZcDcAG
                    - campaignId: cam_UBbMt30jHq0vNJKJr
                      campaignState: running
                      leadState: done
                      leadId: lea_GlaMfjxlUYuwEDL0w
                    - campaignId: cam_pijDVnytN5S7frriD
                      campaignState: running
                      leadState: review
                      leadId: lea_Bs9aMGCcjdzTDvixY
                  ownerId: usr_Emu1g29BMtBixhMSP
                  createdAt: '2024-10-01T09:00:13.831Z'
                  createdBy: usr_Emu1g29BMtBixhMSP
                  unsubscribed: true
        '400':
          description: >-
            Possible errors: Bad team / at least one query parameter is required
            / search query too short / invalid listId format
          content:
            text/plain:
              example: >-
                idsOrEmails, search, email, listId, or notInAnyCampaign
                parameter is required
        '401':
          description: The authentication you supplied is incorrect
          content:
            text/plain:
              example: The authentication you supplied is incorrect
        '405':
          description: Method not allowed
components:
  schemas:
    Contact:
      type: object
      description: >-
        A contact record in your CRM. Not to be confused with a lead which is a
        contact specifically added to a campaign.
      properties:
        _id:
          type: string
          description: Unique contact identifier
        teamId:
          type: string
          description: Team identifier the contact belongs to
        fullName:
          type: string
          description: Contact's calculated full name
        email:
          type: string
          format: email
          description: Contact's primary email address
        fields:
          type: object
          description: Custom fields associated with the contact
          additionalProperties: true
        campaigns:
          type: array
          description: List of campaigns the contact is associated with
          items:
            type: object
            properties:
              campaignId:
                type: string
              campaignState:
                type: string
              leadState:
                type: string
              leadId:
                type: string
        ownerId:
          type: string
          description: ID of the user who owns this contact
        createdAt:
          type: string
          format: date-time
          description: Contact creation timestamp
        createdBy:
          type: string
          description: ID of the user who created the contact
        unsubscribed:
          type: boolean
          description: >-
            Whether the contact is globally unsubscribed. When true, no outreach
            will be sent to this contact.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````