> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-refresh-key-renewal-threshold-comment.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a scheduled task

Changes the fields sent; `cronExpression: null` makes the task Manual. Only the creator or an admin may do this (`403` otherwise). A cron fires at most hourly (`400` otherwise), and a user can have 20 active tasks (`409` past that).


## OpenAPI

````yaml /api-reference/api.yaml put /api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Databricks Metric View Publication
  - name: Databricks Metric View Integration
  - name: Folders
  - name: Reports
  - name: External Documents
  - name: Workbooks
  - name: Workbook Promotions
  - name: Dashboard Exports
  - name: Notifications
  - name: Scheduled Tasks
  - name: Workspace
  - name: Users
  - name: Users Admin
  - name: API Keys
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
  - name: Usage Analytics
  - name: OpenAPI Spec
paths:
  /api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}:
    put:
      tags:
        - Scheduled Tasks
      summary: Update a scheduled task
      operationId: updateScheduledTask
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: integer
        - in: path
          name: taskId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduledTaskInput'
        description: UpdateScheduledTaskInput
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledTaskResponse'
          description: ''
components:
  schemas:
    UpdateScheduledTaskInput:
      properties:
        agentId:
          oneOf:
            - type: integer
            - type: 'null'
          description: >-
            The agent that runs the task. Omit to leave unchanged; null resets
            it to the deployment default.
        cronExpression:
          oneOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: >-
            New standard 5-field cron, at most hourly (the minute field is a
            single number). Omit it to keep the current schedule; send null to
            make the task Manual.
        description:
          oneOf:
            - type: string
            - type: 'null'
          description: Omit to leave unchanged. Send null to clear the description.
        isEnabled:
          oneOf:
            - type: boolean
            - type: 'null'
          description: >-
            `false` pauses the schedule, `true` resumes it. Omit to leave
            unchanged. Explicit null answers `400`.
        name:
          oneOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          description: Omit to leave unchanged. Explicit null answers `400`.
        prompt:
          oneOf:
            - minLength: 1
              type: string
            - type: 'null'
          description: >-
            New prompt, shown as the task's Instructions in Cube. Omit to leave
            unchanged. Explicit null answers `400`.
        timezone:
          oneOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: >-
            New IANA time zone for the cron, e.g. `America/New_York`. Omit it to
            keep the current one. Explicit null answers `400`.
      type: object
    ScheduledTaskResponse:
      properties:
        agentId:
          oneOf:
            - type: integer
            - type: 'null'
          description: The agent that runs the task; null runs the deployment default.
        cronExpression:
          oneOf:
            - type: string
            - type: 'null'
          description: >-
            Standard 5-field cron (minute hour day-of-month month day-of-week),
            e.g. `0 9 * * 1-5` for 9:00 on weekdays. Null when the task is
            Manual: it runs only when started with `POST
            /scheduled-tasks/{taskId}/run`.
        deploymentId:
          type: integer
        description:
          oneOf:
            - type: string
            - type: 'null'
        id:
          type: integer
        isEnabled:
          description: False while the schedule is paused.
          type: boolean
        name:
          type: string
        nextRunAt:
          oneOf:
            - type: string
            - type: 'null'
          description: >-
            When the schedule next fires (ISO 8601, UTC); null for a Manual or
            paused task.
        prompt:
          description: >-
            What the agent is asked on every run, shown as the task's
            Instructions in Cube. Each run starts a new chat thread, so the
            prompt has to stand on its own.
          type: string
        timezone:
          description: >-
            IANA time zone the cron is read in, e.g. `America/New_York`.
            Defaults to `UTC`.
          type: string
        userId:
          description: >-
            The creator. Every run executes as this user, and only they or an
            admin may change, delete or run the task.
          type: integer
      required:
        - id
        - deploymentId
        - name
        - prompt
        - timezone
        - isEnabled
        - userId
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````