Guides
Headless connect
Let your users connect their Facebook Pages, Instagram accounts, YouTube channels and more from inside your product. They never see Publishing Studio, and the social-network tokens never reach your servers.
The flow
All three API calls need the accounts:connect scope, and all must use the same API key — a connect token works only with the key that started it.
Step by step
Start the connection
Call POST
/connect/{platform}/headlesswith the URL your user should come back to (https://, orhttp://localhostwhile developing). For Mastodon-family networks, pass the user's server asinstance. Pass theecosystemIdthe account belongs to — required on Pro, where every account lives in an ecosystem; on Unlimited you may leave it out to connect many accounts at once.curl -X POST "https://dashboard.lifebliss.app/api/v1/connect/facebook/headless" \ -H "Authorization: Bearer $PS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "redirectUrl": "https://app.example.org/connected" }' # 201 → { "authUrl": "https://www.facebook.com/…", "state": "…", "expiresInSeconds": 900 }Send your user to authUrl
Redirect the user to
authUrlwithin 15 minutes. They sign in to the network and approve access there.Receive the connect token
The user lands back on your
redirectUrlwith aconnect_token— or anerrorif they cancelled or the network refused. The token is valid for 15 minutes.https://app.example.org/connected ?connect_token=… &platform=facebook &step=select_accountShow what they can publish to
One login can manage many pages or channels. GET
/connect/selectlists them, paginated, with an optionalsearch;matchedIdsholds every match across pages so a “select all” is one call. Render the choices in your own UI.curl "https://dashboard.lifebliss.app/api/v1/connect/select?token=$CONNECT_TOKEN&search=evening" \ -H "Authorization: Bearer $PS_API_KEY"{ "platform": "facebook", "total": 14, "matched": 2, "page": 1, "hasMore": false, "accounts": [ { "platformAccountId": "1029…", "displayName": "Evening Sessions", "username": null, "avatarUrl": "…" } ], "matchedIds": ["1029…", "4471…"] }Finish
Send the chosen
platformAccountIds(or oneplatformAccountId) toPOST/connect/select. Put them in an existing group withgroupId, or a new one withnewGroupName. The accounts are now ready to publish to.curl -X POST "https://dashboard.lifebliss.app/api/v1/connect/select" \ -H "Authorization: Bearer $PS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "token": "CONNECT_TOKEN", "platformAccountIds": ["1029…", "4471…"], "newGroupName": "Evening pages" }' # 201 → { "connected": 2, "accounts": [ … ], "group": { … }, "unavailable": [], "warnings": [] }
Rules and errors
| Status | When |
|---|---|
| 400 | Invalid redirect URL or instance, a network that doesn't use OAuth — or, when finishing, a group-limited key without groupId. |
| 402 | No active plan or trial; on Pro, a connection without an ecosystemId or with more than one account (bulk connect is on Unlimited); or X before the plan is paid. |
| 409 | The chosen accounts are no longer offered by the network. |
| 410 | The connect token expired. Start again. |
| 424 | The user's server (Mastodon-family) refused app registration. |