Skip to content
techrace/
TECHRACE DOCUMENTATION

Facebook Pages

Connect Facebook Pages, publish posts, read Page insights, and manage comments and messages.

Quick reference

PropertyValue
Platform valuefacebook
One connected accountOne Facebook Page you manage (not a personal profile).
Text limit63,206 characters
SupportedText or one image to a Page
FeaturesPosting ✓ · Analytics ✓ · Inbox ✓
Provider approvalMeta review; Page permissions
Images per post1
TokenPage token from a long-lived user token; no refresh token

Before you start

The person connecting needs:

  • A Facebook account that manages at least one Facebook Page (personal profiles cannot be connected).
  • While your Meta app is in Development mode: a role on the app (Admin, Developer or Tester).

You (the platform owner) need:

  1. Create a Business app at developers.facebook.com and copy its App ID and App Secret (App settings → Basic).
  2. Add Facebook Login (or the “Manage everything on your Page” use case) with pages_show_list, pages_read_engagement and pages_manage_posts.
  3. Facebook Login → Settings → Valid OAuth Redirect URIs: https://YOUR_DOMAIN/auth/callback/facebook
  4. App settings → Basic → App domains: your domain.
  5. App roles: add the Facebook accounts that will test while the app is in Development mode.

Permissions (scopes)

Techrace puts these permissions in the login link. The person approves them on the provider's own screen; only approved permissions are granted.

PermissionRequested by defaultUsed for
pages_show_listYesList the Pages the person manages (choose a Page)
pages_read_engagementYesRead Page content and engagement
pages_manage_postsYesPublish posts to the Page
read_insightsOptionalPage analytics reports
pages_read_user_contentOptionalRead comments
pages_manage_engagementOptionalReply to, hide or delete comments
pages_messagingOptionalRead and reply to Page messages
pages_manage_metadataOptionalMessage notifications (webhooks from Meta)

Connect an account

POST/api/v1/projects/{project_id}/connect-sessionsconnections:write

Create a connect link with provider "facebook" and send the person's browser to the returned url. return_url is the page in your app where they land afterwards (https, or http://localhost while testing).

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/connect-sessions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "provider": "facebook",
  "return_url": "https://your-app.com/integrations/done"
}
EOF

After approval the person lands on your return_url with ?connected=facebook&customer_id=…&connection_id=…, or ?error=access_denied|expired|failed&provider=facebook. Your webhook also receives account.connected. Keep the connection_id: every call below uses it.

Publish a post

POST/api/v1/projects/{project_id}/executionsexecutions:write

Publish text, or text with one image, to the connected Page.

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/executions" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: unique-key-per-post" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "action": "publish",
  "input": {
    "content": "Fresh croissants every morning 🥐",
    "media_ids": [
      "$MEDIA_ID"
    ]
  }
}
EOF
  • Publishing is asynchronous: the response has status queued. Poll GET /executions/{id} or subscribe to execution.succeeded / execution.failed.
  • Upload images or video first with POST /customers/{customer_id}/media and pass the returned media IDs in media_ids.
  • Re-sending the same Idempotency-Key never posts twice.
  • Text up to 63,206 characters.

Analytics

POST/api/v1/projects/{project_id}/analytics/queryanalytics:read
reportWhat it returns
facebook_page_weeklyPage metrics per week
facebook_page_28dPage metrics for rolling 28-day periods
dailyDaily Page metrics for since–until
lifetimeLifetime metrics for one post (content_id)
curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/analytics/query" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "report": "facebook_page_weekly",
  "since": "2026-11-01",
  "until": "2026-11-07"
}
EOF
  • Needs the read_insights permission in addition to the defaults.

Comments and messages

POST/api/v1/projects/{project_id}/inbox/queryinbox:read

Read conversations, messages, Page posts and their comments.

POST/api/v1/projects/{project_id}/inbox/operationsinbox:read + inbox:write

Reply to a message or comment, hide or delete a comment, mark a conversation seen.

curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/inbox/query" \
  -H "Authorization: Bearer $TECHRACE_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<EOF
{
  "customer_id": "$CUSTOMER_ID",
  "connection_id": "$CONNECTION_ID",
  "resource": "facebook_posts",
  "limit": 20
}
EOF

Limitations

  • Pages only; personal profiles and Groups are not supported.
  • One image per post; video, carousels and Reels are not supported for Pages.
  • One Page belongs to one profile in a workspace.

Common errors

ErrorMeaningFix
no_eligible_accountsThe person manages no Page (or none returned a Page token).Log in with a Page admin account.
connection_customer_conflictThis Page is already connected under another profile.Disconnect it there first.
access_deniedThe person cancelled on Facebook.Try again and approve the permissions.
App not active (Facebook screen)The Meta app is restricted or the account has no app role.Check App roles and app status in the Meta dashboard.