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

# Search LinkedIn post engagers

> Finds the people who commented on or reacted to a LinkedIn post and returns them as People Database rows.

> [!NOTE]
>
> This endpoint uses the [People object](https://developer.lemlist.com/api-reference/objects-definitions/people-database.md).

> [!WARNING]
>
> This endpoint is paid. Each call debits 50 credits once the post has been read, even when nobody engaged with it and the search returns no one. A `200` always means credits were debited, and no error code debits credits.
>
> Never call it again on the same post to get the next pages or to refine the filters. Pass the `search` id of the response as `fromSearchId` to [Search People database](https://developer.lemlist.com/api-reference/endpoints/people-database/search-people-database.md), which does not bill the post again. It debits no credits, but it counts in your 24-hour People Database search quota, like any search.

> [!NOTE]
>
> The search covers at most 1000 people, commenters first. `isCapped` is `true` when the post had more engagers than that. Use `type` to restrict the search to `comments` or `reactions`.
>
> `filters` take the same format as [Search People database](https://developer.lemlist.com/api-reference/endpoints/people-database/search-people-database.md) (see [Get Database Filters](https://developer.lemlist.com/api-reference/endpoints/people-database/get-database-filters.md) for the valid `filterId` values). They are validated before any credit is debited. `linkedinPostEngagement` and `leadLinkedInSlug` are rejected with a `400`, because the search sets them itself.

> [!NOTE]
>
> If `peopleSearchFailed` is `true`, the credits were debited and `slugs` are valid, but the People Database search failed and `people` is absent. Run [Search People database](https://developer.lemlist.com/api-reference/endpoints/people-database/search-people-database.md) yourself with the returned `filters`.

```bash theme={"theme":"dracula"}
curl -X POST "https://api.lemlist.com/api/database/people/linkedin-post-engagement" \
  -u ":YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.linkedin.com/posts/example-post-activity-1234567890123456789-AbCd",
    "type": "all",
    "filters": [{ "filterId": "country", "in": ["France"], "out": [] }]
  }'
```


## OpenAPI

````yaml post /database/people/linkedin-post-engagement
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: []
tags:
  - name: Enrichment Providers
    description: >-
      The data providers lemlist can call to find an email or a phone.


      Internal providers are paid with lemlist credits and always available.
      External providers run on your own account: connect one by saving its API
      key, and it becomes available to your waterfalls. `GET
      /enrichments/providers` is the catalog of provider ids accepted by the
      waterfall endpoints.
  - name: Enrichment Waterfalls
    description: >-
      Control which data providers lemlist calls when enriching a contact, and
      in which order.


      A waterfall is an ordered list of providers for one enrichment `type`
      (`email` or `phone`). Providers are tried one after the other until one
      returns a result.


      Every team has exactly one default waterfall per type (`isDefault: true`).
      While its `editor` is `lemlist` it follows the lemlist behaviour:
      providers you connected with your own API key are tried first, then
      internal providers in a random order. Once a team member edits its
      provider list, `editor` becomes that user's id and the list is followed as
      is; resetting it hands it back to `lemlist`.


      Custom waterfalls (`isDefault: false`) carry `conditions` on the contact
      being enriched, keyed by contact property; every key present must match.
      When a contact is enriched, lemlist runs a single waterfall: the custom
      waterfall of the requested type whose conditions match the contact, or the
      default waterfall when none does. If several match, the one with the most
      condition keys wins, then the most recently updated. Only that waterfall
      runs; when it finds nothing, the enrichment ends without falling back to
      another one.
paths:
  /database/people/linkedin-post-engagement:
    post:
      tags:
        - People Database
      summary: Search LinkedIn Post Engagers
      description: >-
        Finds the people who commented on or reacted to a LinkedIn post and
        returns them as People Database rows, in a single call.


        The post is read first, then the engagers are searched in the People
        Database. Comments are collected before reactions, the post author is
        excluded and the slugs are deduplicated, for at most 1000 people.
        `filters` are applied to the engagers in the same search, for example to
        keep one country.


        This endpoint is paid: each call debits 50 credits once the post has
        been read, even when the search finds nobody. A `200` always means
        credits were debited, and no error code debits credits.


        The response carries a `search` id. To get the next pages or to refine
        the filters, send it as `fromSearchId` to `POST /database/people`. This
        debits no credits, but it counts in the 24-hour People Database search
        quota, like any search. Do not call this endpoint again on the same post
        for that, it would be billed again.
      operationId: searchLinkedInPostEngagers
      requestBody:
        required: true
        description: >-
          The LinkedIn post to read, and optionally the filters to apply to its
          engagers. Unknown keys are rejected with 400.
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              additionalProperties: false
              properties:
                url:
                  type: string
                  minLength: 1
                  maxLength: 1000
                  description: >-
                    Link of the LinkedIn post. Prefer the post page
                    (`linkedin.com/posts/...`). A short `lnkd.in` link or a
                    `linkedin.com/feed/update/urn:li:activity:...` link also
                    works, but a feed/update link can fail on a post published
                    in the last few hours.
                  example: >-
                    https://www.linkedin.com/posts/example-post-activity-1234567890123456789-AbCd
                type:
                  type: string
                  enum:
                    - all
                    - comments
                    - reactions
                  default: all
                  description: >-
                    Which engagers to collect. `all` collects the comments
                    first, then the reactions.
                  example: all
                filters:
                  type: array
                  items:
                    $ref: '#/components/schemas/PersonaFilter'
                  description: >-
                    People Database leads filters (optional), applied to the
                    engagers in the same search, for example a country. They are
                    validated before any credit is debited.
                    `linkedinPostEngagement` and `leadLinkedInSlug` are rejected
                    with 400, the search sets them itself.
                size:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 100
                  description: >-
                    Number of People Database rows returned in `data.people`,
                    between 1 and 100 (optional).
            example:
              url: >-
                https://www.linkedin.com/posts/example-post-activity-1234567890123456789-AbCd
              type: all
              filters:
                - filterId: country
                  in:
                    - France
                  out: []
      responses:
        '200':
          description: The post was read and 50 credits were debited
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - slugs
                      - totals
                      - isCapped
                      - filters
                    properties:
                      slugs:
                        type: array
                        items:
                          type: string
                        description: >-
                          LinkedIn slugs of the engagers, post author excluded
                          and deduplicated
                      totals:
                        type: object
                        description: Totals announced by LinkedIn for the requested `type`
                        properties:
                          comments:
                            type: integer
                            description: Number of comments on the post
                          reactions:
                            type: integer
                            description: Number of reactions on the post
                      isCapped:
                        type: boolean
                        description: '`true` when the post had more than 1000 engagers'
                      filters:
                        type: array
                        items:
                          $ref: '#/components/schemas/PersonaFilter'
                        description: >-
                          Exact filters of the People Database search:
                          `leadLinkedInSlug` plus the filters you passed. Empty
                          when nobody engaged with the post.
                      search:
                        type: string
                        description: >-
                          Id of the People Database search. Send it as
                          `fromSearchId` to `POST /database/people` to get the
                          next pages or refine the filters. This debits no
                          credits, but it counts in the 24-hour People Database
                          search quota, like any search. Absent when nobody
                          engaged with the post.
                      people:
                        type: object
                        description: >-
                          First page of the People Database search, in the
                          format of `POST /database/people`. Absent when nobody
                          engaged with the post or when the People Database
                          search failed.
                        properties:
                          results:
                            type: array
                            description: Results array
                            items:
                              $ref: '#/components/schemas/PeopleSchema'
                          total:
                            type: integer
                            description: Total number of results
                          page:
                            type: integer
                            description: Current page number
                          size:
                            type: integer
                            description: Size of the results
                      peopleSearchFailed:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          Present and `true` when the credits were debited and
                          `slugs` exist, but the People Database search failed.
                          Run `POST /database/people` yourself with `filters`.
              example:
                data:
                  slugs:
                    - john-doe
                    - jane-smith
                  totals:
                    comments: 1
                    reactions: 1
                  isCapped: false
                  filters:
                    - filterId: leadLinkedInSlug
                      in:
                        - john-doe
                        - jane-smith
                      out: []
                    - filterId: country
                      in:
                        - France
                      out: []
                  search: lsh_ExAmPlEnGgR8d2Kq5
                  people:
                    results:
                      - lead_id: 100000001
                        full_name: John Doe
                        country: France
                        lead_linkedin_url: https://www.linkedin.com/in/john-doe
                        linkedin_short: john-doe
                        headline: Head of Sales at Acme Inc
                        current_exp_company_name: Acme Inc
                    total: 1
                    page: 1
                    size: 100
        '400':
          description: Invalid request. No credit is debited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonaError'
              examples:
                ROUTE_BAD_REQUEST:
                  summary: ROUTE_BAD_REQUEST
                  value:
                    error: Route bad request
                    code: ROUTE_BAD_REQUEST
                LINKEDIN_POST_ENGAGEMENT_INVALID_URL:
                  summary: LINKEDIN_POST_ENGAGEMENT_INVALID_URL
                  value:
                    error: >-
                      This link is not a LinkedIn post; paste the link of a
                      LinkedIn post
                    code: LINKEDIN_POST_ENGAGEMENT_INVALID_URL
                LINKEDIN_POST_ENGAGEMENT_INVALID_FILTERS:
                  summary: LINKEDIN_POST_ENGAGEMENT_INVALID_FILTERS
                  value:
                    error: >-
                      filters must be People Database leads filters available
                      over the API, without linkedinPostEngagement or
                      leadLinkedInSlug: the search sets those itself
                    code: LINKEDIN_POST_ENGAGEMENT_INVALID_FILTERS
        '401':
          description: The authentication you supplied is incorrect
          content:
            text/plain:
              example: The authentication you supplied is incorrect
        '402':
          description: Payment required. No credit is debited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonaError'
              examples:
                LINKEDIN_POST_ENGAGEMENT_PAID_PLAN_REQUIRED:
                  summary: LINKEDIN_POST_ENGAGEMENT_PAID_PLAN_REQUIRED
                  value:
                    error: >-
                      The LinkedIn post engagement search is only available on a
                      paid plan; upgrade to use it
                    code: LINKEDIN_POST_ENGAGEMENT_PAID_PLAN_REQUIRED
                LINKEDIN_POST_ENGAGEMENT_INSUFFICIENT_CREDITS:
                  summary: LINKEDIN_POST_ENGAGEMENT_INSUFFICIENT_CREDITS
                  value:
                    error: Not enough credits. Buy credits to use this feature.
                    code: LINKEDIN_POST_ENGAGEMENT_INSUFFICIENT_CREDITS
                limit-reached:
                  summary: limit-reached
                  value:
                    error: >-
                      Monthly credit limit reached. Please contact your admin to
                      get more
                    code: limit-reached
        '403':
          description: Forbidden. No credit is debited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonaError'
              examples:
                BETA_NOT_ENABLED:
                  summary: BETA_NOT_ENABLED
                  value:
                    error: Beta is not enabled
                    code: BETA_NOT_ENABLED
                linkedin-not-linked:
                  summary: linkedin-not-linked
                  value:
                    error: LinkedIn account not linked
                    code: linkedin-not-linked
                LINKEDIN_POST_ENGAGEMENT_SEARCH_QUOTA_REACHED:
                  summary: LINKEDIN_POST_ENGAGEMENT_SEARCH_QUOTA_REACHED
                  value:
                    error: >-
                      The team has reached its People Database search quota for
                      the last 24 hours; no credits were spent, try again later
                    code: LINKEDIN_POST_ENGAGEMENT_SEARCH_QUOTA_REACHED
        '405':
          description: Method not allowed
        '422':
          description: >-
            The post is private, deleted or cannot be found. No credit is
            debited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonaError'
              example:
                error: >-
                  This LinkedIn post could not be read; it may be private or
                  deleted, check the link
                code: LINKEDIN_POST_ENGAGEMENT_POST_UNAVAILABLE
        '503':
          description: LinkedIn data is unavailable. No credit is debited, try again later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PersonaError'
              example:
                error: >-
                  LinkedIn data is temporarily unavailable; no credits were
                  spent, try again in a minute
                code: LINKEDIN_POST_ENGAGEMENT_PROVIDER_FAILED
components:
  schemas:
    PersonaFilter:
      type: object
      description: >-
        One People Database filter, as stored in a persona or a saved search.
        `in` includes matching values, `out` excludes them. There is no `type`
        property: it is derived from `filterId` server-side.
      required:
        - filterId
      properties:
        filterId:
          type: string
          description: >-
            People Database filter identifier. Use [Get Database
            Filters](/api-reference/endpoints/people-database/get-database-filters)
            to discover the valid ids.
          example: currentTitle
        in:
          type: array
          description: Values to include
          items:
            type: string
          example:
            - Founder
        out:
          type: array
          description: Values to exclude
          items:
            type: string
          example: []
        exactMatch:
          type: boolean
          description: Exact-match toggle, for the text filters that support it
    PeopleSchema:
      type: object
      description: A person record from lemlist's People database.
      additionalProperties: true
      properties:
        lead_id:
          type: integer
          description: Numeric identifier for the person in the People database
        canonical_shorthand_name:
          type: string
        connections_count:
          type: integer
        country:
          type: string
        full_name:
          type: string
        education:
          type: array
          items:
            type: object
            additionalProperties: true
            properties:
              activities_and_societies:
                type: string
              created:
                type: string
              date_from:
                type: string
              date_to:
                type: string
              deleted:
                type: string
              description:
                type: string
              id:
                type: string
              last_updated:
                type: string
              member_id:
                type: string
              school_url:
                type: string
                format: uri
              subtitle:
                type: string
              title:
                type: string
        experience_count:
          type: integer
        experiences:
          type: array
          items:
            type: object
            additionalProperties: true
            properties:
              company_id:
                type: integer
              company_description:
                type: string
              company_employee_count:
                type: integer
              company_followers_count:
                type: integer
              company_founded:
                type: integer
              company_headquarters_city:
                type: string
              company_headquarters_country:
                type: string
              company_industry:
                type: string
              company_linkedin_url:
                type: string
                format: uri
              company_logo_url:
                type: string
                format: uri
              company_name:
                type: string
              company_size:
                type: string
              company_type:
                type: string
              company_url:
                type: string
              company_website_url:
                type: string
                format: uri
              revenue_bucket:
                type: string
              company_domain:
                type: string
              employees_count_growth:
                type: integer
              last_funding_round_at:
                type: string
              business_business_customer:
                type: string
              current_exp_bucket:
                type: string
              created:
                type: string
              date_from:
                type: string
              date_to:
                type: string
              description:
                type: string
              duration:
                type: string
              id:
                type: string
              last_updated:
                type: string
              location:
                type: string
              member_id:
                type: string
              order_in_profile:
                type: integer
              title:
                type: string
              title_normalized:
                type: string
              main_in_profile:
                type: boolean
              technologies:
                type: array
                description: >-
                  Technologies used by the company, on current experiences only
                  (no `date_to`). Capped at the 100 most recently detected;
                  `technologies_total` gives the full count
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    first_seen_at:
                      type: string
                      format: date-time
                      description: When the technology was first detected at the company
                    first_seen_at_anniversary:
                      type: string
                      format: date-time
                      description: Next anniversary of `first_seen_at`
              technologies_total:
                type: integer
                description: >-
                  Number of technologies the company uses, before the cap on
                  `technologies`. Current experiences only
              active_job_post:
                type: object
                description: >-
                  Job postings the company currently publishes, on current
                  experiences only. Counts are integers sent as strings
                properties:
                  total:
                    type: string
                    example: '3'
                  count_by_department:
                    type: object
                    description: >-
                      Count per department (`customer_service`, `engineering`,
                      `finance_legal_admin`, `human_resources`, `marketing`,
                      `operations`, `other`, `sales`)
                    additionalProperties:
                      type: string
                    example:
                      customer_service: '0'
                      engineering: '2'
                      finance_legal_admin: '0'
                      human_resources: '0'
                      marketing: '0'
                      operations: '0'
                      other: '0'
                      sales: '1'
        interests:
          type: array
          items:
            type: object
            properties:
              interest:
                type: string
              interest_id:
                type: string
        languages:
          type: array
          items:
            type: object
            properties:
              language:
                type: string
              proficiency:
                type: string
        last_updated:
          type: string
        lead_industry:
          type: string
        lead_linkedin_url:
          type: string
          format: uri
        lead_logo_url:
          type: string
          format: uri
        linkedin_short:
          type: string
        location:
          type: string
        skills:
          type: array
          items:
            type: object
            properties:
              skill:
                type: string
              skill_id:
                type: string
        summary:
          type: string
        title:
          type: string
        lead_quality_score:
          type: integer
        seniority:
          type: string
        department:
          type: string
        connections_count_bucket:
          type: string
        years_of_exp_bucket:
          type: string
        current_exp_company_name:
          type: string
        geopoint:
          type: array
          items:
            type: number
          minItems: 2
          maxItems: 2
        _score:
          type: number
        _id:
          type: string
    PersonaError:
      type: object
      description: >-
        Error envelope returned by the persona, saved-search and Get Database
        Filters endpoints.
      properties:
        error:
          type: string
          description: Human-readable explanation of the failure
        code:
          type: string
          description: Machine-readable error code, stable across releases
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

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