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

# Update schedule

> Change a schedule's cron, time zone, input, name or enabled flag.

Only the owner may change it; `nx1_crew_admin` may only disable
someone else's (`{"enabled": false}`).



## OpenAPI

````yaml patch /api/crew-schedules/{schedule_id}
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/crew-schedules/{schedule_id}:
    patch:
      tags:
        - Crew schedules
      summary: Update schedule
      description: |-
        Change a schedule's cron, time zone, input, name or enabled flag.

        Only the owner may change it; `nx1_crew_admin` may only disable
        someone else's (`{"enabled": false}`).
      operationId: update_schedule_api_crew_schedules__schedule_id__patch
      parameters:
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of the schedule.
            title: Schedule Id
          description: ID of the schedule.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrewScheduleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrewScheduleResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    CrewScheduleUpdate:
      properties:
        cron:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Cron
        timezone:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Timezone
        task_input:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Input
        name:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Name
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        run_as_identity_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Run As Identity Id
          description: >-
            Run as this service identity instead of as the owner. Unlike the
            other fields, null is not "keep": send null to run as the owner
            again, and omit the field to keep it as it is.
      type: object
      title: CrewScheduleUpdate
      description: Change a schedule. Omitted fields keep their value.
    CrewScheduleResponse:
      properties:
        id:
          type: string
          title: Id
        template_id:
          type: string
          title: Template Id
        template_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Name
          description: Null if the template can no longer be read.
        name:
          type: string
          title: Name
        owner_id:
          type: string
          title: Owner Id
          description: Username of the user the schedule belongs to.
        run_as_kind:
          type: string
          title: Run As Kind
          description: '`owner`: runs act as the owner. `identity`: as a service identity.'
          default: owner
        run_as:
          anyOf:
            - type: string
            - type: 'null'
          title: Run As
          description: >-
            Username its runs act as: the owner's, or the service identity's
            service account. Null if that identity no longer exists.
        run_as_identity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run As Identity Id
          description: The service identity it runs as, if any.
        cron:
          type: string
          title: Cron
        timezone:
          type: string
          title: Timezone
        task_input:
          additionalProperties: true
          type: object
          title: Task Input
        enabled:
          type: boolean
          title: Enabled
        next_run_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Run At
          description: Next slot (ISO 8601, UTC). Null while disabled.
        last_run_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run At
          description: When a slot last fired or was skipped (UTC).
        last_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run Id
          description: Crew-run id of the last run it started.
        last_run_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Run Status
          description: 'Status of that run: pending, running, completed or failed.'
        last_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error
          description: Why the last slot did not start a run.
        is_owner:
          type: boolean
          title: Is Owner
          description: Whether the caller owns this schedule.
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
      type: object
      required:
        - id
        - template_id
        - name
        - owner_id
        - cron
        - timezone
        - task_input
        - enabled
        - is_owner
        - created_at
        - updated_at
      title: CrewScheduleResponse
      description: A crew schedule with its last and next run.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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