Connections
Connect a user's social accounts to a profile over OAuth, grant extra scopes to an existing connection, or disconnect one. Connect flows are minted server-side and returned as a ready-to-open authorization URL.
Authentication & scopes
Every endpoint needs an API key (Bearer lp_live_…) or a logged-in session. Two scopes apply:
connections:read— list connectable providers.connections:write— mint connect URLs, upgrade scopes, and disconnect.
List connectable providers
GET /v1/connections/providers
Capability listing of every supported platform adapter — its default OAuth scopes and capability flags.
curl https://api.letspost.it/v1/connections/providers \
-H "Authorization: Bearer $LETSPOST_KEY"Response shape
{
"providers": [
{
"platform": "instagram",
"defaultScopes": ["instagram_basic", "instagram_content_publish"],
"capabilities": { "publish": true, "analytics": true, "media": ["image", "video"] }
},
...
]
}Build an OAuth connect URL
POST /v1/connections/oauth-url
Mints a signed-state authorization URL. Redirect the user to authUrl; the provider bounces back to your redirectUrl once they consent.
| Field | Type | Description |
|---|---|---|
platform | string (required) | Platform slug, e.g. instagram, tiktok, linkedin. |
profileId | string (required) | Profile the new connection is attached to. |
redirectUrl | string (required) | Where the provider returns after consent. |
finalRedirectUrl | string | Where LetsPost forwards the user once the token exchange finishes. |
headless | boolean | Return JSON instead of a 302 redirect (server-to-server flows). |
inviteToken | string | Invite token when connecting on behalf of another account. |
curl -X POST https://api.letspost.it/v1/connections/oauth-url \
-H "Authorization: Bearer $LETSPOST_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform": "instagram",
"profileId": "prof_abc",
"redirectUrl": "https://your.app/oauth/return"
}'Response shape
{
"authUrl": "https://www.facebook.com/v19.0/dialog/oauth?...",
"state": "st_9f2c…",
"expiresAt": "2026-04-16T20:45:00.000Z"
}Upgrade scopes
POST /v1/connections/{accountId}/upgrade-scopes
Mints an auth URL for granting additional scopes on an existing connection. Same response shape as the connect URL.
curl -X POST https://api.letspost.it/v1/connections/acc_123/upgrade-scopes \
-H "Authorization: Bearer $LETSPOST_KEY" \
-H "Content-Type: application/json" \
-d '{
"scopes": ["instagram_manage_insights"],
"redirectUrl": "https://your.app/oauth/return"
}'Disconnect an account
DELETE /v1/connections/{accountId}
User-initiated disconnect (soft-delete). The account stops publishing and syncing immediately.
curl -X DELETE https://api.letspost.it/v1/connections/acc_123 \
-H "Authorization: Bearer $LETSPOST_KEY"Something unclear? Email us — we read every message.