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

# Patch a schedule

> Updates a schedule's mutable fields. `action_id` and `sync_params` cannot be changed. A schedule with different parameters is a different schedule, so create a new one and delete this.



## OpenAPI

````yaml patch /v2/data_sync/schedules/{id}
openapi: 3.1.0
info:
  title: StackOne
  description: The documentation for the StackOne API
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.stackone.com
security: []
tags:
  - name: Accounts
    description: View and manage linked accounts.
  - name: Connector Profiles
    description: View and manage connector profiles for the project.
  - name: Connectors
    description: Retrieve metadata for connectors.
  - name: Webhooks
    description: Configure and manage webhooks.
  - name: Data Sync
    description: View data-sync configs, schedules, and runs.
paths:
  /v2/data_sync/schedules/{id}:
    patch:
      tags:
        - Data Sync
      summary: Patch a schedule
      description: >-
        Updates a schedule's mutable fields. `action_id` and `sync_params`
        cannot be changed. A schedule with different parameters is a different
        schedule, so create a new one and delete this.
      operationId: patch_schedule
      parameters:
        - name: id
          required: true
          in: path
          description: The unique identifier of the schedule.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchScheduleDto'
      responses:
        '200':
          description: The schedule was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleResource'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '408':
          description: The request has timed out.
          headers:
            Retry-After:
              description: A time in seconds after which the request can be retried.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTimedOutResponse'
        '409':
          description: Conflict with current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Server error while executing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
        '501':
          description: This functionality is not implemented.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotImplementedResponse'
        '502':
          description: Bad gateway error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadGatewayResponse'
      security:
        - basic: []
components:
  schemas:
    PatchScheduleDto:
      type: object
      properties:
        name:
          type: string
          description: A human-readable name for the schedule.
          nullable: true
        enabled:
          type: boolean
          description: Whether the schedule is active.
          nullable: true
        cadence:
          type: string
          description: >-
            How often the sync fires. ISO 8601 duration (e.g. `PT1H`). Accepted
            only when the schedule's `source` is `manual`; on a fanned-out
            schedule its sync config owns this and supplying it returns `400`.
          nullable: true
        full_sync_after:
          type: string
          nullable: true
          description: >-
            The point after which an incremental sync falls back to a full sync.
            ISO 8601 duration; `null` clears it, omit to leave it unchanged.
            Accepted only when the schedule's `source` is `manual`; on a
            fanned-out schedule its sync config owns this and supplying it
            returns `400`.
        start_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the schedule should next fire; `null` clears it, omit to leave
            it unchanged. Accepted only when the schedule's `source` is
            `manual`; on a fanned-out schedule its sync config owns this and
            supplying it returns `400`.
    ScheduleResource:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the schedule.
        sync_config_id:
          type: string
          description: >-
            The sync config that bounds this schedule. Set on every schedule,
            hand-authored ones included — it is what permits the action to sync
            at all. Use `source` to tell how a schedule came to exist; `null`
            here means only that the schedule predates the field.
          nullable: true
        account_id:
          type: string
          description: The linked account this schedule syncs.
        action_id:
          type: string
          description: The action this schedule runs.
        name:
          type: string
          description: The human-readable name of the schedule.
        sync_params:
          allOf:
            - $ref: '#/components/schemas/SyncParamsResource'
          description: The parameters the action is called with on each run.
        params_hash:
          type: string
          description: >-
            A hash of `sync_params`, distinguishing schedules for the same
            action.
        source:
          type: string
          enum:
            - auto_link
            - manual
            - unmapped_value
            - null
          description: >-
            How the schedule came to exist: `auto_link` if its sync config
            fanned it out, `manual` if it was hand-authored. This is the
            discriminator between the two, not `sync_config_id`. It also decides
            which fields are patchable: an `auto_link` schedule takes `cadence`,
            `start_at` and `full_sync_after` from its sync config.
          x-speakeasy-unknown-values: allow
          nullable: true
        enabled:
          type: boolean
          description: Whether the schedule is currently active.
        cadence:
          type: string
          description: >-
            How often the sync fires. ISO 8601 duration. Owned by the sync
            config on `auto_link` schedules — patching it there is rejected.
        full_sync_after:
          type: string
          description: >-
            The point after which an incremental sync falls back to a full sync.
            ISO 8601 duration; `null` when unset. Owned by the sync config on
            `auto_link` schedules — patching it there is rejected.
          nullable: true
        start_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the schedule was first scheduled to fire; `null` when unset.
            Owned by the sync config on `auto_link` schedules — patching it
            there is rejected.
        next_run_at:
          type: string
          format: date-time
          nullable: true
          description: When the schedule will next fire; `null` when unset.
        last_run_at:
          type: string
          format: date-time
          nullable: true
          description: When the schedule last ran; `null` before its first run.
        last_run_status:
          type: string
          description: The status of the most recent run; `null` before its first run.
          nullable: true
        last_run_error:
          type: string
          description: The error message from the most recent run, if it failed.
          nullable: true
        paused_reason:
          type: string
          description: >-
            Why the schedule is not currently running even though `enabled` may
            be true. `sync_config_disabled` while its sync config is disabled or
            has been removed, `action_disabled` while the action is switched off
            on the connector profile, `auto_link_disabled` while `auto_link` is
            off on a schedule that `auto_link` created (hand-authored schedules
            are unaffected by it), or an account-lifecycle reason such as the
            linked account being disabled. Only the widest cause currently
            holding the schedule back is reported, so clearing it may reveal
            another. The schedule keeps its own `enabled` value throughout.
            `null` means nothing is holding it back.
          nullable: true
        created_at:
          type: string
          format: date-time
          description: When the schedule was created.
        updated_at:
          type: string
          format: date-time
          description: When the schedule was last updated.
      required:
        - id
        - account_id
        - action_id
        - name
        - sync_params
        - params_hash
        - enabled
        - cadence
        - created_at
        - updated_at
    BadRequestResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Error message
          example: Bad Request
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
        data:
          description: Error details
          nullable: true
          allOf:
            - $ref: '#/components/schemas/UnifiedError'
        provider_errors:
          description: List of provider-specific errors
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/ProviderError'
      required:
        - statusCode
        - message
        - timestamp
    UnauthorizedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 401
        message:
          type: string
          description: Error message
          example: Unauthorized
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ForbiddenResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 403
        message:
          type: string
          description: Error message
          example: Forbidden resource
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotFoundResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 404
        message:
          type: string
          description: Error message
          example: Not Found
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    RequestTimedOutResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 408
        message:
          type: string
          description: Error message
          example: Request timed out
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ConflictResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 409
        message:
          type: string
          description: Error message
          example: Conflict
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    UnprocessableEntityResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 422
        message:
          type: string
          description: Error message
          example: Unprocessable Entity
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    TooManyRequestsResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 429
        message:
          type: string
          description: Error message
          example: Too many requests
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 500
        message:
          type: string
          description: Error message
          example: Internal server error
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotImplementedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 501
        message:
          type: string
          description: Error message
          example: Not Implemented
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    BadGatewayResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 502
        message:
          type: string
          description: Error message
          example: Bad Gateway
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    SyncParamsResource:
      type: object
      properties:
        path:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
                items: {}
              - type: object
                additionalProperties: true
          description: Path parameters, keyed by parameter name.
          nullable: true
        query:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
                items: {}
              - type: object
                additionalProperties: true
          description: Query-string parameters, keyed by parameter name.
          nullable: true
        body:
          type: object
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
                items: {}
              - type: object
                additionalProperties: true
          description: Request-body parameters, keyed by parameter name.
          nullable: true
        headers:
          type: object
          additionalProperties:
            type: string
          description: Request headers, keyed by header name. Values are always strings.
          nullable: true
    UnifiedError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
          nullable: true
        message:
          type: string
          description: Error message
          example: Bad Request
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    ProviderError:
      type: object
      properties:
        status:
          type: number
          description: HTTP status code of the provider error
          example: 400
          nullable: true
        url:
          type: string
          description: URL that caused the error
          example: https://api.provider.com/v1/resource
          nullable: true
        raw:
          type: object
          description: Raw error response from the provider
          example:
            message: Invalid input parameters
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
  securitySchemes:
    basic:
      type: http
      scheme: basic

````