Management Endpoints
The AnySite Management API enables you to interact with your own LinkedIn account programmatically. These endpoints allow you to manage posts, connections, conversations, and access your profile data securely.
Account Security First: We never use user accounts for data collection. Our management endpoints are designed with robust anti-blocking protection to safeguard your LinkedIn account.
Available Management Endpoints
Profile Management
- Get Own Profile (
POST /api/linkedin/management/me) - Access your complete LinkedIn profile information
- Company Mentions (
GET /api/linkedin/management/company/mentions) - Monitor mentions of your company or brand
Content Management
- Create Posts (
POST /api/linkedin/management/post) - Publish new LinkedIn posts
- Create Comments (
POST /api/linkedin/management/post/comment) - Comment on posts or reply to other comments
Networking & Communication
- View Connections (
POST /api/linkedin/management/user/connections) - Access your LinkedIn connection list
- Send Connection Requests (
POST /api/linkedin/management/user/connection) - Send connection invitations to other users
- Manage Conversations (
POST /api/linkedin/management/conversations) - View and manage your LinkedIn messages
Messaging & Chat
- Send Message (
POST /api/linkedin/management/chat/message) - Send direct messages to LinkedIn users
- Get Chat Messages (
POST /api/linkedin/management/chat/messages) - Retrieve message history from a conversation
- Attachment Helper (
POST /api/linkedin/management/chat/attachment/base64) - Convert files to base64 for message attachments
Account Connection Methods
To use the management endpoints, you need to connect your LinkedIn account using one of two secure methods:
Method 1: Username & Password
Connect your LinkedIn account by providing your login credentials directly in the Accounts Dashboard.
Method 2: Cookie Authentication (Recommended)
For enhanced security, use cookie-based authentication:
Prerequisites
Step-by-Step Instructions
-
Install Cookie Editor Extension
- Go to the Chrome Web Store and install the Cookie Editor extension
-
Log in to LinkedIn
- Open LinkedIn.com in your browser and sign in to your LinkedIn account
-
Export Your LinkedIn Cookies
- Click on the Cookie Editor extension icon in your browser
- In the Cookie Editor panel, click the “Export” button
- Select “JSON” format from the export options
-
Add the LinkedIn Account in the Dashboard
- Navigate to the Accounts section
- Click “Add Account” button
- Paste the JSON cookies you exported from LinkedIn into the text field
- Click “Save” to add your account
Important Notes
- Do not click the ‘Logout’ button on LinkedIn after exporting cookies
- Simply close your browser instead
- Your Account ID will appear in the accounts table after successful addition
Verification
- Check that your account appears in the accounts list
- Your account is now ready to use for LinkedIn management operations
Integration Options
MCP Server Integration
Option 1: NPM Package (Recommended)
Use the AnySite MCP server via NPM for AI-powered LinkedIn automation:
{
"mcpServers": {
"anysite": {
"command": "npx",
"args": ["-y", "@anysite/mcp"],
"env": {
"ANYSITE_API_KEY": "your-api-key",
"ANYSITE_ACCOUNT_ID": "your-linkedin-account-id"
}
}
}
}
Option 2: SSE Transport (Claude Desktop/Code)
For Claude Desktop and Claude Code, use the SSE transport method:
# Claude Code
claude mcp add --transport sse anysite "https://mcp.anysite.io/mcp" \
--header "access-token: YOUR_API_KEY" \
--header "account-id: YOUR_ACCOUNT_ID"
# Claude Desktop
# Add the OAuth URL in MCP settings: https://mcp.anysite.io/mcp
# Then provide your API key and Account ID in the configuration dialog
See the MCP Server documentation for detailed setup instructions.
n8n Workflow Automation
Integrate management endpoints into n8n workflows for automated LinkedIn management:
- Install the AnySite LinkedIn Management node
- Configure your API key and account ID
- Create workflows for automated posting, connection management, and engagement
API Usage Examples
curl -X POST "https://api.anysite.io/api/linkedin/management/me" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"account_id": "your_account_id"}'
Create a LinkedIn Post
curl -X POST "https://api.anysite.io/api/linkedin/management/post" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "your_account_id",
"content": "Your post content here",
"visibility": "public"
}'
Manage Connections
curl -X POST "https://api.anysite.io/api/linkedin/management/user/connections" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"account_id": "your_account_id"}'
Get Company Mentions
curl -X GET "https://api.anysite.io/api/linkedin/management/company/mentions" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "your_account_id",
"company": "company_name_or_url"
}'
curl -X POST "https://api.anysite.io/api/linkedin/management/post/comment" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "your_account_id",
"text": "Your comment text here",
"urn": "post_or_comment_urn"
}'
Send Connection Request
curl -X POST "https://api.anysite.io/api/linkedin/management/user/connection" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "your_account_id",
"user": "linkedin_profile_url_or_username"
}'
Get Conversations
curl -X POST "https://api.anysite.io/api/linkedin/management/conversations" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "your_account_id"
}'
Send Direct Message
curl -X POST "https://api.anysite.io/api/linkedin/management/chat/message" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"user": "urn:li:fsd_profile:ACoAAABCDEF",
"text": "Hi! I saw your post about AI and would love to connect.",
"timeout": 300
}'
Parameters:
| Parameter | Type | Required | Description |
|---|
account_id | string (UUID) | ✅ Yes | Your LinkedIn account ID from dashboard |
user | string (URN) | ✅ Yes | Recipient’s profile URN |
text | string | ✅ Yes | Message text content |
company | string (URN) | ❌ Optional | Company URN if sending as company admin |
timeout | integer | ❌ Optional | Request timeout (20-1500 seconds, default: 300) |
Use Cases:
- Automated outreach campaigns
- Follow-up after connection requests
- Personalized prospecting messages
- CRM integration with LinkedIn messaging
Get Chat Message History
curl -X POST "https://api.anysite.io/api/linkedin/management/chat/messages" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"user": "urn:li:fsd_profile:ACoAAABCDEF",
"timeout": 300
}'
Parameters:
| Parameter | Type | Required | Description |
|---|
account_id | string (UUID) | ✅ Yes | Your LinkedIn account ID from dashboard |
user | string (URN) | ✅ Yes | Profile URN of conversation participant |
company | string (URN) | ❌ Optional | Company URN if viewing company chat |
timeout | integer | ❌ Optional | Request timeout (20-1500 seconds, default: 300) |
Response: Returns up to 20 most recent messages from the conversation
Use Cases:
- Monitor incoming messages
- Extract conversation history for CRM
- Analyze communication patterns
- Build chatbot integrations
Convert File to Base64 for Attachment
curl -X POST "https://api.anysite.io/api/linkedin/management/chat/attachment/base64" \
-H "access-token: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"file_url": "https://example.com/presentation.pdf",
"timeout": 300
}'
Parameters:
| Parameter | Type | Required | Description |
|---|
account_id | string (UUID) | ✅ Yes | Your LinkedIn account ID from dashboard |
file_url | string | ✅ Yes | Public URL of file to download and convert |
timeout | integer | ❌ Optional | Request timeout (20-1500 seconds, default: 300) |
Response: Returns base64-encoded file content for use in message attachments
Use Cases:
- Send documents in LinkedIn messages
- Attach presentations and PDFs
- Share images in conversations
- Automate marketing material distribution
Note: Use this endpoint to prepare attachments before sending them with /chat/message
Security & Account Protection
Account Safety Measures
- Never Used for Data Collection: Your connected accounts are exclusively for your management operations
- Anti-Blocking Protection: Advanced algorithms protect your account from LinkedIn’s automation detection
- Secure Authentication: Cookie-based authentication provides enhanced security
- Rate Limiting: Built-in rate limiting prevents excessive API usage that could trigger blocks
Best Practices
- Use cookie authentication when possible for better security
- Monitor your account activity through the dashboard
- Set appropriate rate limits for your use case
- Keep your API keys secure and rotate them regularly
Privacy Guarantees
- Your account credentials are encrypted and stored securely
- We never access your account for our own data collection purposes
- All management operations are performed on your behalf only
- Full transparency in all account activities through audit logs
Use Cases
Content Creation & Management
- Automate LinkedIn posting schedules
- Manage post comments and engagement
- Monitor content performance
Network Growth
- Automate connection requests with personalized messages
- Manage incoming connection requests
- Track networking activities
Lead Generation
- Monitor company mentions for business opportunities
- Engage with prospects through automated messaging
- Track conversation histories
Automated Messaging Workflows
Example: Send personalized message with attachment
1. Get prospect's profile URN using search endpoints
2. Convert your PDF/document to base64 using /chat/attachment/base64
3. Send personalized message with attachment using /chat/message
4. Track responses with /chat/messages
5. Update CRM with conversation status
Example: Multi-touch outreach campaign
Day 1: Send connection request with note
Day 3: If connected, send welcome message
Day 7: Follow up with value proposition + attachment
Day 14: Check /chat/messages for replies and respond
Brand Management
- Monitor brand mentions across LinkedIn
- Respond to comments and messages promptly
- Maintain consistent brand presence
- Automate customer support messaging
Getting Started
- Get Your API Key: Sign up at AnySite Dashboard
- Connect Your Account: Use the cookie method for secure account connection
- Test Integration: Start with simple profile retrieval to verify setup
- Explore Endpoints: Use the interactive API documentation to explore capabilities
- Build Workflows: Create automated workflows using MCP server or n8n nodes
Need help getting started? Check our Quickstart Guide or contact our support team.