---
title: "Backfill sessions for past schedule times"
method: POST
path: "/api/schedules/{id}/backfill"
tags: ["Schedule"]
---

# Backfill sessions for past schedule times

`POST /api/schedules/{id}/backfill`

## Path parameters

- `id` integer, required

## Request body

- RestScheduleBackfillRequest — Request body for backfill
  - `advanceSchedule` boolean — If true, advance nextScheduleTime/nextRunTime. When fromTime is not set, uses the current schedule's nextRunTime as starting point. Requires skipExisting to be true.
  - `attemptName` string — attempt name. Optional when skipExisting is true. Cannot be specified when advanceSchedule is true.
  - `count` integer — starts given number of sessions. run all sessions if not set.
  - `dryRun` boolean, required — dry run
  - `fromTime` string, date-time — backfill from
  - `skipExisting` boolean — If true, silently skip sessions that already have attempts instead of returning 409 conflict error. Note that when count is set, skipped sessions are still counted towards the count.

## Response `200`

default response

- RestScheduleAttemptCollection — Response of a schedule with its attempts
  - `attempts` RestSessionAttempt[], required — List of attempts
    - `cancelRequested` boolean, required — true if kill requested
    - `createdAt` string, date-time, required — created time
    - `done` boolean, required — true if the attempt finished
    - `finishedAt` string, date-time — finished time
    - `id` string, required — attempt ID
    - `index` integer, required — index for multiple attempts
    - `params` object, required — passed parameters as JSON
    - `poolId` string — ID of the pool to which this attempt is assigned.
    - `project` IdAndName, required — Name and ID
      - `id` string, required — ID
      - `name` string, required — name
    - `retryAttemptName` string, required — attempt name for retry
    - `sessionId` string, required — session ID
    - `sessionTime` string, required — session time
    - `sessionUuid` string, uuid, required — unique UUID of this session
    - `status` 'blocked' | 'queued' | 'running' | 'canceling' | 'success' | 'error' | 'killed', required — The current status of the attempt.
    - `success` boolean, required — true if the attempt finished successfully
    - `workflow` NameOptionalId, required — Name and optional ID
      - `id` string — ID
      - `name` string, required — name
  - `id` string, required — schedule ID
  - `project` IdAndName, required — Name and ID
    - `id` string, required — ID
    - `name` string, required — name
  - `workflow` IdAndName, required — Name and ID
    - `id` string, required — ID
    - `name` string, required — name

---

[API](https://skmtc.net/treasure/apis/treasure-workflow.md) · [All operations](https://skmtc.net/treasure/apis/treasure-workflow/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/treasure/treasure-workflow/revisions/4eedf1838ef4/schema)
