> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withgiga.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduled Audits

> Cron-based recurring audits for continuous coverage

# Scheduled Audits

Scheduled audits run on a cron schedule, provisioning a fresh sandbox and executing the configured audit type at each interval. See the [Scheduling guide](/scheduling) for cron syntax and use cases.

***

## Create a schedule

`POST /api/workspaces/{workspaceId}/scheduled-audits`

**Body**

```json theme={null}
{
  "name": "Weekly production scan",
  "auditType": "shallow",
  "cronExpression": "0 9 * * 1",
  "targets": ["acme.example.com"]
}
```

| Field            | Type   | Description                                          |
| ---------------- | ------ | ---------------------------------------------------- |
| `name`           | string | Display label                                        |
| `auditType`      | string | `shallow`, `deep`, or `autonomous`                   |
| `cronExpression` | string | Standard 5-field cron                                |
| `targets`        | array  | Target domains                                       |
| `scope`          | string | Required only for `autonomous` type — operator brief |

**Response (201)**

```json theme={null}
{
  "success": true,
  "data": {
    "schedule": {
      "id": "sched_abc123",
      "name": "Weekly production scan",
      "auditType": "shallow",
      "cronExpression": "0 9 * * 1",
      "isActive": true,
      "nextRunAt": "2026-05-25T09:00:00.000Z",
      "lastRunAt": null,
      "createdAt": "2026-05-18T12:00:00.000Z"
    }
  }
}
```

***

## List schedules

`GET /api/workspaces/{workspaceId}/scheduled-audits`

**Response (200)**

```json theme={null}
{
  "success": true,
  "data": {
    "schedules": [
      {
        "id": "sched_abc123",
        "name": "Weekly production scan",
        "auditType": "shallow",
        "cronExpression": "0 9 * * 1",
        "isActive": true,
        "nextRunAt": "2026-05-25T09:00:00.000Z",
        "lastRunAt": "2026-05-18T09:00:00.000Z"
      }
    ]
  }
}
```

***

## Get a schedule

`GET /api/workspaces/{workspaceId}/scheduled-audits/{scheduleId}`

**Response (200)**

```json theme={null}
{
  "success": true,
  "data": {
    "schedule": { ... }
  }
}
```

***

## Pause or resume a schedule

`PUT /api/workspaces/{workspaceId}/scheduled-audits/{scheduleId}`

**Body**

```json theme={null}
{
  "isActive": false
}
```

Paused schedules retain their config but skip executions until reactivated.

***

## Delete a schedule

`DELETE /api/workspaces/{workspaceId}/scheduled-audits/{scheduleId}`

**Response (200)**

```json theme={null}
{
  "success": true,
  "message": "Schedule deleted"
}
```

Deleting a schedule does not affect past audits triggered by it. Findings and reports remain in the workspace.

***

## Cron tips

| Expression     | Runs                                            |
| -------------- | ----------------------------------------------- |
| `0 */6 * * *`  | Every 6 hours                                   |
| `0 9 * * 1-5`  | Weekdays at 9 AM                                |
| `0 0 1 * *`    | First of the month at midnight                  |
| `*/30 * * * *` | Every 30 minutes (use with shallow audits only) |

<Warning>
  Schedules respect your plan's concurrency limit. If two schedules fire simultaneously and your limit is 1, the second will queue until the first completes or fail with `CONCURRENCY_LIMIT_EXCEEDED`.
</Warning>
