Turn a DM automation on
postkey_publish_automationPostkey: Publishes a DM automation's draft and switches it on (also turns a paused one back on). From then on it SENDS DMs to real people who trigger it, and those messages cannot be taken back. If this connection must ask a person first (the default), nothing is switched on: the request waits in Approvals in Postkey, and the result has waiting_for_approval true, which is not an error: do not call it again or say it was sent. Refused plan_limit when the plan's automations switched on at once are used up, and needs_a_person for one that sends email or runs on the customer's own bot. Call postkey_preview_action first. To switch it off use postkey_pause_automation. An X reply automation always waits in Approvals, whatever this connection's setting; the person reads every reply there.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"automation_id": "<automation_id>"
},
"name": "postkey_publish_automation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| preview_id | No | Optional: the preview_id postkey_preview_action gave for exactly these arguments today (UTC). Approvals then shows the person that you showed them the preview. A preview_id that does not match is ignored, never refused. | |
| automation_id | Yes | The automation id (a UUID) from postkey_list_automations or postkey_create_automation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false: refused (isError; code, message, guide_topic, url); no change. | |
| url | No | Where a person opens it in Postkey. | |
| sent | No | false while it waits for approval. | |
| limit | No | The plan's limit on automations switched on at once. | |
| status | No | The automation's status now. | |
| message | No | What happened. | |
| accounts | No | Present when an account failed: ok, message. | |
| live_now | No | Automations switched on now. | |
| warnings | No | Notes from publishing. | |
| request_id | No | The held request: read it with postkey_get_approval or postkey_list_waiting_for_approval. A post held in Posts > Approvals has none. | |
| switched_on | No | true: it is live and sends DMs. | |
| held_because | No | Why it waits on a direct connection. | |
| automation_id | No | The automation id. | |
| waiting_for_approval | No | true: NOT sent; waits for a person in Approvals. |