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

# Update a scheduled job

> Partial update. Changing `cron_expression` re-times the backing schedule; toggling `enabled` pauses/unpauses it; other fields update the record only. `definition_id` is immutable. Cross-tenant access returns 404.



## OpenAPI

````yaml /openapi.json patch /scheduled-jobs/{sched_id}
openapi: 3.1.0
info:
  title: GetDialed Flows API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/flows
    description: Production
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /scheduled-jobs/{sched_id}:
    patch:
      tags:
        - scheduled-jobs
      summary: Update a scheduled job
      description: >-
        Partial update. Changing `cron_expression` re-times the backing
        schedule; toggling `enabled` pauses/unpauses it; other fields update the
        record only. `definition_id` is immutable. Cross-tenant access returns
        404.
      operationId: patch_scheduled_job_scheduled_jobs__sched_id__patch
      parameters:
        - name: sched_id
          in: path
          required: true
          schema:
            type: string
            title: Sched Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledJobUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledJobResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '403':
          description: Admin role required
          content:
            application/json:
              example:
                detail: Admin role required
        '404':
          description: Not found — also returned on cross-tenant access (never 403)
          content:
            application/json:
              example:
                detail: Scheduled job not found
        '422':
          description: Validation error (see body for field details)
          content:
            application/json:
              example:
                detail: Validation error
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          content:
            application/json:
              example:
                detail: Rate limit exceeded
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    ScheduledJobUpdate:
      properties:
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        input_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Data
        description:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Description
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      additionalProperties: false
      type: object
      title: ScheduledJobUpdate
      description: |-
        PATCH /scheduled-jobs/{id} body — partial-update semantics per D-06.

        Router uses `body.model_dump(exclude_unset=True)`; only fields the
        caller explicitly set are forwarded to the repository.
    ScheduledJobResponse:
      properties:
        id:
          type: string
          title: Id
        definition_id:
          type: string
          title: Definition Id
        org_id:
          type: string
          title: Org Id
        description:
          type: string
          title: Description
        cron_expression:
          type: string
          title: Cron Expression
        enabled:
          type: boolean
          title: Enabled
        input_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Data
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        next_fire_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Fire At
        last_fired_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Fired At
        last_fire_status:
          anyOf:
            - type: string
              enum:
                - success
                - failure
                - running
            - type: 'null'
          title: Last Fire Status
      type: object
      required:
        - id
        - definition_id
        - org_id
        - description
        - cron_expression
        - enabled
        - input_data
        - metadata
        - created_at
        - updated_at
        - next_fire_at
        - last_fired_at
        - last_fire_status
      title: ScheduledJobResponse
      description: >-
        GET response — `next_fire_at` is injected by the router via croniter
        (D-14).


        `next_fire_at` is None only for legacy rows whose stored cron cannot

        produce a next fire (CR-02 defense in depth) — the write gate rejects

        such expressions for all new/updated records.
      example:
        created_at: '2026-07-09T09:00:00Z'
        cron_expression: 0 9 * * 1-5
        definition_id: def_a1b2c3d4
        description: Nightly Five9 report sync
        enabled: true
        id: sched_1a2b3c4d
        input_data:
          report: daily_calls
        metadata:
          owner: ops
        next_fire_at: '2026-07-10T09:00:00Z'
        org_id: org_e5f6g7h8
        updated_at: '2026-07-09T09:00:00Z'
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````