List Instagram accounts
const url = 'https://app.whatsetter.com/api/v1/instagram/accounts';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.whatsetter.com/api/v1/instagram/accounts \ --header 'Authorization: Bearer <token>'The workspace’s connected Instagram accounts: the id every
Instagram route takes as account_id, the status (connected, or
needs_reconnect when the connection expired or was revoked), what
each account may do (grants: messages, publishing, insights; an
account connected before publishing and insights were offered must
be reconnected from the dashboard for them), the Facebook Page linked to
it and whether that Page allows publishing, its agent (the
campaign_id that answers, whether it is on, whether it answers
every private message or only the people an automation brought), « Le
tri » (when the agent answers every private message: which messages
it answers anyway) and human_pause_hours (how long a person’s reply
pauses the agent on a lead; 0 = never). No token is ever returned.
Requires scope instagram:read.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The connected accounts
object
object
The account_id the Instagram routes take.
needs_reconnect: the connection expired or was revoked; reconnect it from the dashboard.
What the account’s permissions allow. An account connected before publishing and insights were offered has neither publish nor insights until it is reconnected.
object
Read and answer private messages.
Publish and schedule posts from WhatSetter.
Views
The Facebook Page linked to the account (Messenger, « Also on Facebook »), null when none.
object
The Page allows publishing (facebook: true on a post).
object
The agent that answers on this account (GET /campaigns).
The agent answers on this account.
True: it answers every private message; false: only the people an automation brought.
The triage (« What the agent leaves aside » in the dashboard): when the agent answers every private message, which messages it answers anyway. Spam is never answered.
object
The agent is on and answers every private message.
False: a brand or a partnership is left for the owner.
False: a customer with a problem is left for the owner.
False: thanks, compliments and chat get no reply.
How long a person’s reply (dashboard, Instagram app or API) pauses the agent on a lead, in hours. 0 = never.
Example
{ "data": [ { "id": "68f1c2d3e4f5a6b7c8d9e0f1", "username": "acme.studio", "name": "Acme Studio", "status": "connected", "grants": { "messages": true, "publish": true, "insights": true }, "facebook_page": { "name": "Acme Studio", "can_publish": true }, "agent": { "campaign_id": "instagram-acme-studio-x7k2", "enabled": true, "all_dms": true }, "triage": { "enabled": true, "answer_collab": false, "answer_support": false, "answer_personal": false }, "human_pause_hours": 24 } ]}Missing, unknown or revoked API key
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}The key lacks the required scope (insufficient_scope), the plan does not have this part of the API (not_in_plan), or Instagram is not enabled on the workspace (instagram_not_enabled, Instagram routes)
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}