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

# Find LinkedIn mentions

> Find people and companies to tag in a LinkedIn post, with the exact text to put in it.

> [!NOTE]
>
> Needs `accounts:read`. See [Permissions](/docs/essentials/authentication.md#permissions).

LinkedIn never turns a plain "@Name" into a tag when a post comes through its API. A tag is written `@[Name](urn:li:person:ID)`, `@[Name](urn:li:organization:ID)` or `@[Name](urn:li:organizationBrand:ID)`, with the name exactly as LinkedIn spells it. This search gives you that text in each result's `text`: put it in the post's LinkedIn text as it is (`content[].text`, or `accounts[].settings.title`). The [LinkedIn mentions guide](/docs/guides/linkedin-mentions.md) shows the whole flow.

LinkedIn has no search of all its members, so the search looks in these places, in this order:

| `source` | Who |
| - | - |
| `tagged_before` | People and companies the workspace tagged before: in posts PostSyncer brought in from LinkedIn, or in posts that tag someone found with the @ search in the app. Newest first. |
| `teammate` | The workspace's other LinkedIn profiles (people, not Pages). |
| `follower` | People who follow the account's Page, or the Pages a personal profile's owner runs. Only while `people_search` is `available`. |
| `company` | A company or school, by its LinkedIn link (`linkedin.com/company/acme`) or the short name in it (`acme`, exactly). |

People tagged before and teammates match when their name holds `q`, in any case. Followers are matched by LinkedIn. A company needs the short name exactly as it is in its link: `acme` finds `linkedin.com/company/acme`, `Acme Inc` doesn't. Each person or company shows up once, under the first place it was found. The search only reads: what it finds isn't remembered.

LinkedIn gives a person a different id depending on how the account was connected, so a person is returned only with an id that works from this account: search with the account the post goes out from. On every other network a tag goes out as just the name.

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 400 | | The account isn't a LinkedIn account (`code: INVALID_PROVIDER`). | No: use a LinkedIn account. |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `accounts:read`, or its user is inactive. | No: grant it in Settings → API. |
| 404 | | No account with that id in the workspaces the key can reach. | No. |
| 422 | | `q` is missing, shorter than 2 characters or longer than 200. | No: fix the request. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [LinkedIn mentions guide](/docs/guides/linkedin-mentions.md): from search to a published tag.
* [Create a post](/docs/api-reference/posts/create.md): where `text` goes.


## OpenAPI

````yaml GET /accounts/{id}/linkedin/mentions
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
  - name: Billing
    description: >-
      The owner's plan, invoices and the links that pay for, change or cancel
      it.
  - name: Team
    description: A workspace's teammates and invitations, and their roles.
  - name: Notifications
    description: >-
      Your bell and notification settings, and the workspace's Slack, Discord
      and Telegram channels.
  - name: Blog-to-social
    description: Blog feeds that turn a workspace's new articles into posts.
  - name: Products
    description: Products the workspace's posts can promote.
  - name: Contacts
    description: People who commented on the workspace's posts, and the lists they are on.
  - name: Profile
    description: 'The key''s user: their name and sign-in email.'
  - name: API keys
    description: 'Your API keys: listing and deleting them.'
  - name: Agent sign-up
    description: >-
      An AI agent signs a person up with a code emailed to them, and gets their
      first key. No key needed.
paths:
  /accounts/{id}/linkedin/mentions:
    get:
      tags:
        - Accounts
      summary: Find LinkedIn mentions
      description: >-
        Needs `accounts:read`. People and companies to tag (@mention) in a
        LinkedIn post from this account, each with the exact `text` to put in
        the post's LinkedIn text. LinkedIn never turns a plain "@name" into a
        tag: a tag is `@[Name](urn:li:person:ID)`,
        `@[Name](urn:li:organization:ID)` or
        `@[Name](urn:li:organizationBrand:ID)`, with the name exactly as
        LinkedIn spells it. LinkedIn has no search of all its members, so this
        looks, in this order, at: people and companies the workspace tagged
        before, the workspace's other LinkedIn profiles, people who follow the
        account's Page or the Pages its owner runs (only while `people_search`
        is `available`), and companies or schools by their LinkedIn link or the
        short name in it. A person is returned only with an id that works from
        this account.
      operationId: findLinkedInMentions
      parameters:
        - name: id
          in: path
          required: true
          description: The LinkedIn account the post goes out from.
          schema:
            type: integer
        - name: q
          in: query
          required: true
          description: >-
            A name, or a company's LinkedIn link (`linkedin.com/company/acme`)
            or the short name in it (`acme`). Page followers are searched only
            when `q` looks like a name: it starts with a letter, holds only
            letters, spaces, periods, apostrophes and hyphens with never two
            non-letters in a row, has at most one space, and is at least 3
            characters long (6 when it has a space or a period).
          schema:
            type: string
            minLength: 2
            maxLength: 200
            example: jane
      responses:
        '200':
          description: What was found; `mentions` is `[]` when nothing was.
          content:
            application/json:
              schema:
                type: object
                required:
                  - mentions
                  - people_search
                properties:
                  mentions:
                    type: array
                    description: >-
                      Best first: tagged before, teammates, followers,
                      companies. One entry for each person or company.
                    items:
                      $ref: '#/components/schemas/LinkedInMention'
                  people_search:
                    type: string
                    enum:
                      - available
                      - needs_reconnect
                    description: >-
                      `needs_reconnect`: the account was connected through
                      PostSyncer's older LinkedIn connection and can't search
                      Page followers until it is reconnected in PostSyncer. The
                      other sources still work.
              examples:
                default:
                  summary: Two people
                  value:
                    mentions:
                      - type: person
                        urn: urn:li:person:A1b2C3d4E5
                        name: Jane Doe
                        vanity_name: null
                        headline: null
                        picture: null
                        source: tagged_before
                        text: '@[Jane Doe](urn:li:person:A1b2C3d4E5)'
                      - type: person
                        urn: urn:li:person:F6g7H8i9J0
                        name: Jane Smith
                        vanity_name: null
                        headline: Head barista at Halden Coffee
                        picture: null
                        source: follower
                        text: '@[Jane Smith](urn:li:person:F6g7H8i9J0)'
                    people_search: available
                company:
                  summary: A company by its short name
                  value:
                    mentions:
                      - type: organization
                        urn: urn:li:organization:88412399
                        name: Harbour Roasters
                        vanity_name: harbour-roasters
                        headline: null
                        picture: null
                        source: company
                        text: '@[Harbour Roasters](urn:li:organization:88412399)'
                    people_search: available
                needs_reconnect:
                  summary: 'Older connection: no follower search'
                  value:
                    mentions: []
                    people_search: needs_reconnect
        '400':
          description: The account isn't a LinkedIn account.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    required:
                      - code
                    properties:
                      code:
                        type: string
                        enum:
                          - INVALID_PROVIDER
              examples:
                not_linkedin:
                  summary: Not a LinkedIn account
                  value:
                    message: Account is not a LinkedIn account
                    code: INVALID_PROVIDER
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `accounts:read`, or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks accounts:read
                  value:
                    message: >-
                      This API key does not have the "accounts:read" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '404':
          $ref: '#/components/responses/NotFound404'
        '422':
          description: '`q` is missing, shorter than 2 characters or longer than 200.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                missing:
                  summary: No q
                  value:
                    message: The q field is required.
                    errors:
                      q:
                        - The q field is required.
                too_short:
                  summary: q is 1 character
                  value:
                    message: The q field must be at least 2 characters.
                    errors:
                      q:
                        - The q field must be at least 2 characters.
        '429':
          $ref: '#/components/responses/RateLimited429'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://postsyncer.com/api/v1/accounts/302/linkedin/mentions?q=jane' \
              --header 'Authorization: Bearer <token>'
        - lang: javascript
          label: JavaScript
          source: >-
            const options = {method: 'GET', headers: {Authorization: 'Bearer
            <token>'}};


            fetch('https://postsyncer.com/api/v1/accounts/302/linkedin/mentions?q=jane',
            options)
              .then(res => res.json())
              .then(res => console.log(res))
              .catch(err => console.error(err));
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://postsyncer.com/api/v1/accounts/302/linkedin/mentions?q=jane"


            headers = {"Authorization": "Bearer <token>"}


            response = requests.get(url, headers=headers)


            print(response.text)
        - lang: php
          label: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://postsyncer.com/api/v1/accounts/302/linkedin/mentions?q=jane",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "Authorization: Bearer <token>"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
components:
  schemas:
    LinkedInMention:
      type: object
      description: >-
        A person or company to tag in a LinkedIn post (GET
        /accounts/{id}/linkedin/mentions).
      required:
        - type
        - urn
        - name
        - vanity_name
        - headline
        - picture
        - source
        - text
      properties:
        type:
          type: string
          enum:
            - person
            - organization
            - organizationBrand
          description: >-
            `organization` is a company or school; `organizationBrand` is a
            brand page (found only among tags used before).
        urn:
          type: string
          description: >-
            LinkedIn's ID, for example urn:li:person:A1b2C3d4E5 or
            urn:li:organization:2414183.
        name:
          type: string
          description: The name exactly as LinkedIn spells it.
        vanity_name:
          type: string
          nullable: true
          description: >-
            The short name in their LinkedIn link, when known (companies and
            teammates).
        headline:
          type: string
          nullable: true
          description: Their LinkedIn headline, when known (followers).
        picture:
          type: string
          nullable: true
          description: A picture URL, when known (teammates).
        source:
          type: string
          enum:
            - tagged_before
            - teammate
            - follower
            - company
          description: >-
            Where it was found: tagged in an earlier post of the workspace,
            another LinkedIn profile in the workspace, a follower of the
            account's Page (or of the Pages its owner runs), or a company or
            school found by its link or short name.
        text:
          type: string
          description: >-
            The tag to put in the post as it is, for example `@[Jane
            Doe](urn:li:person:A1b2C3d4E5)`. Special characters in the name are
            already escaped for LinkedIn.
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
        error:
          type: string
          description: >-
            A code a few errors add, such as `rate_limited`. See [Handle
            errors](/essentials/error-handling#answers-with-an-error-code).
    ValidationError:
      type: object
      description: '422: the request didn''t pass validation, and nothing changed.'
      required:
        - message
        - errors
      properties:
        message:
          type: string
          description: >-
            The first error and, when there are more, how many: `(and 1 more
            error)`, `(and 2 more errors)`.
        errors:
          type: object
          description: >-
            The messages, by field. A field inside a list is named with dots:
            `accounts.0.id`.
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    NotFound404:
      description: Nothing with that id in the workspaces the key can reach.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found:
              summary: Not found
              value:
                message: Not found.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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