---
title: "Update an activity (partial); set status to activate or pause"
method: PATCH
path: "/activities/{id}"
tags: ["Activities"]
---

# Update an activity (partial); set status to activate or pause

`PATCH /activities/{id}`

## Request

- Base URL: `https://social-automation.cresclab.com/api/v1`
- URL: `https://social-automation.cresclab.com/api/v1/activities/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/cresclab/apis/social-automation-api/docs/activities/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` string, uuid, required

## Request body

- ActivityUpdate
  - `trigger` 'ig_comment' | 'ig_story' | 'ig_live' | 'ig_message' | 'fb_comment' | 'fb_live' | 'fb_message' | 'threads_reply': `ig_comment` (instagram): A comment on an Instagram post or Reel. `ig_story` (instagram): A reply to (or mention in) an Instagram Story. post_ids, if set, are story ids. `ig_live` (instagram): A comment during an Instagram Live broadcast (only while the broadcast is live). `ig_message` (instagram): An Instagram DM sent to the account. dm_source "keywords" (default) answers DMs that match a keyword; dm_source "ads" answers only the first DM of a conversation opened from an ad (live video ads, click-to-Instagram-Direct ads), keywords optional. `fb_comment` (facebook): A comment on a Facebook Page post. The DM is sent through Messenger. `fb_live` (facebook): A comment during a Facebook Live broadcast (only while the broadcast is live). `fb_message` (facebook): A Messenger message sent to the Page; the activity replies in Messenger. dm_source "ads" answers only conversations opened from an ad (live video ads, click-to-Messenger ads). `threads_reply` (threads): A reply to a Threads post. Public reply only: Meta offers no Threads DM API. Meta allows up to 1,000 replies per Threads profile per 24 hours.
  - `name` string: Internal name shown in the dashboard.
  - `keywords` string[]: Keywords that trigger the activity, e.g. ["+1", "want", "price"]. Case-insensitive. Empty array = every comment triggers it. ig_message needs at least one keyword unless dm_source is "ads".
  - `dm_source` 'keywords' | 'ads': ig_message and fb_message only. "keywords" (default): answer DMs that match a keyword. "ads": answer only the first DM of a conversation opened from an ad (Instagram/Facebook live video ads with a message button, click-to-Instagram-Direct or click-to-Messenger ads); keywords are optional and narrow it further.
  - `match` 'contains' | 'exact': "contains" (default): comment contains a keyword. "exact": comment equals a keyword.
  - `public_replies` string[]: Public replies posted under the comment; one is picked at random each time (avoids looking like spam). Not available for ig_story and fb_message.
  - `dm` object[]: The private message sent to the commenter (Instagram DM or Messenger). Not available for threads_reply.
    - `type` 'text' | 'button' | 'image' | 'card', required
    - `text` string: type=text: message text (all text together ≤1000 chars, ≤640 when buttons are present).
    - `title` string: type=button: button label ≤20 chars. type=card: card title ≤80 chars.
    - `url` string: type=button: link opened by the button (full https URL).
    - `image_url` string: type=image or card: publicly reachable direct image URL (PNG/JPEG). Share-page links (Google Drive, Dropbox pages) are rejected.
    - `subtitle` string: type=card: optional subtitle ≤80 chars.
    - `buttons` object[]: type=card: up to 3 link buttons on the card.
      - `title` string, required
      - `url` string, required
  - `post_scope` 'all' | 'selected' | 'next_post': "all" (default): every post. "selected": only post_ids. "next_post": the next Instagram post you publish (ig_comment only).
  - `post_ids` string[]: Post ids from list_recent_posts, or full post URLs (Instagram/Threads URLs are resolved to ids, which needs a live Meta call).
  - `follow_gate` object: Instagram only (ig_comment, ig_live): ask the commenter to follow the account before the DM content is delivered.
    - `enabled` boolean, required
    - `opening_text` string: First DM with a button, sent before checking the follow.
    - `button_title` string: Label of that button, ≤20 chars.
    - `not_following_text` string: Sent when the person does not follow yet.
  - `start_at` string, nullable: Optional start time, ISO 8601 with timezone (e.g. 2026-10-10T20:00:00+08:00).
  - `end_at` string, nullable: Optional end time, ISO 8601 with timezone. Must be after start_at.
  - `status` 'draft' | 'active' | 'paused'

## Response `200`

OK

- Activity
  - `id` string
  - `name` string
  - `status` 'draft' | 'active' | 'paused'
  - `account_id` string
  - `platform` 'instagram' | 'facebook' | 'threads'
  - `trigger` 'ig_comment' | 'ig_story' | 'ig_live' | 'ig_message' | 'fb_comment' | 'fb_live' | 'fb_message' | 'threads_reply': `ig_comment` (instagram): A comment on an Instagram post or Reel. `ig_story` (instagram): A reply to (or mention in) an Instagram Story. post_ids, if set, are story ids. `ig_live` (instagram): A comment during an Instagram Live broadcast (only while the broadcast is live). `ig_message` (instagram): An Instagram DM sent to the account. dm_source "keywords" (default) answers DMs that match a keyword; dm_source "ads" answers only the first DM of a conversation opened from an ad (live video ads, click-to-Instagram-Direct ads), keywords optional. `fb_comment` (facebook): A comment on a Facebook Page post. The DM is sent through Messenger. `fb_live` (facebook): A comment during a Facebook Live broadcast (only while the broadcast is live). `fb_message` (facebook): A Messenger message sent to the Page; the activity replies in Messenger. dm_source "ads" answers only conversations opened from an ad (live video ads, click-to-Messenger ads). `threads_reply` (threads): A reply to a Threads post. Public reply only: Meta offers no Threads DM API. Meta allows up to 1,000 replies per Threads profile per 24 hours.
  - `keywords` string[]
  - `match` 'contains' | 'exact'
  - `public_replies` string[]
  - `dm` DmBlock[]
    - `type` 'text' | 'button' | 'image' | 'card', required
    - `text` string: type=text: message text (all text together ≤1000 chars, ≤640 when buttons are present).
    - `title` string: type=button: button label ≤20 chars. type=card: card title ≤80 chars.
    - `url` string: type=button: link opened by the button (full https URL).
    - `image_url` string: type=image or card: publicly reachable direct image URL (PNG/JPEG). Share-page links (Google Drive, Dropbox pages) are rejected.
    - `subtitle` string: type=card: optional subtitle ≤80 chars.
    - `buttons` object[]: type=card: up to 3 link buttons on the card.
      - `title` string, required
      - `url` string, required
  - `post_scope` 'all' | 'selected' | 'next_post'
  - `post_ids` string[], nullable
  - `follow_gate` object: Instagram only (ig_comment, ig_live): ask the commenter to follow the account before the DM content is delivered.
    - `enabled` boolean, required
    - `opening_text` string: First DM with a button, sent before checking the follow.
    - `button_title` string: Label of that button, ≤20 chars.
    - `not_following_text` string: Sent when the person does not follow yet.
  - `start_at` string, nullable
  - `end_at` string, nullable
  - `created_at` string
  - `updated_at` string
  - `dashboard_url` string
  - `stats` object
    - `public_replies_sent` integer
    - `dms_sent` integer

## Other responses

- `400`: Invalid request (see error.field)
- `401`: Missing or invalid API key
- `403`: Insufficient scope, trial expired, contract expired or plan limit (see error.code and error.action_url)
- `404`: Not found
- `429`: Rate limited

---

[API](https://skmtc.dev/cresclab/apis/social-automation-api.md) - [All operations](https://skmtc.dev/cresclab/apis/social-automation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cresclab/apis/social-automation-api/revisions/1d4ea62ba46d?raw)
