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
SDK Method
aitask.List()
Return Object
[]*AiTask
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
SDK Method
aitask.Find()
Return Object
AiTask
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
AiTaskFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Ai Task ID. |
Create Ai Task
SDK Method
aitask.Create()
Return Object
AiTask
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
AiTaskCreateParams Fields
| Field | Default | Description |
|---|---|---|
| Description string | AI Task description. | |
| Disabled boolean | false | If true, this AI Task will not run. |
| HolidayRegion 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. |
| PermissionSet 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. | |
| RecurringDay int64 | If trigger is daily, this selects the day number inside the chosen interval. | |
| RecurringDays array(int64) | If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval. | |
| ScheduleId int64 | If trigger is custom_schedule, the reusable Schedule used instead of the AI Task's schedule fields. | |
| ScheduleDaysOfWeek array(int64) | If trigger is custom_schedule, the 0-based weekdays used by the schedule. | |
| ScheduleTimeZone string | Time zone used by the AI Task schedule. | |
| ScheduleTimesOfDay 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 |
| TriggerActions 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. | |
| WorkspaceId int64 | 0 | Workspace ID. 0 means the default workspace. |
Manually Run AI Task
SDK Method
aitask.ManualRun()
Return Object
No return value.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
AiTaskManualRunParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Ai Task ID. |
Update Ai Task
SDK Method
aitask.Update()
Return Object
AiTask
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
AiTaskUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Ai Task ID. |
| Description string | AI Task description. |
| Disabled boolean | If true, this AI Task will not run. |
| HolidayRegion 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. |
| PermissionSet 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. |
| RecurringDay int64 | If trigger is daily, this selects the day number inside the chosen interval. |
| RecurringDays array(int64) | If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval. |
| ScheduleId int64 | If trigger is custom_schedule, the reusable Schedule used instead of the AI Task's schedule fields. |
| ScheduleDaysOfWeek array(int64) | If trigger is custom_schedule, the 0-based weekdays used by the schedule. |
| ScheduleTimeZone string | Time zone used by the AI Task schedule. |
| ScheduleTimesOfDay 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 |
| TriggerActions 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. |
| WorkspaceId int64 | Workspace ID. 0 means the default workspace. |
Delete Ai Task
SDK Method
aitask.Delete()
Return Object
No return value.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
AiTaskDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Ai Task ID. |
The AiTask Object
Some of the methods above return a AiTask object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | AI Task ID. |
| WorkspaceId 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. |
| PermissionSet 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 |
| TriggerActions 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. |
| RecurringDay int64 | If trigger is daily, this selects the day number inside the chosen interval. |
| RecurringDays array(int64) | If trigger is daily, this selects one or more day numbers inside a week, month, quarter, or year interval. |
| ScheduleId int64 | If trigger is custom_schedule, the reusable Schedule used instead of the AI Task's schedule fields. |
| ScheduleDaysOfWeek array(int64) | If trigger is custom_schedule, the 0-based weekdays used by the schedule. |
| ScheduleTimesOfDay array(string) | Times of day in HH:MM format for the AI Task schedule. |
| ScheduleTimeZone string | Time zone used by the AI Task schedule. |
| HolidayRegion string | Optional holiday region used by the AI Task schedule. |
| HumanReadableSchedule string | Human-readable schedule description. |
| LastRunAt date-time | Most recent successful invocation time. |
| MasterAdminUserId int64 | Master User ID used for AI Task invocations. |
| CreatedAt date-time | Creation time. |
| UpdatedAt date-time | Last update time. |