API reference

Automation versions

An automation's version history: every save that changed it is a version. List what changed at each, read one version as it was (secrets masked), and put one back - it is saved again as the newest version, as the editor's revision menu does. 3 endpoints. Add your API key in the authentication panel to send test requests from this page.

List an automation's versions

GET/api/external/v1/automations/{automationId}/versions

The automation's versions, newest first: id, versionNumber, createdAt, initial (the first one), live (the newest: what the automation is now) and changes - what that save changed from the version before (kind settings with changedFields: [{field, label, oldValue, newValue}]; nodes with added, removed, updated; connections; viewport; checkpoint when nothing visible changed). No snapshots: read one version with GET /automations/{automationId}/versions/{versionNumber}.

Paging: page (from 0), size (1 to 100, default 20); the answer carries liveVersion, page, size, totalElements, totalPages. Errors: 404 AUTOMATION_NOT_FOUND.

Parameters

  • automationIdstring (uuid)pathRequired
  • pageinteger (int32)query
  • sizeinteger (int32)query

Responses

  • 200OK

Read one version of an automation

GET/api/external/v1/automations/{automationId}/versions/{versionNumber}

One version as it was saved: snapshot holds its name, description, projectId, enabled, iconKey, iconColor, aiEditable and graph, with secrets answered as *** (maskedFields says where). To work from it, send its graph with PUT /automations/{automationId} (a *** keeps the secret saved now at that place) or put the whole version back with POST .../restore.

Under the write permission: a version holds what the person put in it. Errors: 404 AUTOMATION_NOT_FOUND, VERSION_NOT_FOUND.

Parameters

  • automationIdstring (uuid)pathRequired
  • versionNumberinteger (int32)pathRequired

    The version's `versionNumber`.

Responses

  • 200OK

Put a version of an automation back

POST/api/external/v1/automations/{automationId}/versions/{versionNumber}/restore

Saves the automation again as it was at that version - its name, description, icon, on/off state and graph (the version's secrets with it) - as the newest version, as the editor's revision menu "Make live" does; nothing in the history is lost. Its default application and credential links stay as they are now (a version does not keep them). Answers outcome (restored, or already_live when it was the newest version), restoredVersion, version (the newest now) and the automation.

Switching it on or changing its triggers takes effect at once: a version that was switched on starts running on its schedule, events and hosted webhook again.

Errors: 404 AUTOMATION_NOT_FOUND, VERSION_NOT_FOUND; 409 RESTORE_REFUSED (the version cannot be saved as it is, e.g. a node timeout outside the allowed range: the message says why); 403 AI_ORIGIN_WRITE.

Parameters

  • automationIdstring (uuid)pathRequired
  • versionNumberinteger (int32)pathRequired

    The version's `versionNumber`.

Responses

  • 200OK