# Backfill sessions for past schedule times

Endpoint: POST /api/schedules/{id}/backfill
Version: 1.0
Security: ApiKeyAuth

## Path parameters:

  - `id` (integer, required)
    session id

## Request fields (application/json):

  - `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)
    backfill from
    Example: "2023-08-18T06:52:33Z"

  - `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 fields (application/json):

  - `attempts` (array, required)
    List of attempts

  - `attempts.cancelRequested` (boolean, required)
    true if kill requested

  - `attempts.createdAt` (string, required)
    created time
    Example: "2023-08-18T06:52:33Z"

  - `attempts.done` (boolean, required)
    true if the attempt finished

  - `attempts.finishedAt` (string)
    finished time
    Example: "2023-08-18T06:52:33Z"

  - `attempts.id` (string, required)
    attempt ID
    Example: "123456"

  - `attempts.index` (integer, required)
    index for multiple attempts
    Example: 1

  - `attempts.params` (object, required)
    passed parameters as JSON

  - `attempts.poolId` (string)
    ID of the pool to which this attempt is assigned.
    Example: "42"

  - `attempts.project` (object, required)
    Name and ID

  - `attempts.project.id` (string, required)
    ID
    Example: "123456"

  - `attempts.project.name` (string, required)
    name
    Example: "abcdefg"

  - `attempts.retryAttemptName` (string, required)
    attempt name for retry
    Example: "retry-12345"

  - `attempts.sessionId` (string, required)
    session ID
    Example: "123456"

  - `attempts.sessionTime` (string, required)
    session time
    Example: "2022-12-31T23:59:00+00:00"

  - `attempts.sessionUuid` (string, required)
    unique UUID of this session
    Example: "2b91a014-076e-4c6d-8b51-f4f91089cab2"

  - `attempts.status` (string, required)
    The current status of the attempt.
    Enum: "blocked", "queued", "running", "canceling", "success", "error", "killed"

  - `attempts.success` (boolean, required)
    true if the attempt finished successfully

  - `attempts.workflow` (object, required)
    Name and optional ID

  - `attempts.workflow.id` (string)
    ID
    Example: "123456"

  - `attempts.workflow.name` (string, required)
    name
    Example: "abcdefg"

  - `id` (string, required)
    schedule ID
    Example: "123456"

  - `project` (object, required)
    Name and ID

  - `workflow` (object, required)
    Name and ID


