EstablishmentsCreate a connection link

Establishments

Create a connection link

Returns a hosted link where the person authorizes a network with Sofia, so no network token reaches your app. Valid 30 minutes; live app only.

POSThttps://api.sofia-post.com/api/v1/establishments/{id}/connection-links
POST/v1/establishments/{id}/connection-links

This request acts on your real account.

curl -X POST 'https://api.sofia-post.com/api/v1/establishments/{id}/connection-links' \
  -H "Authorization: Bearer $SOFIA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"platform":"tiktok","redirectUrl":"https://crm.example.com/sofia/connected"}'

Authorizations

  • Authorizationstringrequired

    Your personal key or OAuth access token, sent as Bearer <token>.

Path parameters

  • idstringrequired

    Identifier of the establishment.

Body

application/json

  • platformstringrequired

    The network to connect

    Allowed values: instagramfacebooktiktoklinkedinx

  • redirectUrlstring

    Where to send the person at the end, if Sofia recognizes this origin; otherwise a Sofia page tells them it is done

Response

201application/json

The hosted connection link and its expiry.

  • platformstringrequired

    The network to connect

  • urlstringrequired

    The Sofia page the person opens to connect the network

  • expiresAtstringrequired

    Until when the link waits for a click (ISO 8601)

401

The token is missing, unknown, expired or revoked.

402

subscription_required.

403

live_mode_required for a test application, or the accounts:write scope is missing.

404

Establishment outside the Workspace of the token.

409

account_already_connected: the network is already connected.

422

platform_not_offered: the network is not offered.

4XXapplication/json

Any other error, in the error envelope.