Accounts & connections · Connect

Select the Page whose Instagram account to connect

Selects the Page whose Instagram account to connect.

POSThttps://api.pozy.ai/v1/connect/instagram/select-account
Needs a connect tokenselectInstagramAccount

Guides: Headless selection, Instagram

Request

Call it from your server with your API key and pass the short-lived token from the connect flow in the X-Connect-Token header. See Headless connect.

Request body

application/json, required

  • profileIdstringrequired
  • pageIdstring
  • pageIdsarray of string

    At least 1 item. Up to 25 items.

  • tempTokenstring
  • connectFlowstring

    Matches ^[a-f0-9]{32}$.

  • redirect_urlstring (URL)

Example

curl -X POST "https://api.pozy.ai/v1/connect/instagram/select-account" \
  -H "X-Connect-Token: $CONNECT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "6a0b6573846efc28aaa9a3ff"
}'

Response

200 on success

  • messagestring
  • redirect_urlstring
  • adsAccountIdstring
  • accountobject
    7 child fields
    • accountIdstring
    • platformstring

      One of instagram.

    • usernamestring
    • displayNamestring
    • profilePicturestring
    • isActiveboolean
    • loginMethodstring

      One of facebook_login.

  • accountsarray of object
  • failedarray of object
    • idstring
    • codestring
    • messagestring
200 response
{
  "message": "Hello from Pozy",
  "redirect_url": "https://pozy.ai/media/example-1.jpg",
  "adsAccountId": "689782c4c50e3b783a5acd69",
  "account": {
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "instagram",
    "username": "acme",
    "displayName": "Acme",
    "profilePicture": "string",
    "isActive": true,
    "loginMethod": "facebook_login"
  },
  "accounts": [
    {}
  ],
  "failed": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "code": "string",
      "message": "Hello from Pozy"
    }
  ]
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Connect

GETGet OAuth connect URLPOSTComplete OAuth callbackGETConnect ads for a platformGETGet Shopify OAuth connect URLPOSTConnect a Shopify store with a custom-app Admin tokenGETGet Google Analytics OAuth connect URLGETList Google Analytics properties for a pending connectPOSTConnect the chosen Google Analytics propertyGETGet HubSpot OAuth connect URLGETGet WordPress.com OAuth connect URLGETGet Wix site install URLGETGet Webflow OAuth URLPOSTConnect Webflow with a site API tokenPOSTConnect self-hosted WordPress with an application passwordPATCHSet TikTok brand identityGETList Facebook pagesPOSTSelect Facebook pageGETList Pages with a linked Instagram accountGETList Google Business Profile locationsPOSTSelect Google Business Profile locationGETGet a phone handoffGETGet the saved welcome screenPUTSave the welcome screenGETList your OAuth appsPOSTAdd an OAuth appGETGet an OAuth appPATCHUpdate an OAuth appDELRemove an OAuth appPOSTCheck an OAuth app's keysGETGet pending OAuth dataGETList LinkedIn orgsPOSTSelect LinkedIn orgGETList Pinterest boardsPOSTSelect Pinterest boardGETList Snapchat profilesPOSTSelect Snapchat profilePOSTConnect Bluesky accountPOSTConnect an OpenAI Ads accountPOSTConnect a Whop accountPOSTConnect WhatsApp via credentialsGETList numbers for selectionPOSTComplete number selectionPOSTConnect WhatsApp from Embedded SignupGETGet Embedded Signup SDK configPOSTConnect a Discord channelGETList Slack channels for the channel pickerPOSTConnect a Slack channelGETGenerate Telegram codePOSTConnect Telegram directlyPATCHCheck Telegram statusGETRead a Facebook Page's webhook subscriptionPOSTRe-subscribe a Facebook Page to Pozy's webhooksGETList Facebook pagesPUTUpdate Facebook pageGETList LinkedIn orgsPUTSwitch LinkedIn account typeGETList Pinterest boardsPOSTCreate Pinterest boardPUTSet default Pinterest boardGETGet a YouTube video transcriptGETList YouTube playlistsPOSTCreate YouTube playlistPUTSet default YouTube playlistGETList Google Business Profile locationsPUTUpdate Google Business Profile locationPOSTAssign Google Business Profile location to another profileGETList Reddit subredditsPUTSet default subredditGETGet subreddit rulesPOSTVote on a Reddit post or commentGETList subreddit flairsPOSTSet Reddit post flairGETAdmin-consent link for a Microsoft tenant