LinkedIn Comments API
The LinkedIn Comments API lets a SaaS product, agency workflow, support tool, or automation list LinkedIn comments, reply to LinkedIn comment threads, create top-level comments, and delete LinkedIn comment entries through one contract.
curl -X GET "{{API_BASE_URL}}/v1/comments/?platform=linkedin&accountId=acc_li_org_321&postId=urn:li:share:7503693751647723520&limit=25" \
-H "x-access-key: your-api-key"curl -X GET "{{API_BASE_URL}}/v1/comments/?platform=linkedin&accountId=acc_li_org_321&postId=urn:li:share:7…
-H "x-access-key: your-api-key"
It acts as the connected member or on behalf of a company Page, so the actor follows the connected identity rather than a manually supplied actor URN.
What the LinkedIn Comments API does
The LinkedIn Comments API covers four tasks: list LinkedIn comments, create a top-level comment, reply to LinkedIn comment threads, and delete LinkedIn comment entries. Reading and moderation work on existing posts on the connected account, not only posts published through the same workflow. That scope matters for support and community teams that need to respond to conversation already live on LinkedIn rather than only to content they just published.
Start by obtaining an API key, because every request carries it in the x-access-key header. Then connect the LinkedIn identity you will act for, confirm whether it is a member account or a company Page, and store its accountId. Each connected identity is its own integration with its own accountId, so a person and a company Page they administer are selected separately. Finally, integrate the list, create, reply, and delete calls into the stack your product already uses, whether that is a developer stack, a no-code workflow, or an AI agent workflow.
List Comments: exact request and response contract
Use the List Comments request shown in the List Comments request example below, with the origin replaced by {{API_BASE_URL}} and the path, query parameters, and header kept exactly as captured. The request identifies the platform as linkedin, selects the connected identity with accountId, targets a post with postId, and caps the page size with limit. The captured response uses status 202 and returns success, a comments array, and nextCursor for cursor pagination.
Each comment object carries id, text, author, timestamp, likeCount, hidden, and replies. The id is the comment URN, author carries id and name, and replies holds nested entries. Treat author.name as nullable: the captured example returns null for name, so do not build display logic that assumes a name is always present. When nextCursor is not null, pagination continues using the cursor mechanism; when it is null, there is no further page in that response.
Nested replies, pagination, and comment URN handling
To list LinkedIn comments, call GET /v1/comments/ with platform=linkedin, the accountId for the connected identity, and postId set to the post URN, for example urn:li:share:7503693751647723520. The limit parameter controls how many comments are returned in one page. To load nested replies under a specific comment, pass that comment URN as the postId instead of the post URN. This is the same field doing double duty: a post URN lists top-level comments on the post, while a comment URN lists the replies nested under that comment.
Keep the two URN shapes distinct in your code. Post identifiers use the urn:li:share: form, while comment identifiers use the composite urn:li:comment:(urn:li:activity:..., ...) form. Store the returned comment id verbatim and reuse it later, because the same comment URN is what you pass back as commentId when you reply to or delete that comment. Validate the shape before sending a request, and treat a malformed URN as a client-side failure rather than retrying blindly.
Reply vs top-level comment: postId and commentId
Creating a comment and replying to a LinkedIn comment share one endpoint, and you switch between the two by choosing which identifier you supply. Supply postId to post a new top-level comment on a post. Supply commentId to reply to an existing comment. The postId-as-comment-URN behavior described for listing nested replies is a listing behavior; for creation, use the postId/commentId switch as described here.
The actor follows the connected identity. Organization connections publish under the Page name; member connections publish under the individual name. The correct actor URN is selected automatically, so your integration should not try to construct or pass an actor URN itself. Before sending, run a simple decision check: confirm the accountId matches the intended person or company Page, confirm whether the intent is top-level or a reply, and confirm the identifier matches that intent.
Delete and moderation limits
To delete LinkedIn comment entries, remove a comment from your own post by its comment URN in one call. This is the moderation path for spam or abuse cleanup on your own content. It is not a general-purpose deletion tool for comments on other people's posts, so check ownership of the post before attempting deletion and surface a clear failure to the user when the comment is not on your own post.
Hide and unhide are not available. LinkedIn does not expose a hide/unhide action through its API, so do not design a moderation queue around hiding a comment and later unhiding it. The supported moderation actions are listing, creating, replying, and deleting. If a workflow needs a reversible moderation state, that state has to be tracked in your own product layer rather than delegated to a hide/unhide call.
Account connection, scopes, and the reconnect requirement
Comment read and write sit behind LinkedIn's Community Management social-feed scopes: w_organization_social_feed, w_member_social_feed, and r_organization_social_feed. Connections created earlier lack those permissions in their tokens, so they need to reconnect once to grant them. Posting and analytics keep working in the meantime, which means a reconnect failure should block comment features without taking down the rest of the connected workflow.
Build a preflight check into onboarding: after connecting an account, attempt a List Comments call and treat a scope-related failure as a reconnect prompt rather than a generic error. Keep the accountId-per-identity rule in the same check, because reconnecting the wrong identity will grant scopes to the wrong accountId and leave the intended person or company Page still unable to comment.
| Field | Location | Type / example | Requiredness | Notes |
|---|---|---|---|---|
| platform | Query parameter | string, "linkedin" | Required in captured example | Selects LinkedIn as the platform. |
| accountId | Query parameter | string, "acc_li_org_321" | Required in captured example | Selects the connected member or company Page identity; each identity has its own accountId. |
| postId | Query parameter | string, "urn:li:share:7503693751647723520" | Required in captured example | Post URN for top-level comments; a comment URN here loads nested replies under that comment. |
| limit | Query parameter | number, 25 | Present in captured example | Caps the number of comments returned in one page. |
| x-access-key | Header | string, "your-api-key" | Required | API key header on the request. |
Captured literal contract for List Comments; origin modularized as {{API_BASE_URL}}.
| Field | Type / example | Notes |
|---|---|---|
| success | boolean, true | Indicates the list call succeeded. |
| comments | array of comment objects | Top-level comments for the requested post, or nested replies when postId held a comment URN. |
| comments[].id | string, "urn:li:comment:(urn:li:activity:7503693773307224065,7506340885752803328)" | The comment URN; reuse as commentId for reply or delete. |
| comments[].text | string, "Where can I read the docs?" | Comment text. |
| comments[].author.id | string, "urn:li:person:ZSAPHe3Z55" | Author identifier URN. |
| comments[].author.name | string or null, null in example | May be null; do not assume a name is always returned. |
| comments[].timestamp | string, "2026-08-05T14:22:10Z" | Comment timestamp. |
| comments[].likeCount | number, 3 | Like count on the comment. |
| comments[].hidden | null in example | Returned as null in the captured example; no hide/unhide action is exposed. |
| comments[].replies | array, [] in example | Nested replies under the comment. |
| nextCursor | string or null, null in example | Cursor for the next page; null means no further page in this response. |
Captured 202 response example; types inferred only from the example values.
| Situation | Expected behavior | Check before retrying |
|---|---|---|
| Account connected before comment support, missing social-feed scopes | Comment read/write fails until the account reconnects once to grant w_organization_social_feed, w_member_social_feed, and r_organization_social_feed; posting and analytics keep working. | Prompt a reconnect for that specific accountId; do not retry the same token. |
| author.name is null | Comment is still returned with author.id present. | Render a fallback for a missing author name instead of failing the list. |
| postId holds a comment URN | Returns nested replies under that comment rather than top-level comments on a post. | Confirm whether the intent was nested replies or top-level listing before changing the identifier. |
| Delete attempted on a comment not on your own post | Deletion is scoped to comments on your own posts. | Verify post ownership before attempting deletion. |
| Hide or unhide requested | Unsupported: LinkedIn does not expose a hide/unhide action through its API. | Use delete for removal, or track moderation state in your own product layer. |
| nextCursor is null | No further page is available for that list response. | Stop paging; do not loop on the same cursor. |
Derived from captured source prose and FAQ; no invented status codes beyond the captured 202 list response.
Frequently asked questions
What type of LinkedIn account is required for comment management?
Both kinds of connected identity can work: an individual member profile, and a company Page that the member administers. Treat each one as a separate integration, because each carries its own accountId. Choosing the right accountId is how you decide whose name the comment appears under.
Can I list comments and nested replies on a LinkedIn post?
Yes. Calling GET /v1/comments/ for a post returns its comments along with who wrote them, when, and how many likes they have. If you want the replies sitting underneath one particular comment, put that comment's URN in postId and the call returns that nested thread instead of the post-level list.
Can I comment as a company Page instead of as myself?
Yes, the choice depends on which identity is connected. Organization connections publish under the Page name, while member connections publish under the individual name. The system works out the correct actor URN from the connected account, so your code does not need to build one.
Why do I need to reconnect my LinkedIn account for comments?
Comment access depends on LinkedIn's Community Management permissions for social feeds: w_organization_social_feed, w_member_social_feed, and r_organization_social_feed. Connections created earlier lack those permissions in their tokens, so a single reconnect is needed to add them. Other features such as posting and analytics are unaffected while you do this.
Can I hide or unhide LinkedIn comments through the Comments API?
No. There is no hide or unhide operation available for LinkedIn comments. The actions you can perform are listing, creating, replying, and deleting.
What is a LinkedIn comment URN?
It is LinkedIn's unique identifier for a single comment, shaped like urn:li:comment:(urn:li:activity:123,456). List responses give it back in the id field. Keep it unchanged and send it as commentId when you want to reply to that comment or remove it.
How much does the LinkedIn Comments API cost?
Every individual Comments API call consumes 1 credit. Reading a list, adding a comment, answering a comment, and removing a comment each count as their own call, so a workflow that does all four uses four credits.
What can I build with the LinkedIn Comments API?
Typical uses include comment handling inside social media tools, dashboards run by marketing agencies, employee advocacy products, and automated workflows. In each case the goal is the same: read incoming comments, answer prospects, and moderate a company Page from a single connected setup.
{
"success": true,
"comments": [
{
"id": "urn:li:comment:(urn:li:activity:7503693773307224065,7506340885752803328)",
"text": "An example comment.",
"author": {
"id": "urn:li:person:ZSAPHe3Z55",
"name": null
},
"timestamp": "2026-08-05T14:22:10Z",
"likeCount": 3,
"hidden": null,
"replies": []
}
],
"nextCursor": null
}