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

# Toggle schedule

> Disable, enable, and manage schedules across tenants in your environment



## OpenAPI

````yaml put /tenants/{env_id}/schedule
openapi: 3.1.0
info:
  title: hotglue API
  version: '1.2'
servers:
  - url: https://api.hotglue.com
security:
  - sec0: []
paths:
  /tenants/{env_id}/schedule:
    put:
      summary: Toggle schedule
      description: Disable, enable, and manage schedules across tenants in your environment
      operationId: tenants-toggle-schedule
      parameters:
        - name: env_id
          in: path
          description: ID of environment
          schema:
            type: string
          required: true
        - name: mode
          in: query
          description: >-
            By default, the toggle endpoint only applies to tenants who already
            have (or had) schedules. Passing ?mode=upsert will apply schedules
            to tenants whether or not they currently have schedules
          schema:
            type: string
            enum:
              - upsert
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                toggle:
                  type: string
                  description: Used to toggle all schedules in this environment
                  enum:
                    - enable
                    - disable
                flows:
                  type: array
                  description: List of flow ids to apply this operation for
                  items:
                    type: string
                tenants:
                  type: array
                  description: List of tenants to apply this operation for
                  items:
                    type: string
                expression:
                  type: string
                  description: >-
                    Can be "default" to use the admin schedule or a cron
                    expression. Will be applied for all tenants
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    toggle: enabled
                    updated: 1
              schema:
                type: object
                properties:
                  toggle:
                    type: string
                    example: enable
                  updated:
                    type: integer
                    example: 1
                    default: 0
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: x-api-key

````