---
title: "Select Facebook page"
method: POST
path: "/v1/connect/facebook/select-page"
tags: ["Connect"]
---

# Select Facebook page

`POST /v1/connect/facebook/select-page`

Complete the headless flow by saving the user's selected Facebook page. Pass the userProfile from the OAuth redirect and use X-Connect-Token if connecting via API key.

## Request body

- object
  - `profileId` string, required — Profile ID from your connection flow
  - `pageId` string, required — The Facebook Page ID selected by the user
  - `tempToken` string, required — Temporary Facebook access token from OAuth
  - `userProfile` object, required — Decoded user profile object from the OAuth callback
    - `id` string
    - `name` string
    - `profilePicture` string
  - `redirect_url` string, uri — Optional custom redirect URL to return to after selection

## Response `200`

Facebook Page connected successfully

- object
  - `message` string
  - `redirect_url` string — Redirect URL if custom redirect_url was provided
  - `account` object
    - `accountId` string — ID of the created SocialAccount
    - `platform` 'facebook'
    - `username` string
    - `displayName` string
    - `profilePicture` string
    - `isActive` boolean
    - `selectedPageName` string

## Other responses

- `400` — Missing required fields (profileId, pageId, tempToken, or userProfile)
- `401` — Unauthorized
- `403` — User does not have access to the specified profile
- `404` — Selected page not found in available pages
- `409` — Reconnect identity mismatch. The OAuth was initiated as a `force=true` token-recovery re-auth (`GET /v1/connect/{platform}/ads`), but the grant landed on a different Facebook user or page than the connected account. The existing account is left untouched.
- `500` — Failed to save Facebook connection

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/51932b099b2f/schema)
