Automations
Update Automation
Changes a rule. Only the fields you send change. Send enabled false to pause it.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*string1 <= lengthapplication/json- body
name?stringLabel for the rule.
1 <= length <= 120keywords?array<>Replaces the keywords. The rule runs when a comment or message contains any of them.
1 <= items <= 20excludeKeywords?array<>Replaces the excluded keywords. Send an empty list to remove them.
items <= 20message?stringThe direct message the rule sends.
1 <= length <= 1000enabled?booleanfalse pauses the rule, true resumes it.
Updated automation
application/json- response
id*stringaccountId*stringname*stringLabel for the rule.
kind*|comment_to_dm answers a comment with a direct message. story_reply answers a reply to a story. welcome_dm answers a message. New values can be added, so handle a value you do not know.
keywords*array<string>The rule runs when a comment or message contains any of these words. Matching ignores case.
excludeKeywords*array<string>The rule is skipped when a comment or message contains any of these words.
message*stringThe direct message the rule sends.
enabled*booleanfalse while the rule is paused.
import { Configuration, AutomationsApi } from "@onepostly/sdk";const automationsApi = new AutomationsApi( new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await automationsApi.updateAutomation({ id: "aut_4b8e2f6a1c9d4e37a5b02c8f6d1e9a33", updateAutomationBody: { "enabled": false },});console.log(response);{ "id": "aut_4b8e2f6a1c9d4e37a5b02c8f6d1e9a33", "accountId": "acc_YOUR_INSTAGRAM_ACCOUNT_ID", "name": "Free guide giveaway", "kind": "comment_to_dm", "keywords": [ "guide", "free" ], "excludeKeywords": [ "guidelines" ], "message": "Thanks for your interest! Here is your guide.", "enabled": false}