Comment Automations

Create a comment automation

Requires read_write. Limited to 60 creates per hour per user. Per-post automations take priority over account-wide automations. One matching automation wins, and each contact receives at most one pending or successful send per automation and source. Instagram only. A comment permits one private reply ever, within 7 days. Story replies use normal DMs inside the 24-hour messaging window. Buttons and image cards (template) fall back to text with title and URL lines if Meta rejects the template. Reconnect the account on 403 platformCapabilityMissing to grant instagram_business_manage_comments and instagram_business_manage_messages.

post/v1/comment-automations

Request

  • Base URL: https://api.postzen.dev
  • URL: https://api.postzen.dev/v1/comment-automations
  • Auth: HTTP bearer

Request body

accountIdstring required

Connected Instagram account id. Immutable after creation.

profileIdstring

If supplied, must equal the account profile.

namestring required

Trimmed name.

trigger'comment' | 'story_reply'
platformPostIdstring

Instagram media or story id. Mutually exclusive with postId; omit both for account-wide matching.

postIdstring

Owned PostZen post with an Instagram target on this account. Resolves providerPostId at match time, including posts not yet published. Mutually exclusive with platformPostId.

postTitlestring
keywordsstring[]

Trimmed and deduplicated case-insensitively. Empty matches every comment.

matchMode'exact' | 'contains' | 'word'
excludeKeywordsstring[]

Vetoes matching using the same matchMode; trimmed and deduplicated case-insensitively.

typoToleranceboolean

word mode only: Damerau-Levenshtein per word, 1 edit for 4–7 characters, 2 edits for 8+, none for fewer than 4.

dmMessagestring

Required unless template is set. Plain text: at most 1000 UTF-8 bytes. With buttons: at most 640 characters. Ignored when a template is sent.

dmMessageVariationsstring[]

Same limits as dmMessage. Uniform random choice from the base message and variations.

commentReplystring

Optional public reply, sent only after successful comment DM. Ignored for story_reply.

commentReplyVariationsstring[]

Uniform random choice independent of the DM.

dmDelaySecondsinteger
commentReplyDelaySecondsinteger

Effective delay is max(dmDelaySeconds, commentReplyDelaySeconds).

isActiveboolean
linkTrackingfalse

Response

Create a comment automation.

messagestring required

Changes

No recorded changes to this operation across all 1 revision of this API.