Skip to content

Automations

MASV agent allows you to automate certain tasks to save time and support more robust workflows. Creating an automation returns an automation_id, which can be used to query, update and delete the automation.

To list all managed automations, call:

curl -X GET http://localhost:8080/api/v1/automations

Portal download automation

This automation allows the agent to automatically download packages uploaded to a certain portal. The portal has to be owned by the team to which the logged-in user belongs to.

This automation automatically picks up new packages uploaded to the specified portal and queues them up as a new download. The downloads can be managed in the same way as other user-initiated downloads are handled, and they go through the same state transitions.

To create a portal download automation, simply call:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/automations/portal_download -d '{
  "name": "AUTOMATION_NAME",
  "portal_subdomain": "PORTAL_SUBDOMAIN",
  "dst_folder": "DESTINATION_FOLDER",
  "effective_time": "2010-12-12T23:59:59-05:00",
  "enabled": true
}'

Where:

  • name is a custom automation name.
  • portal_subdomain is the subdomain of the portal from which uploaded packages will be automatically downloaded. The portal has to be owned by the team of the signed-in user.
  • dst_folder is the destination folder where all packages will be downloaded to.
  • effective_time is a string date/time in RFC333 format which indicates the start date/time after which uploaded packages will be downloaded. Setting it to a date/time in the past will cause the agent to download all packages uploaded after that point in the past until now, and subsequently, any future packages.
  • enabled indicates whether the automation will be enabled immediately or not

To update a portal download automation, call:

curl -X PUT -H "Content-Type: application/json" http://localhost:8080/api/v1/automations/portal_download/{automation_id} -d '{
  "name": "NEW_AUTOMATION_NAME",
  "enabled": false
}`

The following Portal Download automation fields can be updated:

  • name
  • portal_subdomain
  • dst_folder
  • effective_time
  • enabled

To delete a Portal Download automation, call:

curl -X DELETE http://localhost:8080/api/v1/automations/portal_download/{automation_id}

Watch Folder automations

A watch folder is a type of upload automation that uploads subfolders within the watched directory. After a timeout has passed without detecting any file modifications, the subfolder is sent as a package, delivered according to the type of upload automation.

Attention

Top level files in the watch folder will be ignored. Ensure that the files you want delivered are properly placed in their appropriate package subfolder.

There are two types of watch folder automations:

  • Send (Team): sends all subfolders within the watch folder to the configured recipient(s).
  • Portal Upload: sends all subfolders to the configured portal.

Send (Team) Automations

To create a Send automation, call:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/automations/team_upload -d '{
  "name":"send automation 1",
  "path":"/path/to/watch/folder",
  "timeout":5,
  "enabled":true,
  "team_id":"TEAM_ID",
  "recipient_emails":["[email protected]"]
}'

Where

  • name is the name of the automation, used for identification.
  • path is the directory to be watched. After the timeout window of inactivity, subfolders within this path will be sent as packages.
  • timeout is the filesystem inactivity timeout in minutes. If no changes are observed after this duration, the packages are sent.
  • enabled is the enabled/disabled state of the automation.
  • team_id is the TeamID from which to send the package(s).
  • recipient_emails is an array of emails to send the packages to.

Optional parameters can be provided when creating a Send automation, where

  • delete_files_after_upload is a boolean value, indicating whether or not to clean up the source package subfolder once the package upload has completed.
  • package_name_suffix is an optional suffix that is added as a suffix after the subfolder name, combining to form the name of the package(s).
  • message is an optional message that will be sent to recipients along with the package(s).
  • download_limit is an override for the team's maximum downloads available for the sent package(s)
  • delete_after: Integer value, specifying the number of days to keep the package(s) in storage.
  • download_password: Optional password that all downloaders must enter before being granted access to the package(s).

To update a Send automation, call:

curl -X PUT -H "Content-Type: application/json" http://localhost:8080/api/v1/automations/team_upload/{automation_id} -d '{
  "name":"send automation 2"
}'

The following Send automation fields can be updated:

  • name
  • message
  • timeout
  • delete_files_after_upload
  • package_name_suffix
  • enabled
  • team_id
  • recipient_emails
  • download_limit
  • delete_after
  • download_password

To delete a Send automation, call:

curl -X DELETE http://localhost:8080/api/v1/automations/team_upload/{automation_id}

Portal Upload Automations

To create a Portal Upload automation, call:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/automations/portal_upload -d '{
  "name":"portal upload automation 1",
  "path":"/path/to/watch/folder",
  "timeout":5,
  "enabled":true,
  "portal_subdomain":"PORTAL_SUBDOMAIN",
  "sender_email":"[email protected]"
}'

Where:

  • name is the name of the automation, used for identification.
  • path is the directory to be watched. After the timeout window of inactivity, subfolders within this path will be sent as packages.
  • timeout is the filesystem inactivity timeout in minutes. If no changes are observed after this duration, the packages are sent.
  • enabled is the enabled/disabled state of the automation.
  • portal_subdomain is the portal subdomain of the portal the package(s) will be sent to.
  • sender_email is the sender email that the recipient will see when they receive the package(s).

Optional parameters can be provided when creating a Portal Upload automation, where:

  • delete_files_after_upload is a boolean value indicating whether or not to clean up the source subfolder once the package upload has completed.
  • package_name_suffix is an optional suffix that is added as a suffix after the subfolder name, combining to form the name of the package(s).
  • portal_password is the password required to upload to the configured portal. If the portal requires no password, leave this blank.

To update a Portal Upload automation, call:

curl -X PUT -H "Content-Type: application/json" http://localhost:8080/api/v1/automations/portal_upload/{automation_id} -d '{
  "name":"portal upload automation 2"
}'

The following Portal Upload automation fields can be updated: - name - message - timeout - delete_files_after_upload - package_name_suffix - enabled - portal_subdomain - portal_password - sender_email

To delete a Portal Upload automation, call:

curl -X DELETE http://localhost:8080/api/v1/automations/portal_upload/{automation_id}