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

# Pause or resume a job schedule



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/job-schedule/{schedule_id}/pause
openapi: 3.1.0
info:
  title: Bonya Compute REST API
  version: 0.1.0
  description: >
    Public REST and WebSocket surface on TApi behind Caddy. Non-2xx responses
    are RFC 9457 application/problem+json with a stable machine-readable code.
    WebSocket endpoints are HTTP GET upgrades; their options travel in the START
    frame, never in query strings.
servers:
  - url: https://api.bonya.ai
    description: Production
security:
  - personalApiKey: []
  - supabaseJwt: []
tags:
  - name: Sandboxes
    description: Create, look up, list, pause, fork, snapshot, and delete sandboxes.
  - name: Snapshots
    description: Named point-in-time copies of a sandbox that new sandboxes can start from.
  - name: Templates
    description: Saved, versioned launch configurations for sandboxes.
  - name: Registry Connections
    description: Credentials for pulling private container images.
  - name: Secrets
    description: Write-only secrets and secret sets injected into sandboxes and jobs.
  - name: Previews
    description: Expose a sandbox port as an HTTPS URL.
  - name: Exec
    description: Run a command in a sandbox, buffered or over a TTY.
  - name: Sessions
    description: Named, persistent command sessions that outlive a connection.
  - name: Filesystem
    description: Read, write, and manage files inside a sandbox.
  - name: Jobs
    description: Managed, tracked runs of a command or script.
  - name: Job Schedules
    description: Cron, interval, or one-shot timing wrapped around a job.
  - name: Organizations
    description: Organization membership, administration and usage reporting.
  - name: Invitations
    description: Invite members to an organization and accept invitations.
  - name: API Keys
    description: Personal API key management.
  - name: Device Login
    description: Browser-based login for the CLI.
paths:
  /v1/job-schedule/{schedule_id}/pause:
    post:
      tags:
        - Job Schedules
      summary: Pause or resume a job schedule
      operationId: setJobSchedulePaused
      parameters:
        - $ref: '#/components/parameters/ScheduleID'
        - $ref: '#/components/parameters/OrganizationHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - paused
              properties:
                paused:
                  type: boolean
                note:
                  type: string
      responses:
        '200':
          description: Pause state updated
          content:
            application/json:
              schema:
                type: object
                required:
                  - schedule
                properties:
                  schedule:
                    $ref: '#/components/schemas/JobSchedule'
        default:
          $ref: '#/components/responses/Problem'
components:
  parameters:
    ScheduleID:
      name: schedule_id
      in: path
      required: true
      schema:
        type: string
    OrganizationHeader:
      name: X-Bonya-Organization-ID
      in: header
      required: false
      schema:
        type: string
      description: >
        Org context. Omitted means the caller's personal organization. A
        well-formed non-member org is 404; malformed is 400.
  schemas:
    JobSchedule:
      type: object
      required:
        - schedule_id
        - paused
        - one_shot
        - available_actions
      properties:
        schedule_id:
          type: string
        schedule:
          type: object
          properties:
            cron_expressions:
              type: array
              items:
                type: string
            interval_s:
              type: integer
            run_at_unix_nanos:
              type: integer
            time_zone:
              type: string
            jitter_s:
              type: integer
            overlap:
              type: string
              enum:
                - skip
                - buffer_one
                - allow_all
        job:
          $ref: '#/components/schemas/JobRequest'
        paused:
          type: boolean
        note:
          type: string
        next_run_at_unix_nanos:
          type: integer
        one_shot:
          type: boolean
          description: True when this schedule fires exactly once (run_at_unix_nanos).
        remaining_actions:
          type: integer
          description: Present for one-shot schedules; 0 once spent.
        available_actions:
          type: array
          items:
            type: string
            enum:
              - pause
              - resume
              - trigger
              - update
              - delete
        created_at_unix_nanos:
          type: integer
          description: >-
            When this schedule was created. This deployment keeps no schedule
            state of its own; this is exactly what the workflow engine reports.
        updated_at_unix_nanos:
          type: integer
          description: When this schedule was last paused, resumed, or edited.
        num_actions:
          type: integer
          description: How many times this schedule has fired, including manual triggers.
        num_actions_skipped_overlap:
          type: integer
          description: >-
            Fires dropped because the previous run was still going. Relevant
            when overlap is skip, the default.
        num_actions_missed_catchup_window:
          type: integer
          description: >-
            Fires dropped because the server was down or behind past its catchup
            window. A schedule that looks paused but is not may show up here
            instead.
        recent_run_ids:
          type: array
          items:
            type: string
          description: >-
            The last 10 fires' run ids, oldest first, including manual triggers.
            Each is a valid GET /v1/job/{run_id} id, so a caller can follow one
            without a separate GET /v1/job?schedule_id=... call.
        running_run_ids:
          type: array
          items:
            type: string
          description: >-
            Which of this schedule's own fires are in flight right now.
            Non-empty only under an overlap policy that allows more than one run
            at a time; skip, the default, keeps this to at most one.
    JobRequest:
      type: object
      description: >-
        Exactly one of existing_sandbox_id and new_sandbox is required. Exactly
        one of command and script is required.
      properties:
        name:
          type: string
          description: Optional human-readable name for this job.
        existing_sandbox_id:
          type: string
        new_sandbox:
          $ref: '#/components/schemas/JobNewSandboxSpec'
        command:
          type: array
          items:
            type: string
        script:
          $ref: '#/components/schemas/JobScriptSpec'
        pre_run_script:
          allOf:
            - $ref: '#/components/schemas/JobScriptSpec'
          description: >-
            Optional script executed after the sandbox is ready and before the
            job command or script. A non-zero exit stops the job.
        env:
          type: object
          additionalProperties:
            type: string
        secret_sets:
          type: array
          items:
            type: string
          description: Secret set names (see /v1/secret-sets).
        working_dir:
          type: string
        stdin_b64:
          type: string
          contentEncoding: base64
        command_timeout_seconds:
          type: integer
          minimum: 1
        run_deadline_seconds:
          type: integer
          minimum: 1
        disposition:
          type: string
          enum:
            - delete
            - keep
          default: delete
          description: >-
            What happens to a sandbox this run created when the run ends,
            however it ends. Not meaningful for an existing sandbox.
        wake_if_paused:
          type: boolean
          default: false
          description: >-
            Applies to an existing sandbox only. False makes a paused target a
            failure rather than an implicit wake, which is a billable action the
            caller may not have intended.
        wait:
          type: boolean
          default: false
          description: >-
            false starts durably and returns immediately (202); true blocks for
            the result, bounded by the caller's own request timeout (200).
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - code
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        code:
          type: string
        detail:
          type: string
    JobNewSandboxSpec:
      type: object
      properties:
        template_id:
          type: string
          description: Omit to use the deployment's configured default template.
        template_revision:
          type: integer
        snapshot:
          type: string
        image:
          type: string
        name:
          type: string
        network:
          $ref: '#/components/schemas/NetworkPolicy'
        env:
          type: object
          additionalProperties:
            type: string
        secret_sets:
          type: array
          items:
            type: string
    JobScriptSpec:
      type: object
      required:
        - body
      description: >-
        A script the user wrote or uploaded. The body travels inline and is
        capped; a script larger than the cap is a program, and a program belongs
        in the template or fetched by the script itself.
      properties:
        body:
          type: string
          description: The script source text.
        interpreter:
          type: string
          default: sh
        args:
          type: array
          items:
            type: string
        filename:
          type: string
    NetworkPolicy:
      type: object
      additionalProperties: false
      required:
        - mode
      properties:
        mode:
          type: string
          enum:
            - open
            - allowlist
            - airgap
          default: open
          description: >-
            open is unrestricted egress; allowlist allows only the listed
            destinations; airgap has no network.
        allow:
          type: array
          maxItems: 64
          items:
            $ref: '#/components/schemas/NetworkRule'
      allOf:
        - if:
            properties:
              mode:
                const: allowlist
          then:
            required:
              - allow
            properties:
              allow:
                minItems: 1
          else:
            properties:
              allow:
                maxItems: 0
    NetworkRule:
      type: object
      additionalProperties: false
      description: Exactly one of domain or cidr. Per-rule ports are not supported yet.
      properties:
        domain:
          type: string
          description: A DNS name such as pypi.org or *.pythonhosted.org.
        cidr:
          type: string
  responses:
    Problem:
      description: RFC 9457 problem
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    personalApiKey:
      type: http
      scheme: bearer
      description: >-
        Personal byk_ API key; user-principal, resolved to a tenant by org
        context.
    supabaseJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Supabase-issued session JWT; required for org, invite, and key
        management.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.