Automations
Create Inbox Automation
Creates a keyword auto-reply rule for an Instagram or Facebook connection.
POST
header
x-api-key<token>Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.
application/json- body
accountId*stringLength
1 <= lengthkind*stringValue in
"comment_to_dm""story_reply""welcome_dm"name*stringLabel for the rule.
Length
1 <= length <= 120keywords*array<>The rule runs when a comment or message contains any of these words. Matching ignores case.
Items
1 <= items <= 20excludeKeywords?array<>The rule is skipped when a comment or message contains any of these words.
Items
items <= 20dmMessage*stringLength
1 <= length <= 1000Created rule
application/json- response
accountId*stringrule*Example Request
import { Configuration, EngagementApi } from "@onepostly/sdk";const engagementApi = new EngagementApi( new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await engagementApi.createAutomation({ createAutomationBody: { "accountId": "string", "kind": "comment_to_dm", "name": "string", "keywords": [ "string" ], "dmMessage": "string" },});console.log(response);Example Response
{ "accountId": "string", "rule": { "id": "string", "name": "Free guide giveaway", "kind": "comment_to_dm", "keywords": [ "guide", "free" ], "excludeKeywords": [ "guidelines" ], "dmMessage": "Thanks for your interest! Here is your guide.", "enabled": true }}