Automation Versions
5 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1
Get or create the draft version#
/automations/{id}/draftTokenReturns the current draft version of the automation including the full workflow `definition` (nodes + edges). If no draft exists yet, an empty draft is automatically created. Returns 403 if the automation is archived.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | Automation UUID |
spaceId | Query | string | Space UUID — validated against the automation if provided |
Antworten
- 200Draft version with full definition
- 400spaceId does not match this automation
- 401Not authenticated
- 403Automation is archived — draft access not allowed
- 404Automation not found
curl -X GET "https://xapi.ambertech.cloud/api/v1/automations/{id}/draft" \
-H "Authorization: Bearer $XISUITE_TOKEN"Save the draft version#
/automations/{id}/draftTokenOverwrites the draft with the provided `definition`, `trigger_kind`, and/or `trigger_config`. Any field not included falls back to the existing draft value. The `definition` uses ReactFlow format: nodes have `id`, `type` (`trigger` | `action`), `position`, and `data.kind` + `data.config`. Returns 403 if the automation is archived, 404 if no draft exists.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | Automation UUID |
Request-Body
| Name | Typ | Beschreibung |
|---|---|---|
trigger_kind | string | Trigger kind (e.g. webhook.received, schedule.cron, manual) |
trigger_config | object | Trigger configuration object |
definition | object | Workflow definition (nodes + edges in ReactFlow format) |
Antworten
- 200Updated draft version
- 400Validation error
- 401Not authenticated
- 403Automation is archived
- 404Automation not found or no draft exists
curl -X PUT "https://xapi.ambertech.cloud/api/v1/automations/{id}/draft" \
-H "Authorization: Bearer $XISUITE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"trigger_kind":"…","trigger_config":{},"definition":{}}'List all versions of an automation#
/automations/{id}/versionsTokenReturns version summaries ordered by `version_number` descending. Summaries omit the full `definition` and `trigger_config` fields for performance — use GET /:id/versions/:versionId for the complete data.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | Automation UUID |
Antworten
- 200Array of version summaries (no definition/trigger_config)
- 401Not authenticated
- 404Automation not found
curl -X GET "https://xapi.ambertech.cloud/api/v1/automations/{id}/versions" \
-H "Authorization: Bearer $XISUITE_TOKEN"Get a specific version with full definition#
/automations/{id}/versions/{versionId}TokenReturns the complete version including the full workflow `definition` (all nodes, edges, variables) and `trigger_config`. Use this to inspect historical runs or restore a previous design.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | Automation UUID |
versionIdPflicht | Pfad | string | Version UUID |
Antworten
- 200Full version including definition and trigger_config
- 401Not authenticated
- 404Automation or version not found
curl -X GET "https://xapi.ambertech.cloud/api/v1/automations/{id}/versions/{versionId}" \
-H "Authorization: Bearer $XISUITE_TOKEN"Restore a previous version as a new draft#
/automations/{id}/versions/{versionId}/restoreTokenCopies the given version's definition and trigger configuration into a new draft version. The new draft gets the next sequential `version_number`. Use this to roll back to a previous workflow design before publishing.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
idPflicht | Pfad | string | Automation UUID |
versionIdPflicht | Pfad | string | Version UUID to restore from |
Antworten
- 201New draft version cloned from the specified version
- 401Not authenticated
- 404Automation or version not found
curl -X POST "https://xapi.ambertech.cloud/api/v1/automations/{id}/versions/{versionId}/restore" \
-H "Authorization: Bearer $XISUITE_TOKEN"