Table of Contents
- 1. Community Management API Access
- 2. The Posts API and Versioned Endpoints
- 3. OAuth Token Storage and Refresh
- 4. Managed Hosting for the Agent Runtime
- 5. A LinkedIn Pages MCP Server
- 6. The Agent That Writes and Decides
- 7. LinkedIn’s Developer AI Policy
- 8. Scheduling and Human Approval
- At a glance
- How to choose
- Frequently asked questions
- Conclusion
A LinkedIn Page AI agent is an automated system that publishes and monitors content on a LinkedIn company page through LinkedIn’s official Community Management API. The agent drafts posts, submits them with an organization URN as author, reads comments and reactions, and retrieves follower and page statistics under OAuth credentials held by a page admin.
Most writing about AI agents and LinkedIn is about outreach: connection requests, cold DMs, autonomous SDRs. That path runs into a wall, because LinkedIn’s own help pages state that third-party software and browser extensions that automate activity are not permitted, and the restricted use cases for the Marketing APIs rule out identifying sales or marketing prospects. Company page management is different. It is an approved use case with documented endpoints. The eight components below are what an agent actually needs to post to a page the sanctioned way.
1. Community Management API Access

Nothing else in the stack matters until this is approved. The Community Management API is a gated product in LinkedIn’s developer catalog, not a self-serve key. The listing describes building a brand presence by sharing content and tracking posts through the Posts API and the Social Actions or Comments API, and monitoring brand @mentions through the Social Actions Notifications API.
The qualifications are explicit. LinkedIn asks whether you have an established business, and whether you are prepared to share a business email address along with your organisation’s legal name, registered address, website and privacy policy. It also asks whether you have an established use case, whether that use case aligns with the supported solutions and is not restricted, and whether you agree to comply with the LinkedIn Marketing API Terms.
This is the step that surprises people who expected to generate a token in an afternoon. You create a LinkedIn developer application, associate it with the company page you intend to manage, and request the Community Management API product from the Products tab. An older product name, Marketing Developer Platform, no longer serves this purpose; the scopes for organisation administration now come through Community Management.
Plan the access request before writing any agent code. The approved use case you describe shapes which scopes you receive, and an agent built for a use case LinkedIn has not approved cannot be fixed later in software.
2. The Posts API and Versioned Endpoints

The Posts API is the endpoint that publishes. Its documentation states that it facilitates the creation and retrieval of organic and sponsored posts, and that it replaces the older ugcPosts API. The reference includes a content type table: text only, images, videos, documents and articles are supported for organic posts, while carousels are listed as sponsored only.
Two header requirements catch agents out. Every call requires a Linkedin-Version header in YYYYMM format, and the documentation also calls for X-Restli-Protocol-Version: 2.0.0. Posting as a company page uses the w_organization_social permission with the organisation URN as the author, where posting as an individual member uses w_member_social instead.
The versioning is the part worth engineering around. LinkedIn’s marketing documentation carries standing deprecation notices with dated sunsets for specific monthly versions, and recommends migrating to the latest versioned APIs to avoid disruption. An agent that hardcodes a version string will keep working until that version is retired, then fail silently in a way that looks like a content problem rather than an API problem.
Treat the version header as configuration, not a constant, and log the exact version with every publish so a failure is traceable. Rich media adds a step: images and videos upload first, and the returned asset reference goes into the post body.
3. OAuth Token Storage and Refresh

LinkedIn uses three-legged OAuth 2.0, which means a human page admin has to sign in and consent, and the resulting token has to live somewhere the agent can reach without the credential passing through the model. This is the component most hobby setups get wrong by pasting a token into an environment variable and forgetting it.
Auth0’s Token Vault describes itself as integrating apps and AI agents with third-party tools, handling access and refresh tokens automatically. The product page lists more than 30 integrations and framework support for LangChain, LlamaIndex, Cloudflare Agents, the AI SDK by Vercel and Firebase Genkit. The pattern it represents matters more than the specific vendor: a broker holds the credential and the agent asks it to make a call.
Several open-source projects take the same approach from a self-hosted angle. Keeplane describes a boundary where the application never receives the credential and no endpoint reveals it. Open Connector describes keeping credentials encrypted in your own infrastructure with an audit record for every tool call. Grantd and Authsome describe vaulting tokens server-side so they never touch the model.
Whichever you pick, the requirement is the same. Tokens expire, the refresh has to happen unattended, and a page admin leaving the company is an operational event your agent needs to survive.
4. Managed Hosting for the Agent Runtime

A page agent is a long-running process. It watches for comments, refreshes tokens on a schedule, and publishes at times a human did not stay up for. That rules out running it on a laptop, and it means somebody owns a server, an SSH key, a runtime install and the upgrades that follow.
SetupYourClaw covers that layer. Its own breakdown of the manual route lists the steps it removes: buying a virtual machine, creating and storing SSH keys, connecting over SSH, installing Node.js and npm, installing and configuring the agent, connecting an AI provider and pairing a channel. You pick a model, connect a channel and deploy, and the hosting, keys and runtime are handled rather than provisioned by you.
Be clear about what this does and does not solve, because it sits in the middle of this list for a reason. Managed hosting gives you a running, always-on agent with a maintained runtime. It does not grant LinkedIn API access, which only LinkedIn can approve, and it does not replace the MCP layer in the next section. What it removes is the server administration that otherwise sits between an approved API application and an agent that is actually online.
For teams running agents across several channels at once, the same hosting question recurs per channel. Our breakdown of Slack AI agent integration components walks through the equivalent decisions for a different platform.
5. A LinkedIn Pages MCP Server

Between the agent and the REST API sits a tool layer. The Model Context Protocol has become the common way to expose that, because it lets the same tool definitions serve different agent runtimes instead of being rewritten per framework.
linkedin-pages-mcp is a Python, MIT-licensed MCP server for managing LinkedIn company pages through the official Community Management API, and it describes itself as the first MCP server to do so using LinkedIn’s official API. Its README lists 16 tools across six categories: posts (create, list, get, update, delete, including text, images, articles and polls), comments on behalf of the page, reactions, analytics covering follower stats and demographics plus page views and clicks, media upload initialisation, and organisation details.
Its prerequisites restate the earlier components, which is a useful sanity check on your own build: a LinkedIn developer application associated with your page, the Community Management API product enabled, an OAuth access token from a user who administers the page, and your numeric organisation ID taken from the company page URL. The scopes it names are w_organization_social to post and comment, r_organization_social to read engagement, and rw_organization_admin for page management and analytics.
Note the repository is young and lightly starred. Read the code before trusting it with a production page, or treat it as a reference implementation for your own.
6. The Agent That Writes and Decides

The components so far move bytes. Something still has to decide what the page says, judge whether a comment deserves a reply, and notice that a post underperformed. That is the agent runtime, and the practical requirement is MCP client support plus the ability to run unattended.
Claude Code is documented as an agentic tool that reads a codebase, edits files, runs commands and integrates with development tools, available in a terminal, IDE, desktop app and browser. Its relevance here is the connective tissue rather than the coding: it connects to MCP servers, so the LinkedIn tools from the previous section become callable, and it can be driven by a stored prompt on a schedule.
Other runtimes fit the same slot. OpenClaw, Codex and Cursor each act as an MCP client, and the choice between them is mostly about where the agent lives and how it is triggered rather than raw capability. Our comparison of OpenClaw and Claude Code covers that trade-off in detail.
What matters for a page agent is context. An agent given the page’s recent posts, their engagement numbers and a brief will write something defensible. An agent given only a topic will write the generic LinkedIn post everybody recognises on sight, and publishing that automatically is worse than not posting.
7. LinkedIn’s Developer AI Policy

This component is a document, not software, and it is the one most build guides skip entirely. LinkedIn publishes a Developer AI Policy that applies specifically when AI functionality touches content retrieved through the Marketing APIs, including the Community Management APIs.
The policy notes that these APIs expose organic content created by members, such as posts, articles, comments, messages and profile data, as well as content created by pages. It then sets out required design principles for AI functionality that uses LinkedIn data. Accountability asks developers to establish an internal review body providing oversight and guidance on responsible development and deployment. Fairness and inclusiveness requires that AI functionality not facilitate unfair bias or discriminatory practices, intentional or inadvertent, including on legally protected characteristics. Transparency requires that developers clearly describe to end users that they are interacting with AI functionality.
The policy also states that where it conflicts with the Marketing API Program Terms, whichever requirement is more restrictive or more protective of the data applies, and that the requirements do not apply to data clients provide to you independently of the APIs.
Read practically, this means an agent summarising comment sentiment or drafting replies needs a disclosed, reviewable process behind it. Build the audit trail while you build the agent; retrofitting one onto an autonomous publisher is considerably harder.
8. Scheduling and Human Approval

The last component decides when the agent acts and who confirms it. Fully autonomous publishing to a company page is a reputational risk most organisations will not accept, and the fix is an approval step rather than a better prompt.
n8n describes itself as a platform for agents and workflows you can follow, where you open any step and see what it does. Its own example is the shape a page agent wants: when a request comes in, look something up, then ask in Slack whether to proceed. The site states it offers over 500 native integrations plus any API over HTTP and any agent or coding assistant via MCP, lists structured inputs and outputs with human-in-the-loop approvals and rule-based automation, and offers self-hosting on-premises or with Docker alongside a hosted version.
The visibility is as valuable as the gating. When a post goes out wrong, you need the run history that shows what the agent was given and what it produced, not just the published result.
Scheduling belongs here too. A page agent typically runs on a cadence: draft in the morning, hold for approval, publish on confirmation, then pull engagement numbers a day later. We covered the gating pattern itself in more depth in our guide to AI agent approval gates for unattended runs.
At a glance
| # | Component | What it handles | Build or buy |
|---|---|---|---|
| 1 | Community Management API | Gated access to page posting and analytics | Apply to LinkedIn |
| 2 | Posts API | Creating and retrieving organic page posts | Official endpoint |
| 3 | Token vault or broker | Holding and refreshing OAuth tokens | Either |
| 4 | Managed hosting | Always-on server and agent runtime | Buy |
| 5 | LinkedIn Pages MCP server | Exposing page actions as agent tools | Either |
| 6 | Agent runtime | Drafting content and judging replies | Buy |
| 7 | Developer AI Policy | Disclosure, oversight and review duties | Compliance work |
| 8 | Scheduling and approval | Cadence, gating and run history | Either |
How to choose
Sequence this build by what can block you. Apply for Community Management API access first, because approval is outside your control and depends on a use case you have to describe accurately. While that is pending, decide where the agent will run and how tokens will be stored, since those two choices constrain everything downstream. Add the MCP layer and the agent runtime next, and test against a page nobody is watching. Leave full autonomy for last, or never: start with the agent drafting and a human confirming, then widen its remit once the run history gives you evidence it behaves. Teams without server administration capacity should buy the hosting layer rather than learn it.
Frequently asked questions
Can an AI agent send LinkedIn connection requests or DMs?
Not through official channels. LinkedIn’s help pages state that third-party software, bots and browser extensions automating activity are not permitted, and its restricted use cases exclude using Marketing API data to identify sales or marketing prospects. Tools offering this run your account outside the API, which carries account risk. Page content and analytics are the approved territory.
Which OAuth scopes does a page posting agent need?
Three appear consistently in LinkedIn’s documentation and in implementations built on it: w_organization_social to post and comment as the page, r_organization_social to read posts, comments and engagement, and rw_organization_admin to manage the page and read analytics. The token must come from a member who administers the page, granted through three-legged OAuth.
Why do LinkedIn API calls stop working after a few months?
Versioning. Every call carries a Linkedin-Version header in YYYYMM format, and LinkedIn’s documentation publishes dated sunsets for specific monthly versions while recommending migration to the latest. A pinned version keeps working until its sunset date, then fails. Treat the version as configuration you review, and watch the migration guides.
Do I need the Community Management API to post to my own page?
For automated posting through the API, yes. The Community Management API is the product that grants organisation posting and analytics scopes, and it is gated behind an application that asks for your business details, privacy policy and an approved use case. Posting manually in the LinkedIn interface needs none of this, only page admin rights.
Should the agent publish without human review?
Rarely worth it. A page carries brand reputation, published posts are visible immediately, and LinkedIn’s Developer AI Policy expects oversight and disclosure where AI touches its data. A draft-and-confirm pattern costs one approval click and removes most of the downside. Widen autonomy later, using run history as evidence rather than assumption.
Conclusion
A LinkedIn page agent is less about clever prompting than about eight unglamorous parts lining up: approved API access, the right endpoint and version, tokens that refresh unattended, a host that stays up, a tool layer, a runtime, a policy you can defend, and a gate before publishing. The API application and the compliance work are yours to own. The server, keys and runtime underneath do not have to be. If you would rather not provision and maintain that layer, SetupYourClaw deploys a managed, always-on agent instance so your effort goes into the integration and the content instead of the infrastructure.
