PeumeAPI

Social publishing & inbox

Get OAuth connect URL

Initiate an OAuth connection flow. Returns an authUrl to redirect the user to.

$0.002 per callRuns on an account you connect

Call it

curl https://api.peume.com/v1/call/get-oauth-connect-url \
  -H "Authorization: Bearer $PEUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "forceReauth": false,
    "allowNoLocation": false,
    "scopes": "posting,analytics",
    "headless": false,
    "loginMethod": "instagram_login",
    "handoff": false
  }
}'

Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: get-oauth-connect-url.

Parameters

reconnectAccountIdstring

Refresh this existing account: a account id of the same platform on this profile (otherwise 400). The OAuth callback and the selection endpoints (select-page, select-organization, select-board, select-location, Instagram and Snapchat selection) refuse with `reconnect_account_mismatch` a login that would write to a different account of the platform on this profile instead of this one. In headless mode the marker travels in the redirect_url we hand you, so pass that URL back unchanged to the selection endpoint. On X it counts toward the OAuth state limit described under redirect_url.

oauthAppIdstring

Connect through one of your own OAuth apps (see /v1/connect/oauth-apps), so the consent screen shows your app and the platform's limits are your app's. Without it the connect runs on 's app, whatever apps the workspace has saved. - Only platforms listed in `platforms` of GET /v1/connect/oauth-apps accept an app. Any other returns 400, and so do ads connects (`adsConnect=true` in the redirect URL). - Connects that end on a destination picker also return 400, except, Google Business locations, Pinterest boards and Snapchat public profiles (Instagram through Facebook Login,

purposestring

Connect the account for notifications only. Slack and Telegram only: `GET /v1/connect/{platform}` returns 400 for any other platform, and other platforms' own connect endpoints ignore it. The account is free, receives notifications, and cannot publish. To publish with it, connect it again without `purpose`. Refused with 400 when the channel or chat is already connected for publishing: connect a separate one for notifications.

notifications

expectedPlatformUserIdstring

Only connect if the login lands on this platform account. Any other account ends the flow with `error=account_mismatch` (a 409 `account_mismatch` on POST /v1/connect/instagram/select-account) and nothing is written. Compared with every id the platform reports for the authorized account: - Any platform: the `platformUserId` of a account on this platform. - Instagram: either the app-scoped id or the professional account id (`metadata.instagramScopedId`, the `17841...` id that Facebook Login accounts hold as platformUserId). - TikTok: open_ids are app-scoped, so an id from your own TikTo

expectedUsernamestring

Only connect if the authorized account's handle is this one (case-insensitive, a leading @ is ignored). Otherwise the flow ends with `error=account_mismatch` and `error_message` naming the handle that was authorized, and nothing is written. Same coverage and transport as expectedPlatformUserId; when both are sent, both must match. Use this on a first connection, where you hold the handle the user typed but no id yet.

expectedPhoneNumberstring

WhatsApp with `signup=hosted` only; ignored on other flows. The number (E.164) the user must connect. If they pick a different number in Meta's popup, the hosted page ends with a 409 `NUMBER_MISMATCH` naming the number they picked, and nothing is saved. The full international number is compared, country code included. A number that differs only in its country code, or shares only its last digits, is a mismatch. The only spellings treated as the same number are national re-spellings of one line, such as a Brazilian mobile with or without its ninth digit, or a Mexican mobile with or without th

forceReauthboolean

Instagram Login only (the default loginMethod); ignored elsewhere. Makes Instagram show its login page and ask for the credentials of the account to connect, even when another Instagram account is logged in on the device or app. Also hides the Facebook login option on that page. Use it when the person connecting manages several Instagram accounts on one phone: otherwise Instagram logs in, and converts to a professional account, whichever account is active, before any consent screen. Pair it with expectedUsername to also refuse a wrong account at the end.

Example: false

allowNoLocationboolean

Google Business only (`platform=googlebusiness`); any other platform answers 400. Lets a Google account with no Business Profile location finish the connect instead of ending with `error=no_google_locations`. The selection step (`step=select_location`, or the hosted page) then lists no locations. Call `POST /v1/connect/googlebusiness/select-location` without `locationId` or `locations` to connect the account with no location (`needsLocation: true`). Without it, a sign-in that lists no location still ends with `no_google_locations`. The marker travels in the redirect_url we hand you, so pass

Example: false

redirect_urlstring

Your custom redirect URL after the connection completes. It MUST be an absolute http(s) URL or a custom app scheme for mobile deeplinks (e.g. myapp://callback). A relative path is rejected with 400 `INVALID_REDIRECT_URL`. **Exit notice:** when `redirect_url` is an http(s) URL on another site (anything but.com), every redirect of the flow lands first on `<your URL>`, a page that names your site and continues to it with one click. All params below reach your URL unchanged. A custom app scheme (myapp://...) never goes through the notice. In h

scopesstring

Comma-separated permission areas to request instead of the platform's full permission set. **Values:** `posting`, `analytics`, `comments`, `messaging`, `ads`, `ads_read`; on google and microsoft, `email`, `calendar`, `files`, `contacts`, `directory`; on microsoft only, `shared_mailboxes`. `directory` adds people search (Google: `directory.readonly` and `contacts.other.readonly`; Microsoft: `People.Read` and `User.ReadBasic.All`). `shared_mailboxes` (Microsoft only) adds `Mail.ReadWrite.Shared` and `Mail.Send.Shared`, so the account can add shared mailboxes it has access to with `POST /v1/ema

Example: posting,analytics

loginHintstring

google and microsoft only: pre-fills the account picker with this address so the user lands on the right mailbox.

headlessboolean

When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of 's default account selection UI. Use this to build a custom connect experience.

Example: false

loginMethodstring

Instagram only: which of the two Instagram connection methods to use. Ignored for every other platform. - `instagram_login` (default when omitted): the Instagram Login dialog. The user authorizes their Instagram professional account directly, no Facebook Page required. Exception: if omitted and `reconnectAccountId` names an account connected with `facebook_login`, the reconnect keeps that method. - `facebook_login`: the Facebook Login dialog ("Instagram API with Facebook Login"). The user authorizes a Facebook Page with a linked Instagram professional account, and every API call for that acco

instagram_login · facebook_login

Example: instagram_login

onboardingstring

WhatsApp only. Ignored for every other platform. Controls which screen Meta's Embedded Signup popup shows. If omitted, the connection defaults to coexistence (same as `business_app` below), preserving existing behavior for numbers already on the WhatsApp Business app. `api`: standard Embedded Signup, showing Meta's WABA/number picker. Use this to connect a phone number already on Cloud API elsewhere. `business_app`: coexistence, i.e. 'Connect existing WhatsApp Business app' (a number shared between Cloud API and the consumer WhatsApp Business app).

api · business_app

signupstring

WhatsApp only. Rejected with 400 `INVALID_FIELD_VALUE` on any other platform. `hosted`: `authUrl` points at a -hosted page on.com instead of Meta's OAuth dialog, and the response carries `authUrl` only (no `state`). That page opens Meta's Embedded Signup popup itself, so it connects exactly the WhatsApp Business Account and number the user picked in the popup. **When to use it**: your users' Facebook logins manage several WhatsApp accounts. On the default redirect flow Meta only returns an authorization code, so when that login can see more than one number the user lands on Zern

hosted

brandNamestring

Your product name, for the two branded pages. Trimmed; 1 to 60 characters. - With `signup=hosted` (WhatsApp): replaces in the page title ("Connect your WhatsApp number to <brandName>"). - With `welcome=true`: fills the heading ("<brandName> wants to connect to your <platform>"). Without it the screen shows and the mark. Both pages keep a mark: they are co-branded, not white-label. Rejected with 400 `INVALID_FIELD_VALUE` without `signup=hosted` or `welcome=true`. Sealed into the page link at issue time, so editing the URL cannot change it.

primaryColorstring

Hex colour (`#RRGGBB`) for the primary button on the hosted WhatsApp signup page (`signup=hosted`) or the welcome screen (`welcome=true`). Validated server-side; anything else is a 400 `INVALID_FIELD_VALUE`. Rejected without one of the two.

welcomeboolean

Any platform. When `true`, `authUrl` points to a -hosted welcome screen showing your brand next to the platform ("<brandName> wants to connect to your <platform>"). Its button reads Connecting for about a second, then sends the user to the platform's authorization screen with no click. The rest of the flow is unchanged. - `brandName`, `logoUrl`, `primaryColor` and `welcomeTheme` are optional and default to 's own name, mark and look. - The link is valid for 30 minutes; after that the page asks the user to start again. - The brand also carries to the account and channel pickers Ze

welcomeThemestring

Welcome screen only (`welcome=true`). A URL-encoded JSON object that restyles and rewords the screen. All keys are optional. - **Copy**: `heading` (up to 120 characters); `trustLine`, `consentLine` and `statusLine` (up to 200 each, `statusLine` being the line above the button); `buttonLabel` (up to 30, the label of the link the button becomes if the redirect stalls). - **Closing page** (shown when there is no `redirect_url`): `successHeading` and `errorHeading` (up to 120), `successBody` and `errorBody` (up to 200). All copy may contain the placeholders `{brand}` and `{platform}`. - **Colors*

logoUrlstring

Welcome screen only (`welcome=true`): https URL of your logo, shown in a square tile, so use a square image. Without it the tile shows the first letter of `brandName`, or the mark when there is no `brandName` either. Rejected with 400 `INVALID_FIELD_VALUE` when the welcome screen is not shown.

languagestring

Hosted signup page only (`signup=hosted`, WhatsApp): language of the page and its follow-along guide. Explainer videos stay in English. Default `en`. Rejected without `signup=hosted`.

en · es · pt-BR

handoffboolean

Let the user finish on their phone. When `true`, the response also carries `handoff`. Show `handoff.url` as a QR code in your app (any QR library); the user scans it and the welcome screen opens on the phone, already carrying this connect. They log in to the platform there without signing in to anything else. The phone ends on a result screen telling them to go back to their computer. - Learn the outcome by polling `GET /v1/connect/handoffs/{handoffId}` (every 2 to 5 seconds is fine) or from the `account.connected` webhook. - Shows the welcome screen with your branding parameters or s

Example: false

platformRequiredstring

Social media platform to connect. `snapchat` is a closed beta with no public release date: it returns 403 `PLATFORM_BETA_RESTRICTED` until the account is approved.

facebook · instagram · linkedin · twitter · tiktok · youtube · threads · reddit · pinterest · bluesky · googlebusiness · telegram …

Start free · $1 of calls included

Every API your product needs. One key.

7,267 endpoints, one bill, and you only pay for calls that work.