Start a social account connection with POST /api/v1/integrations/{provider}/connect. Requires an API key with the publish scope or a signed-in workspace owner. A key’s URL is a connect link: whoever holds it can connect an account until it is used or expires.
Request
Choose facebook, instagram, linkedin, pinterest, tiktok, threads, x, youtube, google_business, or bluesky. Send a key’s URL to your customer, who connects without a PubNio account; an owner opens it as the same PubNio user. Confirm with the attempt ID or the account.connected webhook, not the redirect. Bluesky opens an app-password form; POST /api/v1/integrations/bluesky/session connects in one call.
| Parameter | In | Type | Required |
|---|---|---|---|
provider |
path | one of 12 strings | Yes |
workspaceId |
query | UUID | Yes |
profileId |
query | UUID | No |
loginMethod |
query | "instagram_login", "facebook_login", "unified_login" |
No |
capabilities |
query | array of one of 7 strings | No |
redirectUrl |
query | string | No |
expiresIn |
query | string | No |
Response
- HTTP 200: an object with
attemptId,url,expiresAt.
The OpenAPI document has each field’s type.
Examples
const launch = await workspace.accounts.prepareConnection("instagram");launch = workspace.accounts.connect("instagram")curl -X POST "https://pubnio.com/api/v1/integrations/instagram/connect?workspaceId=$WORKSPACE_ID" \
-H "Authorization: Bearer $PUBNIO_API_KEY"pnio integrations connect instagramasync () => {
const response = await codemode.request({
method: "POST",
path: "/api/v1/integrations/instagram/connect",
query: { workspaceId: codemode.workspaceId },
});
return response.data;
};Errors
It declares no problem of its own.
It declares the problems most operations declare.
Idempotency
No key, so a retried POST is not deduplicated. Read the current state before you retry.
Limits
- Field lengths and ranges are in the OpenAPI document.