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

# Update Backup Schedule

> Sets when the server is backed up and how many backups are kept.



## OpenAPI

````yaml put /servers/{server}/backups/schedule
openapi: 3.1.0
info:
  title: APIFiddle Sample Definition
  version: 0.0.0
  description: Example workspace
servers:
  - url: https://rdp.sh/api/v1
    description: Default production endpoint.
security: []
paths:
  /servers/{server}/backups/schedule:
    put:
      summary: Update the backup schedule
      description: Sets when the server is backed up and how many backups are kept.
      operationId: updateServerBackupSchedule
      parameters:
        - $ref: '#/components/parameters/server'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - frequency
                - hour
                - retention
              properties:
                frequency:
                  type: string
                  enum:
                    - daily
                    - weekly
                hour:
                  type: integer
                  minimum: 0
                  maximum: 23
                  description: The hour the backup starts, in UTC.
                  examples:
                    - 3
                weekday:
                  type: integer
                  minimum: 0
                  maximum: 6
                  description: >-
                    Required for `weekly`, 0 = Sunday to 6 = Saturday. Ignored
                    for `daily`.
                  examples:
                    - 0
                retention:
                  type: integer
                  minimum: 1
                  description: >
                    How many backups to keep, at most the server's slots
                    (`slots.total`).

                    Once a new backup has completed, the oldest beyond this
                    number are deleted.
                  examples:
                    - 3
      responses:
        '200':
          content:
            application/json:
              schema:
                title: UpdateBackupScheduleOk
                allOf:
                  - type: object
                    properties:
                      status:
                        type: boolean
                        examples:
                          - true
                      message:
                        type: string
                        examples:
                          - Backup schedule updated.
                  - $ref: '#/components/schemas/backupSettings'
          description: The schedule was saved.
        '403':
          description: User does not own the server.
        '404':
          description: Server not found.
        '409':
          content:
            application/json:
              schema:
                type: object
                title: UpdateBackupScheduleConflict
                properties:
                  status:
                    type: boolean
                    examples:
                      - false
                  error:
                    type: string
                    examples:
                      - Enable backups before configuring the schedule.
          description: Backups are not enabled, or the server is suspended or busy.
        '422':
          description: |
            Validation error, for example a `retention` above the server's slots
            (`slots.total`) or a weekly schedule without `weekday`.
      security:
        - Authorization: []
components:
  parameters:
    server:
      in: path
      name: server
      schema:
        type: string
      required: true
  schemas:
    backupSettings:
      type: object
      required:
        - enabled
        - slots
      properties:
        enabled:
          type: boolean
          description: Whether backups are enabled for the server.
          examples:
            - true
        slots:
          type: object
          properties:
            total:
              type: integer
              description: How many backups the server can keep.
              examples:
                - 1
            free:
              type: integer
              description: How many of them are free of charge.
              examples:
                - 1
            paid:
              type: boolean
              description: Whether the paid slots are bought.
              examples:
                - false
            paid_total:
              type: integer
              description: How many backups the server can keep with the paid slots.
              examples:
                - 5
        schedule:
          description: When the server is backed up, or `null` while backups are disabled.
          oneOf:
            - type: object
              properties:
                frequency:
                  type: string
                  enum:
                    - daily
                    - weekly
                hour:
                  type: integer
                  description: The hour the backup starts, in UTC.
                  examples:
                    - 3
                weekday:
                  type:
                    - integer
                    - 'null'
                  description: 0 = Sunday to 6 = Saturday, for a weekly schedule.
                retention:
                  type: integer
                  description: How many backups are kept.
                  examples:
                    - 1
            - type: 'null'
      description: Whether a server's backups are enabled, its slots and its schedule.
  securitySchemes:
    Authorization:
      in: header
      name: Authorization
      type: apiKey
      description: |
        Your API key as it is, without `Bearer`. API access is off for new
        accounts: until it is turned on under Settings > API, every request
        answers `403` with `API access is turned off for this account. Turn it
        on under Settings > API.` If the account lists allowed IPs, a request
        from any other address answers `403` with `This API key is not allowed
        from <address>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.