Skip to content
DocsReference

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:readlist connectable providers.
  • connections:writemint 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

JSON
{
  "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.

FieldTypeDescription
platformstring (required)Platform slug, e.g. instagram, tiktok, linkedin.
profileIdstring (required)Profile the new connection is attached to.
redirectUrlstring (required)Where the provider returns after consent.
finalRedirectUrlstringWhere LetsPost forwards the user once the token exchange finishes.
headlessbooleanReturn JSON instead of a 302 redirect (server-to-server flows).
inviteTokenstringInvite 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

JSON
{
  "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"
Was this page helpful?

Something unclear? Email us — we read every message.