Scheduled Exports

A Scheduled Export defines a recurring schedule for generating one of the built-in CSV exports and e-mailing it to a Site Admin recipient.

List Scheduled Exports

SDK Method

Files::ScheduledExport.list

Return Object

List<ScheduledExport>

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Additional Arguments

Example Request

begin
  scheduled_exports = Files::ScheduledExport.list
  scheduled_exports.auto_paging_each do |scheduled_export|
    # Operate on scheduled_export
  end
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Show Scheduled Export

SDK Method

Files::ScheduledExport.find

Return Object

ScheduledExport

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Method Arguments

ArgumentDescription
id
int64
Required
Scheduled Export ID.

Example Request

begin
  scheduled_export = Files::ScheduledExport.find(id)
  # Operate on scheduled_export
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Create Scheduled Export

SDK Method

Files::ScheduledExport.create

Return Object

ScheduledExport

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Method Arguments

ArgumentDefaultDescription
name
string
Required
Name for this scheduled export.
export_type
string
Required
Export report type. Valid values: folder_size_audit, group_membership_audit, permission_audit, share_link_audit
export_options
object
Options for the report selected by export_type.
user_id
int64
Site Admin user who receives the completed export e-mail.
disabled
boolean
falseIf true, this scheduled export will not run.
trigger
string
"daily"Schedule trigger type: daily or custom_schedule.
Possible values: daily, custom_schedule
interval
string
If trigger is daily, this specifies how often to run the scheduled export.
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 scheduled export'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 scheduled export schedule.
schedule_time_zone
string
Time zone used by the scheduled export schedule.
holiday_region
string
Optional holiday region used by the scheduled export schedule.

Example Request

begin
  scheduled_export = Files::ScheduledExport.create(
    name: "Monthly access review",
    export_type: "permission_audit"
  )
  # Operate on scheduled_export
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Update Scheduled Export

SDK Method

scheduled_export.update

Return Object

ScheduledExport

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Method Arguments

ArgumentDescription
name
string
Name for this scheduled export.
export_type
string
Export report type. Valid values: folder_size_audit, group_membership_audit, permission_audit, share_link_audit
export_options
object
Options for the report selected by export_type.
user_id
int64
Site Admin user who receives the completed export e-mail.
disabled
boolean
If true, this scheduled export will not run.
trigger
string
Schedule trigger type: daily or custom_schedule.
Possible values: daily, custom_schedule
interval
string
If trigger is daily, this specifies how often to run the scheduled export.
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 scheduled export'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 scheduled export schedule.
schedule_time_zone
string
Time zone used by the scheduled export schedule.
holiday_region
string
Optional holiday region used by the scheduled export schedule.

Example Request

begin
  # Find the scheduled_export object by its id.
  scheduled_export = Files::ScheduledExport.find(id)
  scheduled_export.update(
    name: "Monthly access review"
  )
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Delete Scheduled Export

SDK Method

scheduled_export.delete

Return Object

nil

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator.

Example Request

begin
  # Find the scheduled_export object by its id.
  scheduled_export = Files::ScheduledExport.find(id)
  scheduled_export.delete
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

The ScheduledExport Object

Some of the methods above return a ScheduledExport object. The attributes of this object are listed below.

AttributeDescription
id
int64
Scheduled Export ID
name
string
Name for this scheduled export.
export_type
string
Export report type. Valid values: folder_size_audit, group_membership_audit, permission_audit, share_link_audit
report_name
string
Human-readable report name.
export_options
object
Options for the report selected by export_type.
user_id
int64
Site Admin user who receives the completed export e-mail.
disabled
boolean
If true, this scheduled export will not run.
trigger
string
Schedule trigger type: daily or custom_schedule.
Possible values: daily, custom_schedule
interval
string
If trigger is daily, this specifies how often to run the scheduled export.
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 scheduled export'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 scheduled export schedule.
schedule_time_zone
string
Time zone used by the scheduled export schedule.
holiday_region
string
Optional holiday region used by the scheduled export schedule.
human_readable_schedule
string
Human-readable schedule description.
last_run_at
date-time
Most recent scheduled attempt time, including attempts that failed validation.
last_export_id
int64
Most recent Export ID created by this schedule.
last_error
string
Validation error from the most recent scheduled attempt. The schedule remains enabled and retries at its next scheduled time. Cleared when an export is successfully created; does not describe errors during export generation.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.

export_options

Options for the report selected by export_type. Each field names the report that uses it. share_link_audit and group_membership_audit have no options. Other keys are stored but not used.

Value Hash ParameterDescription
path
string
folder_size_audit only. Folder to start from. Omitted or null uses the root folder.
max_depth
integer
folder_size_audit only. Number of folder levels below path to include. Null or a value below 1 uses 10. A numeric string such as "50" is also accepted and stored as sent.
size_threshold
integer
folder_size_audit only. Minimum folder size to include, in GB. Null or a value below 1 uses 1. A numeric string such as "50" is also accepted and stored as sent.
all_folders
boolean
folder_size_audit only. If enabled, every folder up to max_depth is included regardless of size_threshold. Use true or false. Any value other than false or null enables it, including integers such as 0 and 1.
group_by
string
permission_audit only. Groups rows by user or path. Null and other values use user.

Example export_options

{
  "group_by": "user"
}