SnozeDevelopers
API referenceAutomations

Publish an automation's draft version

Promotes the current draft to the published version and installs its triggers, optionally enabling the automation or rotating its webhook signing secret at the same time. Requires the `automations:write` permission plus edit access; the draft is recompiled under stricter publish-time rules, so an automation with no unpublished changes, no steps, or an invalid graph is rejected with a validation error. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.

POST
/v1/workspaces/{workspaceId}/automations/{automationId}/publish

Authorization

apiKey
headerAuthorizationBearer <snoze_sk_…>

Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.

Path Parameters

workspaceId*string
automationId*string

Request Body

application/json
  1. body
enable?boolean|null
rotateWebhookSecret?boolean|null

Response Body

Success

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.snoze.dev/v1/workspaces/string/automations/string/publish' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "data": {    "referenceIssues": [      {        "nodeId": "string",        "message": "string"      }    ],    "id": "string",    "workspaceId": "string",    "key": "string",    "label": "string",    "enabled": true,    "versionId": "string",    "version": 0,    "publishedVersionId": "string",    "draftVersionId": "string",    "hasUnpublishedChanges": true,    "trigger": "manual",    "triggerConfig": {      "kind": "manual"    },    "graph": {      "reusable": {        "inputs": [          {            "key": "string",            "label": "string",            "type": "text",            "required": true          }        ],        "outputs": [          {            "key": "string",            "label": "string",            "type": "text",            "required": true,            "value": {              "type": "literal",              "value": null            }          }        ]      },      "nodes": [        {          "id": "string",          "label": "string",          "retry": {            "maxAttempts": 0,            "initialDelaySeconds": 0,            "backoffMultiplier": 0,            "maxDelaySeconds": 0          },          "position": {            "x": 0,            "y": 0          },          "kind": "action",          "actionId": "string",          "input": {            "property1": {              "type": "literal",              "value": null            },            "property2": {              "type": "literal",              "value": null            }          }        }      ],      "edges": [        {          "id": "string",          "from": "string",          "to": "string",          "outcome": "always"        }      ],      "entryNodeIds": [        "string"      ],      "testPayloads": [        {          "id": "string",          "name": "string",          "payload": {}        }      ],      "failureAutomationId": "string",      "triggerPosition": {        "x": 0,        "y": 0      }    },    "webhookPath": "string",    "webhookSecret": "string",    "webhookActive": true,    "runAs": {      "kind": "workspace",      "connectionId": "string"    },    "aiMonthlyBudgetMicrousd": 0,    "nextRunAt": "string",    "lastTriggeredAt": "string",    "createdAt": "string",    "updatedAt": "string"  }}