Ai Tasks
An AI Task defines a Files.com AI prompt that can run on a schedule or in response to file actions.
List Ai Tasks
Command
files-cli ai-tasks list
Output
Outputs a list of AiTask objects according to the output format.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Additional Arguments
Show Ai Task
Command
files-cli ai-tasks find
Output
Outputs a AiTask object according to the output format.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Ai Task ID. |
Create Ai Task
Command
files-cli ai-tasks create
Output
Outputs a AiTask object according to the output format.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Flags
| Flag | Default | Description |
|---|---|---|
| --description= string | AI Task description. | |
| --disabled boolean | false | If true, this AI Task will not run. |
| --holiday-region= string | Optional holiday region used by the AI Task schedule. | |
| --interval= string | If trigger is daily, this specifies how often to run the AI Task. | |
| --name= string Required | AI Task name. | |
| --path= string | "" | Path scope used for action-triggered AI Tasks. |
| --permission-set= string | "full" | Permissions used by the internal API key for this AI Task. Valid values are full and files_only.Possible values: full, files_only |
| --prompt= string Required | Prompt sent when this AI Task is invoked. | |
| --recurring-day= int64 | If trigger is daily, this selects the day number inside the chosen interval. | |
| --recurring-days= array(int64) | If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval. | |
| --schedule-id= int64 | If trigger is custom_schedule, the reusable Schedule used instead of the AI Task's schedule fields. | |
| --schedule-days-of-week= array(int64) | If trigger is custom_schedule, the 0-based weekdays used by the schedule. | |
| --schedule-time-zone= string | Time zone used by the AI Task schedule. | |
| --schedule-times-of-day= array(string) | Times of day in HH:MM format for the AI Task schedule. | |
| --source= string | "*" | Source glob used with path for action-triggered AI Tasks. |
| --trigger= string | "manual" | How this AI Task is triggered. Possible values: manual, daily, custom_schedule, action |
| --trigger-actions= array(string) | If trigger is action, the file action types that invoke this AI Task. Valid actions are create, copy, move, archived_delete, update, read, destroy. | |
| --workspace-id= int64 | 0 | Workspace ID. 0 means the default workspace. |
Manually Run AI Task
Command
files-cli ai-tasks manual-run
Output
No output is returned.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Ai Task ID. |
Update Ai Task
Command
files-cli ai-tasks update
Output
Outputs a AiTask object according to the output format.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Ai Task ID. |
| --description= string | AI Task description. |
| --disabled boolean | If true, this AI Task will not run. |
| --holiday-region= string | Optional holiday region used by the AI Task schedule. |
| --interval= string | If trigger is daily, this specifies how often to run the AI Task. |
| --name= string | AI Task name. |
| --path= string | Path scope used for action-triggered AI Tasks. |
| --permission-set= string | Permissions used by the internal API key for this AI Task. Valid values are full and files_only.Possible values: full, files_only |
| --prompt= string | Prompt sent when this AI Task is invoked. |
| --recurring-day= int64 | If trigger is daily, this selects the day number inside the chosen interval. |
| --recurring-days= array(int64) | If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval. |
| --schedule-id= int64 | If trigger is custom_schedule, the reusable Schedule used instead of the AI Task's schedule fields. |
| --schedule-days-of-week= array(int64) | If trigger is custom_schedule, the 0-based weekdays used by the schedule. |
| --schedule-time-zone= string | Time zone used by the AI Task schedule. |
| --schedule-times-of-day= array(string) | Times of day in HH:MM format for the AI Task schedule. |
| --source= string | Source glob used with path for action-triggered AI Tasks. |
| --trigger= string | How this AI Task is triggered. Possible values: manual, daily, custom_schedule, action |
| --trigger-actions= array(string) | If trigger is action, the file action types that invoke this AI Task. Valid actions are create, copy, move, archived_delete, update, read, destroy. |
| --workspace-id= int64 | Workspace ID. 0 means the default workspace. |
Delete Ai Task
Command
files-cli ai-tasks delete
Output
No output is returned.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Ai Task ID. |
The AiTask Object
Some of the commands above return a AiTask object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| id int64 | AI Task ID. |
| workspace_id int64 | Workspace ID. 0 means the default workspace. |
| name string | AI Task name. |
| description string | AI Task description. |
| prompt string | Prompt sent when this AI Task is invoked. |
| permission_set string | Permissions used by the internal API key for this AI Task. Valid values are full and files_only.Possible values: full, files_only |
| path string | Path scope used for action-triggered AI Tasks. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. |
| source string | Source glob used with path for action-triggered AI Tasks. |
| disabled boolean | If true, this AI Task will not run. |
| trigger string | How this AI Task is triggered. Possible values: manual, daily, custom_schedule, action |
| trigger_actions array(string) | If trigger is action, the file action types that invoke this AI Task. Valid actions are create, copy, move, archived_delete, update, read, destroy. |
| interval string | If trigger is daily, this specifies how often to run the AI Task. |
| recurring_day int64 | If trigger is daily, this selects the day number inside the chosen interval. |
| recurring_days array(int64) | If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval. |
| schedule_id int64 | If trigger is custom_schedule, the reusable Schedule used instead of the AI Task's schedule fields. |
| schedule_days_of_week array(int64) | If trigger is custom_schedule, the 0-based weekdays used by the schedule. |
| schedule_times_of_day array(string) | Times of day in HH:MM format for the AI Task schedule. |
| schedule_time_zone string | Time zone used by the AI Task schedule. |
| holiday_region string | Optional holiday region used by the AI Task schedule. |
| human_readable_schedule string | Human-readable schedule description. |
| last_run_at date-time | Most recent successful invocation time. |
| master_admin_user_id int64 | Master User ID used for AI Task invocations. |
| created_at date-time | Creation time. |
| updated_at date-time | Last update time. |