Skip to main content
modiva.ai
Sign In
← All API tutorials

API Tutorial

How to read & reply to LinkedIn comments via API

To reply to LinkedIn comments via API, connect LinkedIn through Modiva, list comments with `comments_list`, then post a response with `comments_reply` — useful for support, moderation and AI auto-replies.

Managing LinkedIn engagement at scale means pulling comments and replying without a human in every loop. Modiva exposes `comments_list` and `comments_reply` so you can build moderation, support or AI-assisted reply workflows on LinkedIn with the same two calls you'd use anywhere.

Step by step

1

Create a Modiva account and MCP key

Sign up free and generate an MCP key (`mk_live_…`) from the dashboard. The same key authenticates both the hosted MCP server (for AI agents) and the REST API (for your backend), so you only manage one credential.

2

Connect your LinkedIn account

From the dashboard, click Connect and choose LinkedIn. Modiva runs the OAuth flow and requests the right scopes for you, then stores the access + refresh tokens in an encrypted vault and keeps them fresh — you never handle LinkedIn's raw API credentials. The connection gets a stable `connectionId` you reference in every call.

3

List comments with comments_list

Call `comments_list` with the connection ID and a post ID to pull recent LinkedIn comments, including author, text and timestamps — paginated and normalised to the same shape across every platform.

4

Respond with comments_reply

Call `comments_reply` with the target `comment_id` and your text. Over MCP, an AI agent can read the thread, draft a contextual reply and post it back to LinkedIn automatically — great for first-line support and community management.

Example request

Call the comments_reply tool through Modiva’s REST API. The same tool is available to AI agents over the MCP server at https://mcp.modiva.ai/v1.

POST /v1/tools/invoke
curl -X POST https://api.modiva.ai/v1/tools/invoke \
  -H "Authorization: Bearer mk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "comments_reply",
    "connectionId": "conn_…",
    "args": { "comment_id": "c_123", "text": "Thanks for the kind words! 🙏" }
  }'

Try it with LinkedIn

Start free

FAQ

Can I auto-reply to LinkedIn comments with AI?

Yes. Expose `comments_list` + `comments_reply` to an MCP client and the agent can read each LinkedIn comment and post a tailored response on its own.

Are comments returned in the same format across platforms?

Yes — Modiva normalises LinkedIn comments to a unified shape, so the same code handles comments on every connected platform.


Keep building with LinkedIn

LinkedIn API integrationLinkedIn MCP serverHow to post to LinkedIn via APIHow to schedule LinkedIn posts via APIHow to pull LinkedIn analytics via APIHow to read & reply to Instagram comments via APIHow to read & reply to TikTok comments via API