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

# Update maintenance mode

> Turn maintenance mode on or off for an application and optionally set a custom maintenance page URL. While enabled, every request to every domain of the application gets the maintenance page with status 503 and a Retry-After header instead of reaching the application. There are no path, method or visitor exceptions, and IP restrictions still apply first. The application keeps running and deployments still work. The change is written to the edge synchronously but can take up to 5 minutes to reach every location. Returns the updated state.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json put /applications/{id}/maintenance-mode
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /applications/{id}/maintenance-mode:
    put:
      tags:
        - Applications
      summary: Update maintenance mode
      description: >-
        Turn maintenance mode on or off for an application and optionally set a
        custom maintenance page URL. While enabled, every request to every
        domain of the application gets the maintenance page with status 503 and
        a Retry-After header instead of reaching the application. There are no
        path, method or visitor exceptions, and IP restrictions still apply
        first. The application keeps running and deployments still work. The
        change is written to the edge synchronously but can take up to 5 minutes
        to reach every location. Returns the updated state.
      operationId: updateApplicationMaintenanceModeV3
      parameters:
        - schema:
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: id
          required: true
          description: Application identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_enabled:
                  type: boolean
                  description: >-
                    Whether maintenance mode should be active. When true, every
                    request to every domain of the application receives the
                    maintenance page with status 503. The application keeps
                    running and can still be deployed while in maintenance mode.
                  example: true
                page_url:
                  description: >-
                    HTTPS URL of a page to serve as the maintenance page, for
                    example a Sevalla static site. The edge fetches the page
                    body and serves it on every domain of the application with
                    status 503, so visitors never see this URL. When null the
                    default Sevalla maintenance page is served. Content changes
                    on the page take up to 60 seconds to show. Must start with
                    https:// and be at most 2048 characters. This is a full
                    replace: when omitted or null, any previously set page URL
                    is cleared and the default page is served.
                  example: https://status.example.com
                  anyOf:
                    - type: string
                      maxLength: 2048
                    - type: 'null'
              required:
                - is_enabled
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  is_enabled:
                    type: boolean
                    description: >-
                      Whether maintenance mode is currently active. When true,
                      every request to every domain of the application receives
                      the maintenance page with status 503 instead of reaching
                      the application.
                    example: false
                  page_url:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      HTTPS URL of a page to serve as the maintenance page, for
                      example a Sevalla static site. The edge fetches the page
                      body and serves it on every domain of the application with
                      status 503, so visitors never see this URL. When null the
                      default Sevalla maintenance page is served. Content
                      changes on the page take up to 60 seconds to show.
                    example: https://status.example.com
                required:
                  - is_enabled
                  - page_url
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Bad request
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 400
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Forbidden
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````