v4

latestSwagger 2.02026-08-0343714211.7 MB
automations
Automations

Create Automation

Create Automation

post/automations

Response

The Automations object.

idinteger

Automation ID

workspace_idinteger

Workspace ID

always_serialize_jobsboolean

Ordinarily, we will allow automation runs to run in parallel for non-scheduled automations. If this flag is true we will force automation runs to be serialized (run one at a time, one after another). This can resolve some issues with race conditions on remote systems at the cost of some performance.

always_overwrite_size_matching_filesboolean

Ordinarily, files with identical size in the source and destination will be skipped from copy operations to prevent wasted transfer. If this flag is true we will overwrite the destination file always. Note that this may cause large amounts of wasted transfer usage. This setting has no effect unless overwrite_files is also set to true.

automation'create_folder' | 'delete_file' | 'copy_file' | 'move_file' | 'as2_send' | 'run_sync' | 'import_file' | 'v2'

Automation type

deletedboolean

Indicates if the automation has been deleted.

descriptionstring

Description for the this Automation.

definitionobject

Automation v2 graph definition.

destination_replace_fromstring

If set, this string in the destination path will be replaced with the value in destination_replace_to.

destination_replace_tostring

If set, this string will replace the value destination_replace_from in the destination filename. You can use special patterns here.

destinationsstring[]

Destination Paths

disabledboolean

If true, this automation will not run.

exclude_patternstring

If set, this glob pattern will exclude files from the automation. Supports globs, except on remote mounts.

import_urlsobject[]

List of URLs to be imported and names to be used.

inbound_email_addressstring

If trigger is email, this is the address that triggers the Automation.

flatten_destination_structureboolean

Normally copy and move automations that use globs will implicitly preserve the source folder structure in the destination. If this flag is true, the source folder structure will be flattened in the destination. This is useful for copying or moving files from multiple folders into a single destination folder.

group_idsinteger[]

IDs of Groups for the Automation (i.e. who to Request File from)

ignore_locked_foldersboolean

If true, the Lock Folders behavior will be disregarded for automated actions.

intervalstring

If trigger is daily, this specifies how often to run this automation. One of: day, week, week_end, month, month_end, quarter, quarter_end, year, year_end

last_modified_atstring date-time

Time when automation was last modified. Does not change for name or description updates.

legacy_folder_matchingboolean

If true, use the legacy behavior for this automation, where it can operate on folders in addition to just files. This behavior no longer works and should not be used.

namestring

Name for this automation.

overwrite_filesboolean

If true, existing files will be overwritten with new files on Move/Copy automations. Note: by default files will not be overwritten on Copy automations if they appear to be the same file size as the newly incoming file. Use the always_overwrite_size_matching_files option in conjunction with overwrite_files to override this behavior and overwrite files no matter what.

pathstring

Path on which this Automation runs. Supports globs, except on remote mounts.

path_time_zonestring

Timezone to use when rendering timestamps in paths.

versioninteger

Current Automation v2 definition version.

recurring_dayinteger

If trigger type is daily, this specifies a day number to run in one of the supported intervals: week, month, quarter, year.

retry_on_failure_interval_in_minutesinteger

If the Automation fails, retry at this interval (in minutes). Acceptable values are 5 through 1440 (one day). Set to null to disable.

retry_on_failure_number_of_attemptsinteger

If the Automation fails, retry at most this many times. Maximum allowed value: 10. Set to null to disable.

scheduleobject

If trigger is custom_schedule, Custom schedule description for when the automation should be run in json format.

human_readable_schedulestring

If trigger is custom_schedule or daily with times, Human readable schedule description for when the automation should be run.

schedule_days_of_weekinteger[]

If trigger is custom_schedule, Custom schedule description for when the automation should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.

schedule_times_of_daystring[]

Times of day to run in HH:MM format (24-hour). For custom_schedule, run at these times on specified days of week. For daily, run at these times on the scheduled interval date.

schedule_time_zonestring

Time zone for scheduled times. If not set, times are interpreted as UTC.

sourcestring

Source path/glob. See Automation docs for exact description, but this is used to filter for files in the path to find files to operate on. Supports globs, except on remote mounts.

legacy_sync_idsinteger[]

IDs of remote sync folder behaviors to run by this Automation

sync_idsinteger[]

IDs of syncs to run by this Automation. This is the new way to specify syncs, and it is recommended to use this instead of legacy_sync_ids.

trigger_actionsstring[]

If trigger is action, this is the list of action types on which to trigger the automation. Valid actions are create, copy, move, archived_delete, update, read, destroy

trigger'manual' | 'daily' | 'custom_schedule' | 'webhook' | 'email' | 'action'

How this automation is triggered to run.

user_idinteger

User ID of the Automation's creator.

user_idsinteger[]

IDs of Users for the Automation (i.e. who to Request File from)

valueobject

A Hash of attributes specific to the automation type.

webhook_urlstring

If trigger is webhook, this is the URL of the webhook to trigger the Automation.

holiday_regionstring

Skip automation if there is a formal, observed holiday for this region.

Example response

{
  "id": 1,
  "always_serialize_jobs": true,
  "always_overwrite_size_matching_files": true,
  "automation": "create_folder",
  "deleted": true,
  "description": "example",
  "destination_replace_from": "example",
  "destination_replace_to": "example",
  "destinations": [
    "destination"
  ],
  "disabled": true,
  "exclude_pattern": "path/to/exclude/*",
  "import_urls": [
    {
      "name": "users.json",
      "url": "http://example.com/users",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json"
      },
      "content": {
        "group": "support"
      }
    }
  ],
  "inbound_email_address": "example-automation-abc123@inbox.files.com",
  "flatten_destination_structure": true,
  "group_ids": [
    1,
    2
  ],
  "ignore_locked_folders": true,
  "interval": "week",
  "last_modified_at": "2000-01-01T01:00:00Z",
  "name": "example",
  "overwrite_files": true,
  "path": "example",
  "path_time_zone": "Eastern Time (US & Canada)",
  "version": 1,
  "recurring_day": 25,
  "retry_on_failure_interval_in_minutes": 60,
  "retry_on_failure_number_of_attempts": 10,
  "schedule": {
    "days_of_week": [
      0,
      2,
      4
    ],
    "times_of_day": [
      "06:30",
      "14:30"
    ],
    "time_zone": "Eastern Time (US & Canada)"
  },
  "human_readable_schedule": "Triggered every Monday, Wednesday at 6:30 AM,\n  2:30 PM Eastern Time (US & Canada) TZ",
  "schedule_days_of_week": [
    0,
    2,
    4
  ],
  "schedule_times_of_day": [
    "06:30",
    "14:30"
  ],
  "schedule_time_zone": "Eastern Time (US & Canada)",
  "source": "example",
  "legacy_sync_ids": [
    1,
    2
  ],
  "sync_ids": [
    1,
    2
  ],
  "trigger_actions": [
    "create"
  ],
  "trigger": "daily",
  "user_id": 1,
  "user_ids": [
    1,
    2
  ],
  "value": {
    "limit": "1"
  },
  "webhook_url": "https://app.files.com/api/webhooks/abc123",
  "holiday_region": "us_dc"
}