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

# List scheduled tasks

Every scheduled task in the deployment, most recently updated first, with its next run time. Needs access to the deployment; embed sessions get `403`.


## OpenAPI

````yaml /api-reference/api.yaml get /api/v1/deployments/{deploymentId}/scheduled-tasks
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:
    get:
      tags:
        - Scheduled Tasks
      summary: List scheduled tasks
      operationId: listScheduledTasks
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: integer
        - in: query
          name: after
          schema:
            oneOf:
              - type: string
              - type: 'null'
        - in: query
          name: first
          schema:
            oneOf:
              - minimum: 1
                type: integer
              - type: 'null'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledTaskListResponse'
          description: ''
components:
  schemas:
    ScheduledTaskListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ScheduledTaskResponse'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
      required:
        - items
        - pageInfo
      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
    PageInfo:
      properties:
        endCursor:
          oneOf:
            - type: string
            - type: 'null'
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          oneOf:
            - type: string
            - type: 'null'
      required:
        - hasNextPage
        - hasPreviousPage
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````