---
title: "Get Scan Schedule"
method: POST
path: "/api/v2/scans/getSchedule"
tags: ["Scans"]
---

# Get Scan Schedule

`POST /api/v2/scans/getSchedule`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/scans/getSchedule`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Get the automated scan schedule for a repository. Returns the cron expression, timezone, and next scheduled run time.

## Request body

- ScanScheduleGetRequest: Input for getting the automated scan schedule for a repository
  - `organizationId` string: Organization ID that owns the repository. If omitted, resolved from the authenticated user.
  - `repositoryId` string, required: ID of the repository to get the scan schedule for.

## Response `200`

Scan schedule retrieved successfully (null if no schedule exists)

- ScanScheduleGetResponse: The automated scan schedule for a repository, or null if no schedule exists
  - `id` string, required: Unique identifier of the scan schedule
  - `executionCriteriaCrontab` string, required: Cron expression defining when scans run (e.g. "0 0 * * 1" for every Monday)
  - `scanBranch` string, nullable: Branch this schedule targets. Null means the repository default branch.
  - `repoId` string, required: ID of the repository this schedule belongs to
  - `createdAt` string, date-time, required: When the schedule was created
  - `updatedAt` string, date-time, required: When the schedule was last updated
  - `codeScans` string[]: IDs of code scans triggered by this schedule
  - `stagedCodeScans` string[]: IDs of staged code scans triggered by this schedule

## Other responses

- `401`: Error Response
- `404`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
