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

  1. Create an API key in the dashboard.
  2. Allow your redirect origin once: PUT /api/v1/connect/settings with redirectOrigins (and optionally brandName, brandLogoUrl).
  3. Create a profile, then call GET /api/v1/connect/facebook?profileId=...&redirectUrl=... and send your user to authUrl. They pick Pages, Instagram accounts and ad accounts on a Getviews-hosted page and come back to redirectUrl?status=connected&accountIds=....
  4. Building your own picker instead: add &picker=false, then list with GET /api/v1/connect/facebook/select?state=... and connect with POST { state, ids }. A select ends the session; send keepOpen: true to select another platform (e.g. meta_ads) with the same state.
  5. Publish: POST /api/v1/posts. Subscribe to post.published webhooks 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.publishedEvery target of a post was published
post.partialSome targets published, some failed
post.failedEvery target of a post failed
account.connectedAn account was connected
account.disconnectedAn account was disconnected
account.needs_reauthAn account's token stopped working — the user must reconnect
account.token_expiringAn ad account's token expires within 7 days
comment.receivedA comment arrived on a Facebook Page or Instagram post
mention.receivedThe account was tagged in a post or comment
message.receivedA customer sent a Messenger / Instagram Direct message
webhook.disabledAn endpoint was turned off after sustained failures
webhook.testTest event from POST /v1/webhooks/{webhookId}/test

Payload schemas are under webhooks in the spec.

Profiles

GET/api/v1/profiles
List profiles
POST/api/v1/profiles
Create 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-keys
List API keys
POST/api/v1/api-keys
Create 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/settings
Get connect-flow settings: allowed redirect origins and the brand shown on the hosted picker
PUT/api/v1/connect/settings
Update 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}/select
List Pages / Instagram accounts / ad accounts available for this login
POST/api/v1/connect/{platform}/select
Connect the selected Pages / Instagram accounts / ad accounts

Accounts

GET/api/v1/accounts
List connected accounts
GET/api/v1/accounts/{accountId}
Get account
DELETE/api/v1/accounts/{accountId}
Disconnect account (deletes its token)
POST/api/v1/accounts/{accountId}/realtime
Turn Page webhooks (real-time comments, mentions, messages) on or off

Posts

GET/api/v1/posts
List posts
POST/api/v1/posts
Create 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}/retry
Retry failed platforms of a failed/partial post
PATCH/api/v1/posts/{postId}/platform
Edit the text of a PUBLISHED post on the platform (Facebook only)
DELETE/api/v1/posts/{postId}/platform
Delete 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/slots
Get queue schedule
PUT/api/v1/queue/slots
Set queue schedule
GET/api/v1/queue/preview
Upcoming free slots
GET/api/v1/queue/next-slot
Next free slot

Media

POST/api/v1/media/presign
Get an upload URL (PUT the file there, then use publicUrl in posts)
POST/api/v1/media/from-url
Copy a file from a public https URL into Getviews storage (use publicUrl in posts)

Webhooks

GET/api/v1/webhooks
List webhooks
POST/api/v1/webhooks
Create webhook (signing secret returned once)
POST/api/v1/webhooks/{webhookId}/rotate-secret
Rotate 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}/deliveries
Delivery log, newest first
POST/api/v1/webhooks/{webhookId}/test
Send a test event now
POST/api/v1/webhooks/deliveries/{deliveryId}/redeliver
Redeliver an event

Inbox

GET/api/v1/inbox/posts
Recent posts with comment counts
GET/api/v1/inbox/posts/{postId}/comments
Comments of a post (replies flattened with parentId)
POST/api/v1/inbox/posts/{postId}/comments
Comment 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-reply
Send a private message (Messenger / Instagram Direct) to the commenter — within 7 days, once per comment
GET/api/v1/inbox/mentions
Posts that tag the account (real-time mentions arrive via the mention.received webhook)

Messages

GET/api/v1/inbox/conversations
Conversations (Messenger + Instagram Direct), latest first
POST/api/v1/inbox/conversations/sync
Import recent history from Meta (idempotent)
GET/api/v1/inbox/conversations/{conversationId}
Get conversation
GET/api/v1/inbox/conversations/{conversationId}/messages
Messages, newest first
POST/api/v1/inbox/conversations/{conversationId}/messages
Send a reply (text or one attachment). 422 outside the 24h window unless tag HUMAN_AGENT
POST/api/v1/inbox/conversations/{conversationId}/read
Mark 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}/posts
Recent platform posts of an account with per-post metrics
GET/api/v1/analytics/accounts/{accountId}/discover
Business 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}/campaigns
List campaigns
POST/api/v1/ads/accounts/{accountId}/campaigns
Create 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}/adsets
List ad sets
GET/api/v1/ads/accounts/{accountId}/page-posts
Published posts of a connected Facebook Page (to promote as an ad)
POST/api/v1/ads/accounts/{accountId}/launch
Launch a full campaign: campaign → ad set → (video upload) → creatives → ads, PAUSED by default
GET/api/v1/ads/accounts/{accountId}/ads
List ads
POST/api/v1/ads/accounts/{accountId}/ads
Create 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}/insights
Performance report (spend, impressions, reach, clicks, CTR, CPC, CPM, actions)
GET/api/v1/ads/lead-forms
Instant Forms (Lead Ads) of a connected Facebook Page: id, name, status, locale, leadsCount, createdAt
POST/api/v1/ads/lead-forms
Create an Instant Form on a connected Facebook Page. Send an Idempotency-Key
GET/api/v1/ads/lead-forms/{formId}/leads
Leads of an Instant Form, newest first — read live from Meta, not stored by Getviews
GET/api/v1/ads/accounts/{accountId}/pixels
Pixels the ad account can use: id, name, status (active / unavailable), installed (has fired an event), lastFiredTime (ms)
GET/api/v1/ads/accounts/{accountId}/audiences
Custom 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}/audiences
Create an audience. Send an Idempotency-Key
GET/api/v1/ads/accounts/{accountId}/targeting/search
Search 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}/tree
Campaign → ad set → ad tree with per-ad metrics for a date range

Automations

GET/api/v1/comment-automations
List comment-to-DM automations
POST/api/v1/comment-automations
Create 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}/logs
Who got messaged, and failures