Connecting Accounts
How to connect social media accounts using OAuth flows, headless mode, and non-OAuth platforms
Before you can post to a platform, you need to connect a social media account to a profile. Late supports 13 platforms, each with its own connection method.
OAuth Flow (Most Platforms)
Most platforms use OAuth. The basic flow is:
- Call
GET /v1/connect/{platform}with yourprofileId - The API returns an
authUrl - Redirect the user to that URL to authorize
- After authorization, the user is redirected back to your
redirect_url - The account is connected
const { authUrl } = await late.connect.getConnectUrl({
platform: 'twitter',
profileId: 'prof_abc123',
redirectUrl: 'https://myapp.com/callback'
});
// Redirect user to authUrlresult = client.connect.get_connect_url(
platform="twitter",
profile_id="prof_abc123",
redirect_url="https://myapp.com/callback"
)
# Redirect user to result.auth_urlcurl "https://getlate.dev/api/v1/connect/twitter?profileId=prof_abc123&redirect_url=https://myapp.com/callback" \
-H "Authorization: Bearer YOUR_API_KEY"See the Start OAuth endpoint for full parameter details.
Platforms Requiring Secondary Selection
Some platforms require an extra step after OAuth - the user needs to select which page, organization, or board to connect:
| Platform | What to Select | Endpoints |
|---|---|---|
| Page | List Pages → Select Page | |
| Organization or Personal | List Orgs → Select Org | |
| Board | List Boards → Select Board | |
| Google Business | Location | List Locations → Select Location |
| Snapchat | Public Profile | List Profiles → Select Profile |
Standard vs Headless Mode
Standard mode (default): Late hosts the selection UI. The user picks their page/org in Late's hosted interface, then gets redirected to your redirect_url.
Headless mode: You build your own branded selection UI. Pass headless=true when starting the OAuth flow. After OAuth completes, you'll receive a connect_token (valid 15 minutes) that you use to call the list/select endpoints yourself.
// Start headless OAuth
const { authUrl } = await late.connect.getConnectUrl({
platform: 'facebook',
profileId: 'prof_abc123',
headless: true
});
// After OAuth, list pages using the connect token
const { pages } = await late.connect.listFacebookPages({
connectToken: 'YOUR_CONNECT_TOKEN'
});
// Select a page
await late.connect.selectFacebookPage({
connectToken: 'YOUR_CONNECT_TOKEN',
pageId: '123456789'
});# Start headless OAuth
result = client.connect.get_connect_url(
platform="facebook",
profile_id="prof_abc123",
headless=True
)
# After OAuth, list pages using the connect token
pages = client.connect.list_facebook_pages(
connect_token="YOUR_CONNECT_TOKEN"
)
# Select a page
client.connect.select_facebook_page(
connect_token="YOUR_CONNECT_TOKEN",
page_id="123456789"
)# Start headless OAuth
curl "https://getlate.dev/api/v1/connect/facebook?profileId=prof_abc123&headless=true" \
-H "Authorization: Bearer YOUR_API_KEY"
# After OAuth, list pages using the connect token
curl "https://getlate.dev/api/v1/connect/facebook/select-page" \
-H "X-Connect-Token: YOUR_CONNECT_TOKEN"
# Select a page
curl -X POST "https://getlate.dev/api/v1/connect/facebook/select-page" \
-H "X-Connect-Token: YOUR_CONNECT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"pageId": "123456789"}'Non-OAuth Platforms
Bluesky
Bluesky uses app passwords instead of OAuth:
const account = await late.connect.connectBlueskyCredentials({
profileId: 'prof_abc123',
identifier: 'yourhandle.bsky.social',
password: 'your-app-password'
});
console.log('Connected:', account._id);account = client.connect.connect_bluesky_credentials(
profile_id="prof_abc123",
identifier="yourhandle.bsky.social",
password="your-app-password"
)
print(f"Connected: {account['_id']}")curl -X POST "https://getlate.dev/api/v1/connect/bluesky/credentials" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "prof_abc123",
"identifier": "yourhandle.bsky.social",
"password": "your-app-password"
}'See Connect Bluesky for details.
Telegram
Telegram uses an access code flow:
- Call
POST /v1/connect/telegramto initiate the connection and get an access code - The user sends this code to the Late Telegram bot
- Poll
GET /v1/connect/telegramto check the status until connected
Managing Connected Accounts
After connecting, you can:
- List all accounts - see all connected accounts
- Update an account - change settings like default pages or boards
- Check account health - verify tokens and permissions are valid
- Disconnect an account - remove a connection
Updating Selections After Connection
You can change the selected page, organization, or board on an existing connection without re-authenticating: