---
title: "Site Scan Schedule"
method: PUT
path: "/api/3/sites/{id}/scan_schedules/{scheduleId}"
tags: ["Site"]
---

# Site Scan Schedule

`PUT /api/3/sites/{id}/scan_schedules/{scheduleId}`

Updates the specified scan schedule.

## Path parameters

- `id` integer, required — The identifier of the site.
- `scheduleId` integer, required — The identifier of the scan schedule.

## Request body

- ScanSchedule — Resource for a scan schedule.
  - `assets` ScheduledScanTargets — Allows one or more assets defined within the site to be scanned for this scan schedule. This property is only supported for static sites. When this property is `null`, or not defined in schedule, then all assets defined in the static site will be scanned.
    - `excludedAssetGroups` ExcludedAssetGroups — Assets associated with these asset groups will be excluded from the site's scan.
      - `assetGroupIDs` object[] — List of asset group identifiers. Each element is an integer.
      - `links` Link[], required — Hypermedia links to corresponding or related resources.
        - `deprecation` string
        - `href` string — A hypertext reference, which is either a URI (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>) or URI template (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc6570">RFC 6570</a>).
        - `hreflang` string
        - `media` string
        - `rel` string — The link relation type. This value is one from the <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc5988#section-6.2">Link Relation Type Registry</a> or is the type of resource being linked to.
        - `title` string
        - `type` string
    - `excludedTargets` ExcludedScanTargets — Addresses to be excluded from the site's scan. Each address is a string that can represent either a hostname, ipv4 address, ipv4 address range, ipv6 address, or CIDR notation.
      - `addresses` string[] — List of addresses. Each address is a string that can represent either a hostname, ipv4 address, ipv4 address range, ipv6 address, or CIDR notation.
      - `links` Link[], required — Hypermedia links to corresponding or related resources.
        - `deprecation` string
        - `href` string — A hypertext reference, which is either a URI (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>) or URI template (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc6570">RFC 6570</a>).
        - `hreflang` string
        - `media` string
        - `rel` string — The link relation type. This value is one from the <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc5988#section-6.2">Link Relation Type Registry</a> or is the type of resource being linked to.
        - `title` string
        - `type` string
    - `includedAssetGroups` SubsetIncludeScanAssetGroupsResource — Allows users to specify a subset of the site's included asset groups to be included in the scan. If the property is defined, then at least one valid already defined as an included asset group must be specified.
      - `assetGroupIDs` object[] — List of asset group identifiers. Each element is an integer.
      - `links` Link[], required — Hypermedia links to corresponding or related resources.
        - `deprecation` string
        - `href` string — A hypertext reference, which is either a URI (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>) or URI template (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc6570">RFC 6570</a>).
        - `hreflang` string
        - `media` string
        - `rel` string — The link relation type. This value is one from the <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc5988#section-6.2">Link Relation Type Registry</a> or is the type of resource being linked to.
        - `title` string
        - `type` string
    - `includedTargets` SubsetIncludeScanTargetsResource — Allows users to specify a subset of the site's scan targets to be included in the scan. If the property is defined, then at least one address must be specified.
      - `addresses` string[] — List of addresses. Each address is a string that can represent either a hostname, ipv4 address, ipv4 address range, ipv6 address, or CIDR notation.
      - `links` Link[], required — Hypermedia links to corresponding or related resources.
        - `deprecation` string
        - `href` string — A hypertext reference, which is either a URI (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>) or URI template (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc6570">RFC 6570</a>).
        - `hreflang` string
        - `media` string
        - `rel` string — The link relation type. This value is one from the <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc5988#section-6.2">Link Relation Type Registry</a> or is the type of resource being linked to.
        - `title` string
        - `type` string
  - `duration` string — Specifies the maximum duration the scheduled scan is allowed to run. Scheduled scans that do not complete within specified duration will be paused. The scan duration are represented by the format `"P[n]DT[n]H[n]M"`. In these representations, the [n] is replaced by a value for each of the date and time elements that follow the [n].The following table describes each supported value: | Value | Description | | ---------- | ---------------- | | P | The duration designator. It must be placed at the start of the duration representation. | | D | The day designator that follows the value for the number of days. | | T | The time designator that precedes the time portion of the representation. | | H | The hour designator that follows the value for the number of hours. | | M | The minute designator that follows the value for the number of minutes. | For example, `"P5DT10H30M"` represents a duration of "5 days, 10 hours, and 30 minutes". Each duration designator is optional; however, at least one must be specified and it must be preceded by the `"P"` designator.
  - `enabled` boolean, required — Flag indicating whether the scan schedule is enabled.
  - `id` object — The identifier of the scan schedule.
  - `links` Link[], required — Hypermedia links to corresponding or related resources.
    - `deprecation` string
    - `href` string — A hypertext reference, which is either a URI (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>) or URI template (see <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc6570">RFC 6570</a>).
    - `hreflang` string
    - `media` string
    - `rel` string — The link relation type. This value is one from the <a target="_blank" rel="noopener noreferrer" href="https://tools.ietf.org/html/rfc5988#section-6.2">Link Relation Type Registry</a> or is the type of resource being linked to.
    - `title` string
    - `type` string
  - `nextRuntimes` string[] — List the next 10 dates in the future the schedule will launch.
  - `onScanRepeat` 'restart-scan' | 'resume-scan', required — Specifies the desired behavior of a repeating scheduled scan when the previous scan was paused due to reaching is maximum duration. The following table describes each supported value: | Value | Description | | ---------- | ---------------- | | restart-scan | Stops the previously-paused scan and launches a new scan if the previous scan did not complete within the specified duration. If the previous scheduled scan was not paused, then a new scan is launched. | | resume-scan | Resumes the previously-paused scan if the previous scan did not complete within the specified duration. If the previous scheduled scan was not paused, then a new scan is launched. |
  - `repeat` Repeat — Settings for repeating a scheduled scan.
    - `dayOfWeek` 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' — The day of the week the scheduled task should repeat. This property only applies to schedules with a `every` value of `"day-of-month"`.
    - `every` 'hour' | 'day' | 'week' | 'date-of-month' | 'day-of-month', required — The frequency schedule repeats. Each value represents a different unit of time and is used in conjunction with the property `interval`. For example, a schedule can repeat hourly, daily, monthly, etc. The following table describes each supported value: | Value | Description | | ---------- | ---------------- | | hour | Specifies the schedule repeats in hourly increments. | | day | Specifies the schedule repeats in daily increments. | | week | Specifies the schedule repeats in weekly increments. | | date-of-month | Specifies the schedule repeats nth day of the `interval` month. Requires the property `dateOfMonth` to be specified. For example, if `dateOfMonth` is `17` and the `interval` is `2`, then the schedule will repeat every 2 months on the 17th day of the month. | | day-of-month | Specifies the schedule repeats on a monthly interval but instead of a specific date being specified, the day of the week and week of the month are specified. Requires the properties `dayOfWeek` and `weekOfMonth` to be specified. For example, if `dayOfWeek` is `"friday"`, `weekOfMonth` is `3`, and the `interval` is `4`, then the schedule will repeat every 4 months on the 3rd Friday of the month. |
    - `interval` integer, required — The interval time the schedule should repeat. The is depends on the value set in `every`. For example, if the value in property `every` is set to `"day"` and `interval` is set to `2`, then the schedule will repeat every 2 days.
    - `lastDayOfMonth` boolean — Whether to run the scheduled task on the last day of the month.
    - `weekOfMonth` integer — The week of the month the scheduled task should repeat. For This property only applies to schedules with a `every` value of `"day-of-month"`. Each week of the month is counted in 7-day increments. For example, week 1 consists of days 1-7 of the month while week 2 consists of days 8-14 of the month and so forth.
  - `scanEngineId` integer — The identifier of the scan engine to be used for this scan schedule. If not set, the site's assigned scan engine will be used.
  - `scanName` string — A user-defined name for the scan launched by the schedule. If not explicitly set in the schedule, the scan name will be generated prior to the scan launching. Scan names must be unique within the site's scan schedules.
  - `scanTemplateId` string — The identifier of the scan template to be used for this scan schedule. If not set, the site's assigned scan template will be used.
  - `start` string, date-time, required — The scheduled start date and time. Date is represented in ISO 8601 format. Repeating schedules will determine the next schedule to begin based on this date and time.

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error
- `503` — Service Unavailable

---

[API](https://skmtc.net/rapid7/apis/rapid7-vm-api.md) · [All operations](https://skmtc.net/rapid7/apis/rapid7-vm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rapid7/rapid7-vm-api/versions/3a8197c22d71/schema)
