Call it
curl https://api.peume.com/v1/call/select-the-page-whose-instagram-account-to-connect \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"scopes": "analytics"
}
}'const res = await fetch("https://api.peume.com/v1/call/select-the-page-whose-instagram-account-to-connect", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"scopes": "analytics"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/select-the-page-whose-instagram-account-to-connect",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"scopes": "analytics"
}
},
)
print(res.json()["output"])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: select-the-page-whose-instagram-account-to-connect.
Parameters
pageIdstringThe Facebook Page ID selected by the user, from GET /v1/connect/instagram/select-account. Send this or pageIds, not both.
pageIdsarraySeveral Page IDs whose linked Instagram accounts to connect from one sign-in, each as its own account. - Two or more distinct IDs: the response lists `accounts` and `failed` instead of `account`. Refused with 400 on a reconnect or an ads connect. - A single distinct ID behaves exactly like pageId.
tempTokenstringLong-lived Facebook user access token from the OAuth callback redirect. Required unless sent in the X-Temp-Token header.
connectFlowstringSet by the -hosted picker, whose user token stays in an httpOnly cookie. Integrators send tempToken instead.
scopesstringThe `scopes` the callback redirect carried, passed back unchanged so the account records the areas it requested. Omit it when the redirect had none.
Example: analytics
redirect_urlstringOptional custom redirect URL to return to after selection
