---
title: "Finalize pending connection"
method: POST
path: "/v1/social-accounts/pending/{sessionToken}/finalize"
tags: ["Pending Connections"]
---

# Finalize pending connection

`POST /v1/social-accounts/pending/{sessionToken}/finalize`

## Request

- Base URL: `https://api.outstand.so`
- URL: `https://api.outstand.so/v1/social-accounts/pending/{sessionToken}/finalize`
- Auth: none declared

Complete the OAuth connection by selecting which pages/accounts to connect. This endpoint creates the social account records for the selected pages.

**Authentication:** Requires your API key, *and* the session token must belong to the same organization as that key. A session token from another organization is rejected as if it had expired. Call this from your backend.

**Flow:**
1. Call GET /pending/:sessionToken to get available pages
2. User selects which pages to connect
3. Call this endpoint with the selected page IDs
4. Social accounts are created and returned

**Note:** The session is automatically deleted after successful finalization.

## Path parameters

- `sessionToken` string, required

## Request body

- object: Request body for finalizing connection
  - `selectedPageIds` string[], required: Array of page IDs to connect

## Response `200`

Connection finalized successfully

- object: Response after successfully finalizing connection
  - `success` boolean, required
  - `connectedAccounts` object[], required
    - `id` string, required: Unique identifier for the connected account
    - `nickname` string, required: Nickname of the connected account
    - `username` string, required: Username of the connected account
    - `network` string, required: Social network type
    - `accountType` string, required: Type of account

## Other responses

- `400`: Invalid request - missing or invalid parameters
- `404`: Session expired or invalid
- `500`: Internal server error

---

[API](https://skmtc.dev/outstand/apis/outstand-social-accounts-api-v1.md) · [All operations](https://skmtc.dev/outstand/apis/outstand-social-accounts-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/outstand/apis/outstand-social-accounts-api-v1/revisions/181fad55d031?raw)
