The Complete Unipile API Guide: LinkedIn, Instagram, WhatsApp, Email and AI Agents

Unipile API Guide

One API to Build on LinkedIn, Instagram, WhatsApp, Email and Your AI Agent

Unipile gives your app, or your AI agent, a single integration for messaging, posts and comments, email, and calendar, across LinkedIn, Instagram, WhatsApp, Telegram, Gmail, Outlook, IMAP, Google Calendar and Outlook Calendar. One data model, one set of endpoints, no per-provider SDK to maintain.

Pay as you go, from €49/month, every feature included at every tier
reply.js
// Reply to any linked account, any provider const form = new FormData(); form.append('text', 'On it, thanks!'); await fetch(`https://${DSN}/api/v1/chats/${chatId}/messages`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN }, body: form });
200 OK: message sent
Same endpoints, every provider LinkedIn Instagram WhatsApp Telegram Gmail Outlook IMAP
Built for
Solopreneurs & indie hackers SaaS builders Software editors with a large user base AI agent builders CRM & ATS vendors No-code agencies & automation studios
Product Surface

What You Can Actually Build With Unipile

Unipile is not a messaging widget bolted onto one channel. It is a full API surface across three product categories, each mapped to real provider integrations: linking an account, sending a message, publishing a post, replying to a comment, syncing an inbox, or booking a meeting. Here is the whole picture.

Calendar
Google CalendarGoogle Calendar Outlook CalendarOutlook Calendar
Account Connection3 endpoints
Calendar Features9 endpoints
Covers
List calendarsCreate eventsUpdate / cancelAttendees

LinkedIn Is the Deepest Surface in the API

34 LinkedIn-specific features across 6 categories, on top of the core messaging layer above: outreach, content, profiles, recruiting and search.

Outreach11 features
Send InMails Retrieve InMail balance Create outreach sequences Invite users List pending invitations Delete pending invitations Detect accepted invitations Follow users List incoming invitations Accept / decline invitations Endorse skills
Posts & Comments7 features
List user & company posts Create posts Retrieve posts Send comments List comments Add reactions List reactions
Profiles4 features
Visit & retrieve profiles List contacts & relations Access company profiles View own profile visitors
Job Posting4 features
Create & publish jobs List jobs Retrieve applicants Get applicant resumes
Inboxes4 types
Classic inbox Sales Navigator inbox Recruiter / Recruiter Lite Company Page inbox
Search4 scopes
People (Classic / Recruiter / Sales Nav) Companies (Classic / Sales Nav) Posts search Jobs search

This is only part of what the API exposes. See the full, up-to-date feature list per provider in the developer docs.

View full feature list
Click to Expand

11 Things Developers Actually Build With Unipile

Click any use case to see the real endpoints and a working code snippet. These are patterns pulled directly from how Unipile customers use the API today, not theoretical examples.

A prospect replies to your LinkedIn outreach. Unipile pushes the new message to your webhook in real time, you display it in your own inbox UI, and your rep replies without ever opening LinkedIn.

Endpoints used
GET/api/v1/chats/{chat_id}/messages POST/api/v1/chats/{chat_id}/messages
reply.js
// Reply inside an existing LinkedIn conversation const form = new FormData(); form.append('text', 'Thanks for getting back to me!'); await fetch(`https://${DSN}/api/v1/chats/${chatId}/messages`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN }, body: form // multipart/form-data, no JSON header needed });

A rep finds a good-fit prospect through LinkedIn search and sends a connection request straight from your app, with a short personalized note instead of a blank invite. Unipile returns an invitation_id you can check against the list of pending invitations, or catch the moment it turns into an accepted connection through a webhook.

Endpoints used
POST/api/v1/users/invite GET/api/v1/users/invite/sent
invite.js
// Send a personalized LinkedIn connection invite const invite = await fetch(`https://${DSN}/api/v1/users/invite`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ account_id: accountId, provider_id: prospectProviderId, message: 'Enjoyed your talk on outbound, would love to connect.' }) }).then(r => r.json()); // invite.invitation_id: poll GET /users/invite/sent, or listen for the "new_relation" webhook

Route Instagram DMs from a linked business account straight into your support tool or CRM. Agents read and reply from your own interface, Unipile keeps both sides of the conversation in sync.

Endpoints used
GET/api/v1/chats POST/api/v1/chats/{chat_id}/messages
inbox.js
// List Instagram conversations for a linked account const res = await fetch(`https://${DSN}/api/v1/chats?account_id=${igAccountId}`, { headers: { 'X-API-KEY': ACCESS_TOKEN } }); const { items: conversations } = await res.json(); // conversations now renders directly in your CRM inbox

Retrieve the comments on your Instagram posts, reply publicly from your dashboard, and react, so your social team never has to switch to the Instagram app to manage engagement.

Endpoints used
GET/api/v1/posts/{post_id}/comments POST/api/v1/posts/{post_id}/comments
comments.js
// Fetch comments on a post, then post a reply const comments = await fetch(`https://${DSN}/api/v1/posts/${postId}/comments`, { headers: { 'X-API-KEY': ACCESS_TOKEN } }).then(r => r.json()); await fetch(`https://${DSN}/api/v1/posts/${postId}/comments`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ text: 'Thanks! Sending you a DM.' }) });

Run a LinkedIn people search with the same filters your team already uses, then pull the results straight into your CRM or an outreach sequence, one linked account, no manual export.

Endpoints used
POST/api/v1/linkedin/search
search.js
// Run a LinkedIn people search const results = await fetch(`https://${DSN}/api/v1/linkedin/search`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ account_id: accountId, category: 'people', keywords: 'VP Sales, Paris' }) }).then(r => r.json());

Schedule a post from your own content calendar, pull back the comments it generates, and react to engagement, all without a human logging into LinkedIn to hit publish.

Endpoints used
POST/api/v1/posts GET/api/v1/posts/{id}
publish.js
// Publish a LinkedIn post on behalf of a linked account await fetch(`https://${DSN}/api/v1/posts`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ account_id: accountId, text: 'We just shipped...' }) });

Your call ends, your app triggers a WhatsApp message with a recap and next steps, sent from the same number your team already uses to chat with that contact.

Endpoints used
POST/api/v1/chats
followup.js
// Start a new WhatsApp conversation with a recap const form = new FormData(); form.append('account_id', whatsappAccountId); form.append('text', 'Great talking today, here is the recap...'); form.append('attendees_ids', contactPhoneId); await fetch(`https://${DSN}/api/v1/chats`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN }, body: form });

Link a Telegram account and treat it exactly like any other inbox: list chats, receive new messages instantly via webhook, and reply from your own tool.

Endpoints used
GET/api/v1/chats POST/api/v1/chats/{chat_id}/messages
telegram.js
// List Telegram chats for a linked account const chats = await fetch(`https://${DSN}/api/v1/chats?account_id=${tgAccountId}`, { headers: { 'X-API-KEY': ACCESS_TOKEN } }).then(r => r.json());

Pull a mailbox into your product with threads intact, whichever of the 3 providers your user connects: Gmail, Outlook, or IMAP. One data model, no separate Gmail vs Outlook logic in your app.

Endpoints used
GET/api/v1/mails POST/api/v1/mails
inbox-sync.js
// Retrieve the latest emails for a linked mailbox, threaded const inbox = await fetch(`https://${DSN}/api/v1/mails?account_id=${mailboxId}`, { headers: { 'X-API-KEY': ACCESS_TOKEN } }).then(r => r.json()); // Same shape whether mailboxId points to Gmail, Outlook or IMAP

Once a prospect agrees to a call inside a LinkedIn or email thread, check availability and create the event on their Google or Outlook calendar, without leaving your app.

Endpoints used
GET/api/v1/calendars/{id}/events POST/api/v1/calendars/{id}/events
book.js
// Create a calendar event once a meeting is confirmed await fetch(`https://${DSN}/api/v1/calendars/${calendarId}/events`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ title: 'Intro call', start_time: startISO, end_time: endISO, attendees: [email] }) });

Instead of polling, subscribe once and get a webhook the moment a new message, a new email, or an account status change happens, across every linked provider.

Endpoints used
POST/api/v1/webhooks
webhook.js
// Subscribe to new-message events across all linked accounts await fetch(`https://${DSN}/api/v1/webhooks`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ source: 'messaging', event: 'message_received', request_url: 'https://yourapp.com/webhooks/unipile' }) });

These are just 11 patterns. The same endpoints combine into whatever your app or your AI agent needs to do.

Start Building Your Own Use Case
Quickstart

Your First API Call, in Three Steps

Get your credentials, link a user's account, send your first message. Here is exactly how, with the reasoning behind each call, not just the code.

01

Get Your DSN and Access Token

Sign up at dashboard.unipile.com/signup. Your DSN (Data Source Name) is the host of your dedicated Unipile instance, it goes in every request URL. Your Access Token, generated from the access tokens page, authenticates every call as the X-API-KEY header.

The DSN is unique to your account, not a shared API URL.
Keep the Access Token server-side, never in client code.
.env
# Base host for every request UNIPILE_DSN=your-subdomain.unipile.com:PORT # Sent as the X-API-KEY header on every call UNIPILE_ACCESS_TOKEN=your-access-token
02

Link a User's Account With Hosted Auth

One call to POST /api/v1/hosted/accounts/link returns a link. Redirect the user to it, Unipile runs the provider's own login flow (QR code, OAuth, or credentials depending on the provider), then posts the new account_id to your notify_url, matched to the name you sent.

link-account.js
// Generate a hosted auth link for LinkedIn, Instagram, WhatsApp const res = await fetch(`https://${DSN}/api/v1/hosted/accounts/link`, { method: 'POST', headers: { 'X-API-KEY': ACCESS_TOKEN, 'content-type': 'application/json' }, body: JSON.stringify({ type: 'create', providers: ['LINKEDIN', 'INSTAGRAM', 'WHATSAPP'], api_url: `https://${DSN}`, expiresOn: '2026-12-31T00:00:00.000Z', success_redirect_url: 'https://yourapp.com/connected', notify_url: 'https://yourapp.com/webhooks/unipile', name: internalUserId // your own user id, echoed back in the webhook }) }); const { url } = await res.json(); // redirect the user to `url`
03

Send Your First Message

Once the account is linked, grab a chat_id from GET /api/v1/chats and send. The body is multipart/form-data because attachments (up to 15MB) can ride along in the same call, no separate upload step.

first-call.sh
# Send a text message to an existing conversation curl --request POST \ --url https://{DSN}/api/v1/chats/{chat_id}/messages \ --header 'X-API-KEY: {ACCESS_TOKEN}' \ --header 'accept: application/json' \ --header 'content-type: multipart/form-data' \ --form 'text=Hello world !'
New: MCP Server

Connect Your AI With MCP

Your coding agent does not have to guess how the Unipile API works. Point Claude Desktop, Cursor, or Windsurf at the Unipile MCP server and it gets direct, authenticated access to the API, plus the documentation, so it can write and test integration code against your real linked accounts.

What is MCP?

The Model Context Protocol is an open standard that lets AI applications securely access external data sources and tools. The Unipile MCP server grants your AI development environment direct connectivity to Unipile's messaging, email and calendar API, no manual doc lookups required.

CD
Claude DesktopAdd the server in Settings > Developer
CU
CursorAdd the server in MCP settings
WS
WindsurfAdd the server in MCP config
Direct API access to Unipile functionality from inside your IDE
Documentation search built into the conversation, no tab switching
Code generation for real integrations, tested against your own linked accounts
mcp.json
{ "mcpServers": { "unipile": { "url": "https://developer.unipile.com/mcp?branch=v1.0", "headers": { "X-API-KEY": "your-api-key" } } } }
Responsible Use

Responsible Use & Compliance

Before you build, it helps to understand exactly how Unipile handles data and where the responsibility lines sit. Here is the short version.

GDPR compliant SOC 2 aligned
01 · Data

Data Handling Note

Unipile does not maintain an independent data warehouse of your users' messages, emails, or contacts. Every request retrieves data through the API on behalf of the authenticated, linked account, scoped to that session. There is no parallel archive and no bulk export beyond what the linked user already has access to.

02 · Operation

How Unipile Operates

Unipile acts as an independent technical intermediary, not a partner of LinkedIn, Meta, Microsoft, Google, or Telegram. Every action happens on behalf of the authenticated user who linked their account, using that user's own credentials and session. Unipile never shares credentials across customers.

03 · Limits

Platform Limits & Responsible Use

Unipile relays the rate limits and usage constraints set by each underlying platform, it does not remove them. How fast you message, how many accounts you link, and how you use retrieved data remain a customer-side decision, governed by each provider's terms and by GDPR and SOC 2 requirements for storing that data.

Unipile is not affiliated with, endorsed by, or sponsored by LinkedIn, Meta, Microsoft, Google, or Telegram. All product names, logos, and brands mentioned in this guide are property of their respective owners.

Unipile API Guide - FAQ

The questions developers ask most before their first integration.

Unipile gives you one integration to send and receive messages on LinkedIn, WhatsApp, Instagram and Telegram, publish and manage posts and comments, retrieve profiles, sync Gmail, Outlook or IMAP mailboxes with full threading, and read or create Google Calendar and Outlook Calendar events. It's a single set of endpoints and a single data model across every linked account, not a separate SDK per provider.

Instagram is a first-class provider in Unipile. Beyond direct messages, you can retrieve and reply to comments on posts, react to content, and pull profile and engagement data, the same categories available for LinkedIn, through the Social & Messaging API.

The Unipile MCP server (https://developer.unipile.com/mcp?branch=v1.0) lets AI development tools like Claude Desktop, Cursor, and Windsurf connect directly to the Unipile API using your access token. Your coding agent can then query the documentation and call the API to help you build and test an integration, instead of you copy-pasting docs into a chat window.

Every request needs two things from your Unipile dashboard: your DSN, which is the base host for your requests, and an Access Token, sent as the X-API-KEY header. You generate both from the API Dashboard and the access tokens page.

The fastest path is Hosted Auth: a single call to POST /api/v1/hosted/accounts/link returns a link you redirect the user to. Unipile handles the provider's own login flow (QR code, OAuth, or credentials depending on the provider) and notifies your webhook with the new account_id once the account is linked.

Three: Gmail, Outlook (which also covers Microsoft 365 and Exchange Online), and IMAP as a universal fallback for any other mailbox provider. All three share the same threading model and the same set of endpoints.

No. Chats, messages, and attachments use the same endpoints across LinkedIn, WhatsApp, Instagram, and Telegram. You filter by account_id to target a specific linked account and provider, the request shape doesn't change.

Unipile operates as an independent technical intermediary and does not maintain a parallel data warehouse, every request retrieves data on behalf of the authenticated linked account. Unipile is GDPR compliant and SOC 2 aligned; how you store and use the data you retrieve remains your responsibility as the data controller.

Pricing is pay-as-you-go, starting at €49/month for up to 10 linked accounts, then priced per account beyond that. Every feature described in this guide, messaging, posts, email, calendar, MCP, is included at every tier, there is no feature gating. See the full breakdown on the pricing page.

Still have questions? Our team is here to help.

Talk to an expert

Start Building With Unipile

Link your first account in minutes, and ship your first message, post, email sync, or calendar booking today.

Pay as you go, from €49/month. Every feature included at every tier.

en_USEN