Automation Versions

An AutomationVersion is an immutable revision of an Automation v2 graph. Each saved graph change creates a revision. Restoring a revision saves its definition as a new current revision and keeps existing runs and Run Automation nodes pinned to their selected revisions.

List Automation Versions

Endpoint

GET/automation_versions

Return Object

AutomationVersion[]

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Request Parameters

ParameterDescription
automation_id
int64
Required
ID of the Automation that owns this revision.

Additional Arguments

Example Request

curl "https://app.files.com/api/rest/v1/automation_versions.json?automation_id=1" \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "automation_id": 1,
    "workspace_id": 1,
    "version": 1,
    "created_at": "2000-01-01T01:00:00Z",
    "user_id": 1,
    "username": "example",
    "api_key_id": 1,
    "definition": {
      "schema_version": 1,
      "nodes": [
        {
          "id": "trigger",
          "type": "trigger_manual"
        },
        {
          "id": "create_reports",
          "type": "create_folder",
          "config": {
            "destinations": [
              "reports/"
            ]
          }
        }
      ],
      "edges": [
        {
          "from": "trigger",
          "to": "create_reports"
        }
      ]
    }
  }
]

Show Automation Version

Endpoint

GET/automation_versions/{id}

Return Object

AutomationVersion

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Request Parameters

ParameterDescription
id
int64
Required
Automation Version ID.

Example Request

curl https://app.files.com/api/rest/v1/automation_versions/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "automation_id": 1,
  "workspace_id": 1,
  "version": 1,
  "created_at": "2000-01-01T01:00:00Z",
  "user_id": 1,
  "username": "example",
  "api_key_id": 1,
  "definition": {
    "schema_version": 1,
    "nodes": [
      {
        "id": "trigger",
        "type": "trigger_manual"
      },
      {
        "id": "create_reports",
        "type": "create_folder",
        "config": {
          "destinations": [
            "reports/"
          ]
        }
      }
    ],
    "edges": [
      {
        "from": "trigger",
        "to": "create_reports"
      }
    ]
  }
}

The AutomationVersion Object

Some of the endpoints above return a AutomationVersion object. The attributes of this object are listed below.

AttributeDescription
id
int64
Automation revision ID.
automation_id
int64
ID of the Automation that owns this revision.
workspace_id
int64
Workspace that owns the Automation. Zero is the Default Workspace.
version
int64
Revision number within the Automation.
created_at
date-time
Time the revision was saved.
user_id
int64
ID of the user who saved the revision, when available.
username
string
Username recorded when the revision was saved, when available.
api_key_id
int64
ID of the API key used to save the revision, when available.
definition
object
Saved Automation v2 graph definition. Included when retrieving a single revision.

Example AutomationVersion Object

{
  "id": 1,
  "automation_id": 1,
  "workspace_id": 1,
  "version": 1,
  "created_at": "2000-01-01T01:00:00Z",
  "user_id": 1,
  "username": "example",
  "api_key_id": 1,
  "definition": {
    "schema_version": 1,
    "nodes": [
      {
        "id": "trigger",
        "type": "trigger_manual"
      },
      {
        "id": "create_reports",
        "type": "create_folder",
        "config": {
          "destinations": [
            "reports/"
          ]
        }
      }
    ],
    "edges": [
      {
        "from": "trigger",
        "to": "create_reports"
      }
    ]
  }
}

definition

Automation v2 workflow graph. Nodes define triggers, actions, and control flow; edges connect node IDs.

AttributeDescription
schema_version
integer
Required
Automation definition schema version. Value: 1.
nodes
array of objects
Required
Flat list of nodes. Every node requires a unique id and a type, accepts the node-specific config fields documented below, and action or control-flow nodes may set return to true to include their output in the Automation result. From 1 to 50 items.
edges
array of objects
Required
Directed connections between nodes.

Example definition

{
  "schema_version": 1,
  "nodes": [
    {
      "id": "trigger",
      "type": "trigger_manual"
    },
    {
      "id": "create_reports",
      "type": "create_folder",
      "config": {
        "destinations": [
          "reports/"
        ]
      }
    }
  ],
  "edges": [
    {
      "from": "trigger",
      "to": "create_reports"
    }
  ]
}

Edge fields

Trigger nodes

Action nodes

Control-flow nodes