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

# List routines

> List routines.



## OpenAPI

````yaml /api-reference/openapi.json get /routines
openapi: 3.1.0
info:
  title: Dench API
  version: 1.0.0
  description: >-
    Versioned Dench workspace API. The operation registry is shared with the
    Dench CLI parity layer, so every CLI command maps to an endpoint here.
servers:
  - url: https://www.dench.com/api/v1
security: []
tags:
  - name: agent-config
    description: Agent Config operations.
  - name: approvals
    description: Approvals operations.
  - name: apps
    description: Apps operations.
  - name: auth
    description: Auth operations.
  - name: billing
    description: Billing operations.
  - name: browser
    description: Browser operations.
  - name: chat
    description: Chat operations.
  - name: crm
    description: Crm operations.
  - name: email
    description: Email operations.
  - name: files
    description: Files operations.
  - name: gateway
    description: Gateway operations.
  - name: local
    description: Local operations.
  - name: memory
    description: Memory operations.
  - name: meta
    description: Meta operations.
  - name: routines
    description: Routines operations.
  - name: workspace
    description: Workspace operations.
paths:
  /routines:
    get:
      tags:
        - routines
      summary: List routines
      description: List routines.
      operationId: cron_list
      parameters:
        - name: enabledOnly
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobs:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        description:
                          type: string
                        enabled:
                          type: boolean
                        deleteAfterRun:
                          type: boolean
                        createdAtMs:
                          type: number
                        updatedAtMs:
                          type: number
                        schedule:
                          anyOf:
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: every
                                everyMs:
                                  type: integer
                                  exclusiveMinimum: 0
                                  maximum: 9007199254740991
                                  description: Interval in milliseconds (1s to 365d).
                                anchorMs:
                                  description: >-
                                    Optional anchor timestamp for the recurring
                                    fire.
                                  type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                              required:
                                - kind
                                - everyMs
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: cron
                                expr:
                                  type: string
                                  description: 5-field POSIX cron expression.
                                tz:
                                  description: IANA timezone, e.g. America/New_York.
                                  type: string
                              required:
                                - kind
                                - expr
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: at
                                at:
                                  type: string
                                  description: ISO 8601 timestamp for a one-shot run.
                              required:
                                - kind
                                - at
                              additionalProperties: false
                          description: >-
                            Schedule: recurring (`every`), cron expression, or
                            one-shot (`at`).
                        sessionTarget:
                          type: string
                        wakeMode:
                          type: string
                        payload:
                          anyOf:
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: agentTurn
                                message:
                                  type: string
                              required:
                                - kind
                                - message
                              additionalProperties: false
                            - type: object
                              properties:
                                kind:
                                  type: string
                                  const: systemEvent
                                text:
                                  type: string
                              required:
                                - kind
                                - text
                              additionalProperties: false
                        state:
                          type: object
                          properties:
                            nextRunAtMs:
                              type: number
                            runningAtMs:
                              type: number
                            lastRunAtMs:
                              type: number
                            lastStatus:
                              type: string
                              enum:
                                - ok
                                - error
                                - skipped
                            lastError:
                              type: string
                            lastDurationMs:
                              type: number
                          additionalProperties: false
                      required:
                        - id
                        - name
                        - enabled
                        - deleteAfterRun
                        - createdAtMs
                        - updatedAtMs
                        - sessionTarget
                        - wakeMode
                        - payload
                        - state
                      additionalProperties: {}
                      description: A routine (cron trigger).
                  cronStatus:
                    type: object
                    properties:
                      enabled:
                        type: boolean
                      nextWakeAtMs:
                        anyOf:
                          - type: number
                          - type: 'null'
                    required:
                      - enabled
                      - nextWakeAtMs
                    additionalProperties: false
                required:
                  - jobs
                  - cronStatus
                additionalProperties: false
              example:
                jobs:
                  - id: trg_cron001
                    name: Daily digest
                    enabled: true
                    deleteAfterRun: false
                    createdAtMs: 1765526400000
                    updatedAtMs: 1765526400000
                    schedule:
                      kind: cron
                      expr: 0 9 * * *
                      tz: America/New_York
                    sessionTarget: isolated
                    wakeMode: now
                    payload:
                      kind: agentTurn
                      message: Summarize open CRM tasks.
                    state:
                      nextRunAtMs: 1765612800000
                      lastStatus: ok
                cronStatus:
                  enabled: true
                  nextWakeAtMs: 1765612800000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - DenchApiKey: []
        - AgentSession: []
components:
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Operation or resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
            details: {}
  securitySchemes:
    DenchApiKey:
      type: http
      scheme: bearer
      bearerFormat: DENCH_API_KEY
      description: >-
        Workspace-scoped Dench API key from workspace settings. This is the same
        key used by DENCH_API_KEY in sandboxes.
    AgentSession:
      type: http
      scheme: bearer
      bearerFormat: dch_agent_*
      description: >-
        Agent session token created by `dench signin`. Gateway-backed routes
        exchange this token for the workspace gateway key.

````