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

# Update scheduled run

> Update specific fields of an existing scheduled run.

Common use cases:
- Enable/disable a schedule: `{"enabled": false}`
- Change the schedule frequency: `{"schedule_expression": "rate(1 hour)"}`
- Update the run template: `{"run_template_id": "new_template_id"}`




## OpenAPI

````yaml /api-reference/v1/scheduled-runs-v1.yaml patch /scheduled-runs/{scheduled_run_id}
openapi: 3.0.3
info:
  title: Coval Scheduled Runs API
  version: 1.0.0
  description: >
    Create and manage scheduled runs for automated, recurring evaluations.


    Scheduled runs trigger run templates on a defined schedule using cron
    expressions

    or rate-based intervals. Use them for health checks, nightly regression
    tests,

    or any recurring evaluation workflow.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Scheduled Runs
    description: CRUD operations for scheduled evaluations
paths:
  /scheduled-runs/{scheduled_run_id}:
    patch:
      tags:
        - Scheduled Runs
      summary: Update scheduled run
      description: >
        Update specific fields of an existing scheduled run.


        Common use cases:

        - Enable/disable a schedule: `{"enabled": false}`

        - Change the schedule frequency: `{"schedule_expression": "rate(1
        hour)"}`

        - Update the run template: `{"run_template_id": "new_template_id"}`
      operationId: updateScheduledRun
      parameters:
        - name: scheduled_run_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9]{22}$
          description: Scheduled run resource ID
          example: xyz789uvw456rst123abcd
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduledRunRequest'
            examples:
              disable:
                $ref: '#/components/examples/UpdateScheduledRunDisable'
              changeSchedule:
                $ref: '#/components/examples/UpdateScheduledRunSchedule'
      responses:
        '200':
          description: Scheduled run updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateScheduledRunResponse'
              examples:
                updated:
                  $ref: '#/components/examples/ScheduledRunUpdated'
        '400':
          description: Invalid request body or validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Scheduled run not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  $ref: '#/components/examples/ScheduledRunNotFoundError'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateScheduledRunRequest:
      type: object
      description: >-
        Partial update request (PATCH semantics - only provided fields are
        updated)
      properties:
        display_name:
          type: string
          minLength: 1
          maxLength: 200
          description: Human-readable schedule name
          example: Updated Schedule Name
        run_template_id:
          type: string
          pattern: ^[A-Za-z0-9]{22}$
          description: Run template to execute
          example: abc123def456ghi789jklm
        schedule_expression:
          type: string
          maxLength: 200
          description: Schedule expression in rate or cron format
          example: rate(1 hour)
        schedule_timezone:
          type: string
          maxLength: 100
          description: IANA timezone for cron expressions
          example: UTC
        enabled:
          type: boolean
          description: Enable or disable the schedule
          example: false
    UpdateScheduledRunResponse:
      type: object
      required:
        - scheduled_run
      properties:
        scheduled_run:
          $ref: '#/components/schemas/ScheduledRunResource'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - NOT_FOUND
                - CONFLICT
                - INTERNAL
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameter
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                    description: Field that caused the error
                    example: schedule_expression
                  description:
                    type: string
                    description: Detailed error description
                    example: Must be 'rate(...)' or 'cron(...)' format
    ScheduledRunResource:
      type: object
      description: Scheduled run configuration resource.
      required:
        - name
        - id
        - display_name
        - run_template_id
        - schedule_expression
        - enabled
        - create_time
      properties:
        name:
          type: string
          description: 'Resource name: "scheduled-runs/{id}"'
          example: scheduled-runs/xyz789uvw456rst123abcd
        id:
          type: string
          pattern: ^[A-Za-z0-9]{22}$
          description: Scheduled run resource ID
          example: xyz789uvw456rst123abcd
        display_name:
          type: string
          maxLength: 200
          description: Human-readable schedule name
          example: Voice Agent Health Check
        run_template_id:
          type: string
          pattern: ^[A-Za-z0-9]{22}$
          description: Associated run template
          example: abc123def456ghi789jklm
        schedule_expression:
          type: string
          description: >
            Schedule expression in rate or cron format.


            **Rate format**: `rate(value unit)` where unit is minutes, hours, or
            days

            - `rate(15 minutes)` - Every 15 minutes

            - `rate(1 hour)` - Every hour

            - `rate(1 day)` - Daily


            **Cron format**: `cron(minutes hours day-of-month month day-of-week
            year)`

            - `cron(0 9 ? * MON-FRI *)` - 9am weekdays

            - `cron(0 2 ? * * *)` - 2am daily

            - `cron(0 0 1 * ? *)` - Midnight on 1st of month
          example: rate(15 minutes)
        schedule_timezone:
          type: string
          default: UTC
          description: IANA timezone for cron expressions
          example: America/New_York
        enabled:
          type: boolean
          default: true
          description: Whether the schedule is active
          example: true
        last_run_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the most recent execution
          example: '2025-10-15T14:15:00Z'
        last_run_id:
          type: string
          nullable: true
          description: ID of the most recent run created by this schedule
          example: 8EktrIgaVxn9LfxkIynagX
        create_time:
          type: string
          format: date-time
          description: Creation timestamp (ISO 8601)
          example: '2025-10-14T12:00:00Z'
        update_time:
          type: string
          format: date-time
          nullable: true
          description: Last update timestamp (ISO 8601)
          example: '2025-10-15T14:30:00Z'
  examples:
    UpdateScheduledRunDisable:
      summary: Disable a schedule
      value:
        enabled: false
    UpdateScheduledRunSchedule:
      summary: Change schedule frequency
      value:
        schedule_expression: rate(1 hour)
        display_name: Hourly Health Check
    ScheduledRunUpdated:
      summary: Scheduled run updated successfully
      value:
        scheduled_run:
          name: scheduled-runs/xyz789uvw456rst123abcd
          id: xyz789uvw456rst123abcd
          display_name: Hourly Health Check
          run_template_id: abc123def456ghi789jklm
          schedule_expression: rate(1 hour)
          schedule_timezone: UTC
          enabled: true
          last_run_at: '2025-10-15T14:15:00Z'
          last_run_id: 8EktrIgaVxn9LfxkIynagX
          create_time: '2025-10-14T12:00:00Z'
          update_time: '2025-10-15T15:00:00Z'
    ScheduledRunNotFoundError:
      summary: Scheduled run not found
      value:
        error:
          code: NOT_FOUND
          message: Scheduled run not found
          details:
            - field: scheduled_run_id
              description: Scheduled run not found or not accessible by your organization
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````