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

# Update Schedule

> Update an existing scheduled balance request

# Update Schedule

Modify the scheduling parameters of an existing scheduled balance request. You can update the interval, time of day, or expiration date.

## Use Cases

* Change how frequently balance checks run (e.g., from weekly to daily)
* Adjust the time of day when scheduled checks execute
* Extend or shorten the schedule's expiration date

## Request Fields

All fields are optional, but at least one must be provided.

| Field           | Description                                                                                                                                   |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`          | Update the schedule name. Must be unique. Max 255 characters                                                                                  |
| `interval_days` | Update how often the schedule runs (1-30 days)                                                                                                |
| `time_of_day`   | Update the time to run in HH:mm format (24-hour, UTC). Example: "14:30" for 2:30 PM UTC                                                       |
| `expires_at`    | Update the schedule expiration date. A final job runs at this time, after which no more jobs will run. Must be in the future. ISO 8601 format |

## Response Fields

| Field         | Description                                                                       |
| ------------- | --------------------------------------------------------------------------------- |
| `schedule_id` | The unique identifier for the schedule                                            |
| `name`        | The name of the schedule, if one was provided                                     |
| `message`     | Confirmation message indicating the update was successful                         |
| `expires_at`  | The updated expiration date for the schedule                                      |
| `next_run_at` | The next scheduled run time. May be null if the schedule is disabled or completed |

## Important Notes

* The schedule must be in **ACTIVE** status to be updated
* At least one update field must be provided in the request
* The `expires_at` value must be a future timestamp
* If you provide a `name` that already exists for another schedule, a **409 Conflict** error is returned


## OpenAPI

````yaml PATCH /v1/monitoring/schedules/{id}
openapi: 3.1.0
info:
  title: Rightfoot API
  description: >-
    Submit a batch of authorizers for balance checks, retrieve processed
    balances, and check the status of a batch.
  version: 0.3.0-alpha
servers:
  - url: https://api.rightfoot.com
security:
  - BearerAuth: []
tags:
  - name: General Availability
    description: |
      **General Availability** indicates that the endpoint is production-ready.
  - name: Early Access
    description: >
      **Early Access** indicates that the endpoint is available for early access
      customers and is being actively refined.
  - name: In Development
    description: >
      **In Development** indicates that the endpoint is currently being built
      and will be available in an upcoming release.
paths:
  /v1/monitoring/schedules/{id}:
    patch:
      tags:
        - General Availability
      summary: Update a schedule
      description: >
        Update an existing scheduled balance request. You can modify the
        schedule interval, time of day, or expiration date.


        **Note:** At least one field must be provided. The schedule must be in
        ACTIVE status to be updated.
      operationId: update_schedule
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
          description: >-
            The schedule ID (UUID) returned when creating the scheduled balance
            request.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 255
                  description: >-
                    Update the schedule name. Must be unique. Max 255
                    characters.
                interval_days:
                  type: integer
                  minimum: 1
                  maximum: 30
                  description: Update the schedule to run every N days (1-30).
                time_of_day:
                  type: string
                  description: >-
                    Update the time of day to run in HH:mm format (24-hour,
                    UTC).
                expires_at:
                  type: string
                  format: date-time
                  description: Update the schedule expiration date. Must be in the future.
            example:
              name: Weekly Balance Check
              interval_days: 7
              time_of_day: '14:30'
      responses:
        '200':
          description: Schedule updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  schedule_id:
                    type: string
                    format: uuid
                    description: Unique identifier for the schedule.
                  name:
                    type: string
                    description: The name of the schedule.
                  message:
                    type: string
                    description: Confirmation message.
                  expires_at:
                    type: string
                    format: date-time
                    description: ISO 8601 timestamp when the schedule will expire.
                  next_run_at:
                    type: string
                    format: date-time
                    description: ISO 8601 timestamp of the next scheduled run.
              example:
                schedule_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                name: Weekly Balance Check
                message: Schedule updated successfully
                expires_at: '2025-03-15T00:00:00Z'
                next_run_at: '2024-12-19T14:30:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              example:
                status: error
                status_code: 400
                error:
                  code: BAD_REQUEST
                  message: At least one update field must be provided.
                  timestamp: '2024-12-12T12:00:00Z'
                  suggestion: Provide interval_days, time_of_day, or expires_at.
                documentation_url: https://api.rightfoot.com/docs
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
              examples:
                schedule_not_active:
                  summary: Schedule not active
                  value:
                    status: error
                    status_code: 409
                    error:
                      code: CONFLICT
                      message: Schedule is not in ACTIVE status.
                      timestamp: '2024-12-12T12:00:00Z'
                      suggestion: Only active schedules can be updated.
                    documentation_url: https://api.rightfoot.com/docs
                duplicate_name:
                  summary: Duplicate schedule name
                  value:
                    status: error
                    status_code: 409
                    error:
                      code: CONFLICT
                      message: Schedule name already exists.
                      timestamp: '2024-12-12T12:00:00Z'
                      suggestion: >-
                        A schedule with this name already exists. Please use a
                        different name.
                    documentation_url: https://api.rightfoot.com/docs
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    ApiErrorResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of the error, either "error" or "success"
        status_code:
          type: integer
          description: HTTP status code of the error
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code (e.g., "RESOURCE_NOT_FOUND")
            message:
              type: string
              description: Detailed error message.
            details:
              type: string
              description: Additional details about the error
            timestamp:
              type: string
              format: date-time
              description: Time the error occurred
            suggestion:
              type: string
              description: Suggested action to resolve the error
        documentation_url:
          type: string
          format: uri
          description: URL to the documentation for the error
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: error
            status_code: 401
            error:
              code: UNAUTHORIZED
              message: Invalid API key provided.
              timestamp: '2024-09-16T12:01:00Z'
              suggestion: Please check your API key.
            documentation_url: https://api.rightfoot.com/docs
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: error
            status_code: 404
            error:
              code: NOT_FOUND
              message: The specified batch ID does not exist.
              timestamp: '2024-09-16T12:09:00Z'
              suggestion: Please check the batch ID.
            documentation_url: https://api.rightfoot.com/docs
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            status: error
            status_code: 500
            error:
              code: INTERNAL_SERVER_ERROR
              message: An unexpected error occurred while retrieving the balances.
              timestamp: '2024-09-16T12:11:00Z'
              suggestion: >-
                Please try again later. If the problem persists, contact our
                support team.
            documentation_url: https://api.rightfoot.com/docs
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Authentication to the API is performed via Bearer Token Authentication.
        Provide your API key as the bearer token in the Authorization header.


        All API requests must be made over HTTPS. Calls made over plain HTTP
        will fail. API requests without authentication will also fail.

````