---
title: "Create Sandbox Schedule"
method: POST
path: "/sandboxes/{sandboxName}/schedules"
tags: ["compute"]
---

# Create Sandbox Schedule

`POST /sandboxes/{sandboxName}/schedules`

## Request

- Base URL: `https://api.blaxel.ai/v0`
- URL: `https://api.blaxel.ai/v0/sandboxes/{sandboxName}/schedules`
- Auth: one of:
  - OAuth 2
    - Authorization code: `/oauth/authorize`
    - Client credentials
    - Token URL: `/oauth/token` scopes: `sandboxes:create`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/blaxel/apis/blaxel-control-plane/docs/sandboxes/:sandboxName/schedules/post.ts> (a function with typed inputs; its response is checked against the schema)

Adds a schedule to a Sandbox.

## Request body

- SandboxScheduleEntry: A scheduled task that executes a process inside the sandbox at specified times. Stored in the dedicated schedules table (no longer embedded in the sandbox spec).
  - `createdAt` string: Creation timestamp (read-only).
  - `id` string: Unique identifier for this schedule within its sandbox. Auto-generated if not provided.
  - `input` SandboxScheduleInput: Process execution configuration for a scheduled sandbox task
    - `command` string: Shell command to execute inside the sandbox
    - `env` object: Environment variables to set for the process. May contain secrets, so values are encrypted at rest and masked in API responses unless an admin requests show_secrets=true.
    - `keepAlive` boolean: Keep the sandbox alive (disable scale-to-zero) while the process runs. Defaults to true.
    - `name` string: Optional name for the process (used to retrieve status/logs)
    - `timeout` integer: Timeout in seconds for the process. Defaults to 600 (10 minutes). Set to 0 for no timeout.
    - `workingDir` string: Working directory for the command
  - `maxExecutions` integer: Maximum number of execution records kept for this schedule. Once reached, recording a new execution deletes the oldest. Defaults to 100.
  - `type` 'cron' | 'at' | 'sleep': Type of schedule timing. 'cron' for recurring (5-field expression), 'at' for a specific RFC 3339 datetime, 'sleep' for a duration from now (resolved to 'at' on creation).
  - `value` string: Timing value. For 'cron': a 5-field cron expression (e.g. '0 8 * * 1-5'). For 'at': an RFC 3339 datetime (e.g. '2026-07-01T09:00:00Z'). For 'sleep': a duration (e.g. '2h', '30m', '7d').

## Response `200`

successful operation

- SandboxScheduleEntry: A scheduled task that executes a process inside the sandbox at specified times. Stored in the dedicated schedules table (no longer embedded in the sandbox spec).
  - `createdAt` string: Creation timestamp (read-only).
  - `id` string: Unique identifier for this schedule within its sandbox. Auto-generated if not provided.
  - `input` SandboxScheduleInput: Process execution configuration for a scheduled sandbox task
    - `command` string: Shell command to execute inside the sandbox
    - `env` object: Environment variables to set for the process. May contain secrets, so values are encrypted at rest and masked in API responses unless an admin requests show_secrets=true.
    - `keepAlive` boolean: Keep the sandbox alive (disable scale-to-zero) while the process runs. Defaults to true.
    - `name` string: Optional name for the process (used to retrieve status/logs)
    - `timeout` integer: Timeout in seconds for the process. Defaults to 600 (10 minutes). Set to 0 for no timeout.
    - `workingDir` string: Working directory for the command
  - `maxExecutions` integer: Maximum number of execution records kept for this schedule. Once reached, recording a new execution deletes the oldest. Defaults to 100.
  - `type` 'cron' | 'at' | 'sleep': Type of schedule timing. 'cron' for recurring (5-field expression), 'at' for a specific RFC 3339 datetime, 'sleep' for a duration from now (resolved to 'at' on creation).
  - `value` string: Timing value. For 'cron': a 5-field cron expression (e.g. '0 8 * * 1-5'). For 'at': an RFC 3339 datetime (e.g. '2026-07-01T09:00:00Z'). For 'sleep': a duration (e.g. '2h', '30m', '7d').

---

[API](https://skmtc.dev/blaxel/apis/blaxel-control-plane.md) - [All operations](https://skmtc.dev/blaxel/apis/blaxel-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/blaxel/apis/blaxel-control-plane/revisions/dfa264bc72ee?raw)
