API reference
Publish, schedule and manage content on Facebook Pages, Instagram and Threads; reply to comments and messages; automate comment-to-DM; read analytics; manage Meta ad campaigns. Authenticate with `Authorization: Bearer gv_live_...`. POST requests accept an `Idempotency-Key` header: the same key + body within 24 h returns the first response (`idempotent-replayed: true`). 5xx, 429 and temporary errors carrying a `Retry-After` header are not stored, so the same key can be retried; any other response (including 409 / 422) is replayed for 24 h — after fixing the cause, retry with a NEW key. Secrets shown once (API keys, webhook signing secrets) are redacted in a replayed response, which then carries `x-getviews-secret-redacted: true` — never store that value; create / rotate again instead. Ad writes never answer 5xx / 429 while something that can spend may remain on Meta: they answer 201, or 409 with `details.reason` `outcome_unknown` (Meta did not confirm a create) or `partial_failure` (a campaign could not be removed — see `details.orphans`). Other errors may still list leftover creatives / videos (they cannot spend) in `details.orphans`. A 201 whose object could not be read back carries `partial: true` with unknown fields null. When Meta rejects a request outright the answer is 422 with `details.reason: rejected_by_meta` and Meta's `code`. Each API key is rate limited (default 600 requests/minute; the dashboard session per workspace): over the limit the answer is 429 `rate_limited` with a `Retry-After` header (seconds) — not stored under the Idempotency-Key. More than 60 failed authentications (401) per minute from one IP also answer 429 for the rest of that minute. Errors always look like `{ error: { code, message, details } }`.
Machine-readable spec: /api/openapi.json (import into Postman or generate an SDK).
Quick start
- Create an API key in the dashboard.
- Allow your redirect origin once:
PUT /api/v1/connect/settingswithredirectOrigins(and optionallybrandName,brandLogoUrl). - Create a profile, then call
GET /api/v1/connect/facebook?profileId=...&redirectUrl=...and send your user toauthUrl. They pick Pages, Instagram accounts and ad accounts on a Getviews-hosted page and come back toredirectUrl?status=connected&accountIds=.... - Building your own picker instead: add
&picker=false, then list withGET /api/v1/connect/facebook/select?state=...and connect withPOST { state, ids }. A select ends the session; sendkeepOpen: trueto select another platform (e.g.meta_ads) with the samestate. - Publish:
POST /api/v1/posts. Subscribe topost.publishedwebhooks for results.
Webhooks are signed: header X-Getviews-Signature: t=<unix>,v1=<hex> where v1 = HMAC-SHA256(secret, `${t}.${rawBody}`). Reject if t is older than 5 minutes.
Webhook events
post.published | Every target of a post was published |
post.partial | Some targets published, some failed |
post.failed | Every target of a post failed |
account.connected | An account was connected |
account.disconnected | An account was disconnected |
account.needs_reauth | An account's token stopped working — the user must reconnect |
account.token_expiring | An ad account's token expires within 7 days |
comment.received | A comment arrived on a Facebook Page or Instagram post |
mention.received | The account was tagged in a post or comment |
message.received | A customer sent a Messenger / Instagram Direct message |
webhook.disabled | An endpoint was turned off after sustained failures |
webhook.test | Test event from POST /v1/webhooks/{webhookId}/test |
Payload schemas are under webhooks in the spec.
Profiles
GET | /api/v1/profilesList profiles |
POST | /api/v1/profilesCreate profile |
GET | /api/v1/profiles/{profileId}Get profile |
PUT | /api/v1/profiles/{profileId}Update profile |
DELETE | /api/v1/profiles/{profileId}Delete profile |
API keys
GET | /api/v1/api-keysList API keys |
POST | /api/v1/api-keysCreate API key (returned once). Pass profileId for a profile-scoped key. |
DELETE | /api/v1/api-keys/{keyId}Revoke API key |
Connect
GET | /api/v1/connect/settingsGet connect-flow settings: allowed redirect origins and the brand shown on the hosted picker |
PUT | /api/v1/connect/settingsUpdate connect-flow settings (workspace-level keys only). Partial: omitted fields are kept, null clears brandName / brandLogoUrl |
GET | /api/v1/connect/{platform}Start connecting a Facebook Page, Instagram account, Threads profile or ad account |
GET | /api/v1/connect/{platform}/selectList Pages / Instagram accounts / ad accounts available for this login |
POST | /api/v1/connect/{platform}/selectConnect the selected Pages / Instagram accounts / ad accounts |
Accounts
GET | /api/v1/accountsList connected accounts |
GET | /api/v1/accounts/{accountId}Get account |
DELETE | /api/v1/accounts/{accountId}Disconnect account (deletes its token) |
POST | /api/v1/accounts/{accountId}/realtimeTurn Page webhooks (real-time comments, mentions, messages) on or off |
Posts
GET | /api/v1/postsList posts |
POST | /api/v1/postsCreate post (publish now, schedule, queue or draft) |
GET | /api/v1/posts/by-ref/{ref}Get a post by externalRef (includes deleted posts, with deletedAt) |
GET | /api/v1/posts/{postId}Get post |
PUT | /api/v1/posts/{postId}Update a draft or scheduled post |
DELETE | /api/v1/posts/{postId}Delete a post (soft delete: content cleared, still found by externalRef) |
POST | /api/v1/posts/{postId}/retryRetry failed platforms of a failed/partial post |
PATCH | /api/v1/posts/{postId}/platformEdit the text of a PUBLISHED post on the platform (Facebook only) |
DELETE | /api/v1/posts/{postId}/platformDelete a published post from Facebook / Threads (Instagram media cannot be deleted via the API). The record is removed only when every copy was deleted; copies that could not be removed are listed in `skipped` |
Queue
GET | /api/v1/queue/slotsGet queue schedule |
PUT | /api/v1/queue/slotsSet queue schedule |
GET | /api/v1/queue/previewUpcoming free slots |
GET | /api/v1/queue/next-slotNext free slot |
Media
POST | /api/v1/media/presignGet an upload URL (PUT the file there, then use publicUrl in posts) |
POST | /api/v1/media/from-urlCopy a file from a public https URL into Getviews storage (use publicUrl in posts) |
Webhooks
GET | /api/v1/webhooksList webhooks |
POST | /api/v1/webhooksCreate webhook (signing secret returned once) |
POST | /api/v1/webhooks/{webhookId}/rotate-secretRotate the signing secret (new secret returned once) |
PUT | /api/v1/webhooks/{webhookId}Update webhook (partial: omitted fields are kept) |
DELETE | /api/v1/webhooks/{webhookId}Delete webhook |
GET | /api/v1/webhooks/{webhookId}/deliveriesDelivery log, newest first |
POST | /api/v1/webhooks/{webhookId}/testSend a test event now |
POST | /api/v1/webhooks/deliveries/{deliveryId}/redeliverRedeliver an event |
Inbox
GET | /api/v1/inbox/postsRecent posts with comment counts |
GET | /api/v1/inbox/posts/{postId}/commentsComments of a post (replies flattened with parentId) |
POST | /api/v1/inbox/posts/{postId}/commentsComment on the post, or reply to commentId |
PATCH | /api/v1/inbox/comments/{commentId}Edit (Facebook), hide/unhide, like/unlike (Facebook) |
DELETE | /api/v1/inbox/comments/{commentId}Delete comment |
POST | /api/v1/inbox/comments/{commentId}/private-replySend a private message (Messenger / Instagram Direct) to the commenter — within 7 days, once per comment |
GET | /api/v1/inbox/mentionsPosts that tag the account (real-time mentions arrive via the mention.received webhook) |
Messages
GET | /api/v1/inbox/conversationsConversations (Messenger + Instagram Direct), latest first |
POST | /api/v1/inbox/conversations/syncImport recent history from Meta (idempotent) |
GET | /api/v1/inbox/conversations/{conversationId}Get conversation |
GET | /api/v1/inbox/conversations/{conversationId}/messagesMessages, newest first |
POST | /api/v1/inbox/conversations/{conversationId}/messagesSend a reply (text or one attachment). 422 outside the 24h window unless tag HUMAN_AGENT |
POST | /api/v1/inbox/conversations/{conversationId}/readMark as read |
Analytics
GET | /api/v1/analytics/accounts/{accountId}Account insights (Facebook Page, Instagram, Threads) for a date range |
GET | /api/v1/analytics/posts/{postId}Post insights per published platform (reels get reel metrics: plays, watch time, …) |
GET | /api/v1/analytics/accounts/{accountId}/postsRecent platform posts of an account with per-post metrics |
GET | /api/v1/analytics/accounts/{accountId}/discoverBusiness Discovery: public profile and recent media of another Instagram professional account |
Ads
GET | /api/v1/ads/accounts/{accountId}Ad account overview (currency, status, amount spent) |
GET | /api/v1/ads/accounts/{accountId}/campaignsList campaigns |
POST | /api/v1/ads/accounts/{accountId}/campaignsCreate campaign (PAUSED by default). Budgets are in the account currency's MINOR unit (VND = đồng, USD = cents) — unlike launch / tree, which use whole units. A create Meta did not confirm is 409 `outcome_unknown` |
GET | /api/v1/ads/accounts/{accountId}/adsetsList ad sets |
GET | /api/v1/ads/accounts/{accountId}/page-postsPublished posts of a connected Facebook Page (to promote as an ad) |
POST | /api/v1/ads/accounts/{accountId}/launchLaunch a full campaign: campaign → ad set → (video upload) → creatives → ads, PAUSED by default |
GET | /api/v1/ads/accounts/{accountId}/adsList ads |
POST | /api/v1/ads/accounts/{accountId}/adsCreate campaign + ad set + creative + ad in one call (PAUSED by default). creativeType=post promotes an existing Page post; creativeType=link builds a new link ad (requires the app to be live). `dailyBudget` is in the MINOR currency unit. If a later step fails and the campaign cannot be removed the answer is 409 `partial_failure` with `details.orphans` |
PATCH | /api/v1/ads/accounts/{accountId}/objects/{objectId}Pause/activate, rename or change budget of a campaign, ad set or ad. `dailyBudget` / `lifetimeBudget` are in the MINOR currency unit (tree returns whole units: multiply by 100 for non-zero-decimal currencies such as USD) |
GET | /api/v1/ads/accounts/{accountId}/insightsPerformance report (spend, impressions, reach, clicks, CTR, CPC, CPM, actions) |
GET | /api/v1/ads/lead-formsInstant Forms (Lead Ads) of a connected Facebook Page: id, name, status, locale, leadsCount, createdAt |
POST | /api/v1/ads/lead-formsCreate an Instant Form on a connected Facebook Page. Send an Idempotency-Key |
GET | /api/v1/ads/lead-forms/{formId}/leadsLeads of an Instant Form, newest first — read live from Meta, not stored by Getviews |
GET | /api/v1/ads/accounts/{accountId}/pixelsPixels the ad account can use: id, name, status (active / unavailable), installed (has fired an event), lastFiredTime (ms) |
GET | /api/v1/ads/accounts/{accountId}/audiencesCustom audiences of the ad account: id (= platformAudienceId, the Meta id), name, type (website / meta_engagement / lookalike / customer_list…), size (null while Meta is still counting), status |
POST | /api/v1/ads/accounts/{accountId}/audiencesCreate an audience. Send an Idempotency-Key |
GET | /api/v1/ads/accounts/{accountId}/targeting/searchSearch targeting: locations (`dimension=geo`, `geoType` country / region / city / zip, `countryCode`) or interests (`dimension=interest`). For locations `id` = `key` to send in launch `regions[].key` |
GET | /api/v1/ads/accounts/{accountId}/treeCampaign → ad set → ad tree with per-ad metrics for a date range |
Automations
GET | /api/v1/comment-automationsList comment-to-DM automations |
POST | /api/v1/comment-automationsCreate automation: matching top-level comments get a private reply (once per comment); post-specific automations win over account-wide ones |
GET | /api/v1/comment-automations/{automationId}Get automation |
PATCH | /api/v1/comment-automations/{automationId}Update automation (partial: omitted fields are kept) |
DELETE | /api/v1/comment-automations/{automationId}Delete automation |
GET | /api/v1/comment-automations/{automationId}/logsWho got messaged, and failures |