Skip to content

Connecting accounts

Your users connect their networks from your app, under your brand. They never share credentials and you never store tokens.

  1. Your server calls GET /v1/connect/{platform} with the profileId and your app’s redirectUrl.
  2. You redirect the user to the returned url. They authorize the network with their account.
  3. Marsial sends them back to your redirectUrl with the outcome in the query.
Terminal window
curl "https://api.marsial.dev/v1/connect/linkedin?profileId=prf_8f2k4d&redirectUrl=https%3A%2F%2Fapp.acme.com%2Fconnected" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
Outcome Parameters
Connected connected=<platform>, accountId=acc_… and, when the network gives one, username
Always profileId: the profile it was connected to
Needs a pick select=<sessionId> and platform. See the next step.
Error error=<code>, platform, error_message and is_user_fixable (true when the user can try again)

Some networks connect something specific inside the user’s account. They come back with select and your app shows the list to pick from:

Network What is picked
Facebook The page
LinkedIn Their personal profile or an organization they manage
Pinterest The default board
Google Business The location
Snapchat The public profile
Slack The channel
WhatsApp The number, when the account has several

Bluesky and Discord do not use plain OAuth, but you need nothing different: Marsial’s connection screen asks the user for what it needs (Bluesky’s app password or the Discord channel) and comes back to your redirectUrl with connected. Slack comes back with select=<sessionId> to pick the channel, like Facebook or LinkedIn; a private channel needs the app invited first (/invite).

Sites (WordPress, Shopify, Wix and Webflow) connect here too, with two differences: Shopify needs shop and self-hosted WordPress connects with POST /v1/connect/wordpress. It is all in Blogs.

Terminal window
curl "https://api.marsial.dev/v1/connect/sessions/cs_5t2y8u/options" \
-H "Authorization: Bearer $MARSIAL_API_KEY"
200 OK
{
"data": {
"platform": "facebook",
"options": [
{ "id": "1042…", "name": "Acme Store", "detail": "@acmestore" },
{ "id": "2210…", "name": "Acme Outlet", "detail": "Clothing store" }
]
}
}
Terminal window
curl -X POST "https://api.marsial.dev/v1/connect/sessions/cs_5t2y8u/select" \
-H "Authorization: Bearer $MARSIAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"optionId": "1042…"
}'

It returns the connected account (201). Sessions expire after one hour.

instagram, facebook, tiktok, youtube, linkedin, x, threads, bluesky, pinterest, reddit, google-business, discord and snapchat. Telegram is coming soon.

Terminal window
curl "https://api.marsial.dev/v1/accounts?profileId=prf_8f2k4d" \
-H "Authorization: Bearer $MARSIAL_API_KEY"

Each account has a status: active, needs_reconnection (the token expired or the user removed permissions) or disconnected. To check right now whether they can post, use GET /v1/accounts/health. If an account needs reconnecting, run the flow again with the same network and profile.

© 2026 Marsial by TWOFACES ·marsial.dev ·Dashboard ·soporte@twofacesco.com