Social Automation API: Instagram & Facebook Comment Auto-Reply REST API

Summary

The base URL is https://social-automation.cresclab.com/api/v1; send your API key as Authorization: Bearer. List connected accounts and recent posts, create and update activities (trigger, keywords, public replies, DM content), activate or pause them, and read trigger logs and daily stats. Full spec at /openapi.json; for AI agents, see the MCP setup.

Quick start

1. Create a key under API & AI in the dashboard account menu (choose Read & write). 2. Check that it works:

bash
curl https://social-automation.cresclab.com/api/v1/me \
  -H "Authorization: Bearer sa_live_YOUR_KEY"

3. Create an activity. Without a status it is a draft and nothing is sent:

bash
curl -X POST https://social-automation.cresclab.com/api/v1/activities \
  -H "Authorization: Bearer sa_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "account_id": "ACCOUNT_ID", "name": "+1 → product link", "trigger": "ig_comment", "keywords": [ "+1", "want" ], "public_replies": [ "Sent you a DM 💌", "Check your DMs!" ], "dm": [ { "type": "text", "text": "Here is the link you asked for 👇" }, { "type": "button", "title": "Shop now", "url": "https://shop.example.com/serum" } ], "post_scope": "next_post" }'

4. Activate it once the setup looks right. From then on, your account replies publicly and DMs the real people who comment:

bash
curl -X PATCH https://social-automation.cresclab.com/api/v1/activities/ACTIVITY_ID \
  -H "Authorization: Bearer sa_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"active"}'

Authentication and access

  • Send the header Authorization: Bearer sa_live_... with every request.
  • Keys are Read only (GET) or Read & write (GET, POST, PATCH, DELETE).
  • A key acts as the person who created it: a team member's key only sees and changes the accounts they were given. If that person is deactivated or leaves the workspace, the key stops working.
  • Revoke keys on the same dashboard page; it takes effect immediately.

Endpoints

All paths are relative to https://social-automation.cresclab.com/api/v1.

MethodPathAccessDescription
GET/mereadWorkspace, plan and usage for this key
GET/accountsreadConnected Instagram / Facebook Page / Threads accounts
GET/accounts/{id}/postsreadRecent posts, live from Meta; ?kind=story for Stories
GET/activitiesreadActivities with totals
POST/activitieswriteCreate an activity (draft by default)
GET/activities/{id}readOne activity + 14-day trend
PATCH/activities/{id}writeUpdate settings; set status to active / paused
DELETE/activities/{id}writeDelete an activity and its trigger logs
GET/logsreadTrigger logs: who commented, what was sent, errors
GET/statsreadDaily public replies, DMs and failures

The activity object

account_id and trigger are required when creating; everything else is optional. Updates change only the fields you send, and arrays (keywords, public_replies, dm) replace the old value.

json
{
  "account_id": "ACCOUNT_ID",
  "name": "+1 → product link",
  "trigger": "ig_comment",
  "keywords": [
    "+1",
    "want"
  ],
  "public_replies": [
    "Sent you a DM 💌",
    "Check your DMs!"
  ],
  "dm": [
    {
      "type": "text",
      "text": "Here is the link you asked for 👇"
    },
    {
      "type": "button",
      "title": "Shop now",
      "url": "https://shop.example.com/serum"
    }
  ],
  "post_scope": "next_post"
}

Triggers

triggerPlatformPublic replyDMDescription
ig_commentinstagramYesYesA comment on an Instagram post or Reel
ig_storyinstagram—YesA reply to or mention in an Instagram Story (post_ids are story ids)
ig_liveinstagramYesYesA comment during an Instagram Live (only while live)
fb_commentfacebookYesYesA comment on a Facebook Page post; the DM goes through Messenger
fb_livefacebookYesYesA comment during a Facebook Live (only while live)
fb_messagefacebook—YesA Messenger message to the Page; answered in Messenger
threads_replythreadsYes—A reply to a Threads post; public reply only (Meta has no Threads DM API), beta

Three DM shapes

  • Text plus up to 3 link buttons: up to 640 characters of text with buttons, 1,000 without.
  • A single image: one image block on its own. The URL must return the image file itself (Google Drive or Dropbox share pages are rejected).
  • A card carousel: 1–10 cards, up to 3 buttons each, nothing else mixed in.
Invalid combinations are rejected instead of being partly dropped. Image URLs and post URLs are checked when you save, so create and update can take a few seconds.

Errors and limits

Every error has the same shape. action_url points to where the user can fix the problem (connect an account, upgrade, create a key):

json
{
  "error": {
    "code": "trial_expired",
    "message": "The 7-day trial has ended. Upgrade the plan to keep creating and activating activities.",
    "action_url": "https://social-automation.cresclab.com/dashboard/workspace"
  }
}
  • 400 invalid_request: a field is invalid; error.field says which.
  • 401 unauthorized: missing or invalid key.
  • 403 insufficient_scope / trial_expired / contract_expired / plan_limit.
  • 404 not_found / account_not_found.
  • 429 rate_limited: up to 120 requests per minute per key, with a Retry-After header.

For AI agents: MCP

The same operations are available as MCP tools for Claude Code, Cursor and Codex. See the MCP setup.

FAQ

Is there an OpenAPI spec?

Yes, at /openapi.json (OpenAPI 3.1). Paste it into Cursor or Claude Code to generate a client.

Can the API connect a new Instagram account?

No. Connecting an account requires a Meta login in the browser, on the dashboard's connections page; the API's connect_url takes you there.

Does the API send webhooks?

Not yet. To follow trigger results, poll GET /logs.

Does the API cost extra?

No. The API and MCP server are included in every plan, including the 7-day trial.