Duplicate an automation
Copies the source automation's trigger and graph into a new automation named after it, left disabled and unpublished. Requires the `automations:write` permission plus access to the source; an unknown id returns not-found, and the copied graph is recompiled so one that no longer validates is rejected with a validation error. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringautomationId*stringSuccess
application/json- response
data*curl -X POST 'https://api.snoze.dev/v1/workspaces/string/automations/string/duplicate'{ "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" }}Create an automation
Creates an automation from a trigger and a step graph, adds a matching workspace item, and unless `publish` is false publishes the first version and enables it. Requires the `automations:write` permission; the graph and trigger are compiled first, so an invalid graph is rejected with a validation error, and workspaces over their automation allowance or without the AI-step entitlement are refused. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Get a single automation
Returns one automation with its compiled trigger and graph, its published and draft version ids, and whether it has unpublished changes. Requires the `automations:read` permission plus view access to the automation; an unknown id returns not-found.