POST Reports ID Schedules

The POST /Reports/{id}/Schedules method is used to create a schedule for the built-in report with the specified report ID. This method returns HTTP 200 OK on a success with the details of the report schedule.

Tip:  The following permissions (see Security Overview) are required to use this feature:

Reports: Modify

Table 429: POST Reports {id} Schedules Input Parameters

Name

In

Description

id

Path

Required. The Keyfactor Command reference ID of the built-in report the schedule is associated with.

Use the GET /Reports method (see GET Reports) to retrieve a list of your built-in reports to determine the report ID to use.

SendReport

Body A Boolean indicating whether the report will be sent to the email recipients configured in EmailRecipients (true) or not (false). The default is false.
SaveReport Body A Boolean indicating whether the report will be saved to the UNC path defined by SaveReportPath (true) or not (false). The default is false.
SaveReportPath Body

Required*. A string containing the UNC path to which the report will be written, if configured.

Note:  The path for saved reports must be provided in UNC format (\\servername\sharename\path) and must be accessible from the Keyfactor Command administration server. In addition:
  • Do not use a trailing "\" in the report path.
  • Ensure that the application pool service account has permission to write to the location where you want the outputted report to be saved.
  • When scheduling a report, schedule it for at least 10 minutes in advance of the current time if you wish it to run soon. If you want to run it faster than that, the Keyfactor Command Service will need to be restarted.

This field is required if SaveReport is set to true.

ReportFormat Body

Required. A string containing the report format selected for the scheduled report run. Supported values vary depending on the selected report and include:

  • PDF

  • Excel

  • CSV

KeyfactorSchedule Body

Required. An array providing the schedule for the report. ClosedShow Keyfactor schedule details.

For example:

"KeyfactorSchedule": {
   "Monthly": {
      "Day": 1,
      "Time": "2021-07-01T17:00:00Z"
   }
},

Or:

"KeyfactorSchedule": {
   "Weekly": {
      "Days": [
         "Monday",
         "Thursday"
      ],
      "Time": "2021-07-01T17:00:00Z"
   }
},
EmailRecipients Body

Required*. An array containing the email addresses of users configured as recipients of the scheduled report, if any. For example:

"EmailRecipients": [
   "pkiadmins@keyexample.com",
   "john.smith@keyexample.com"
]

This field is required if SendReport is set to true.

RuntimeParameters Body

Required*. Any array containing the parameters to be used at run time configured in the report schedule. Runtime parameters will vary depending on the report selected. ClosedShow runtime parameter details.

For example:

"RuntimeParameters": {
   "StartDate": "60-Day-Before",
   "EndDate": "7-Day-Before",
   "Metadata": "AppOwnerFirstName, AppOwnerLastName",
   "Requesters": "jsmith"
}

This field is required for reports that have runtime parameters.

Table 430: POST Reports {id} Schedules Response Data

Name

Description

Id

The Keyfactor Command reference ID of the report schedule.

SendReport

A Boolean indicating whether the report will be sent to the email recipients configured in EmailRecipients (true) or not (false).
SaveReport A Boolean indicating whether the report will be saved to the UNC path defined by SaveReportPath (true) or not (false).
SaveReportPath

A string containing the UNC path to which the report will be written, if configured.

ReportFormat

A string containing the report format selected for the scheduled report run. Supported values vary depending on the selected report and include:

  • PDF

  • Excel

  • CSV

KeyfactorSchedule

An array providing the schedule for the report. ClosedShow Keyfactor schedule details.

EmailRecipients

An array containing the email addresses of users configured as recipients of the scheduled report, if any.

RuntimeParameters

Any array containing the parameters to be used at run time configured in the report schedule. Runtime parameters will vary depending on the report selected. ClosedShow runtime parameter details.