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

# Create or revision-conditionally update one resident schedule

> Create requires If-None-Match: *. Update requires the exact ETag in If-Match. Identical lost-response retries are unchanged and retain the revision.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/schedules/{id}
openapi: 3.1.0
info:
  description: >-
    Authenticated loopback remote execution and declarative schedules.
    Artifacts, schedule list/delete/trigger/backfill, /v1/arm, and POST /v1/run
    are absent.
  title: nika serve
  version: 0.116.2
servers:
  - url: http://127.0.0.1
security:
  - bearerAuth: []
paths:
  /v1/schedules/{id}:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          maxLength: 255
          minLength: 1
          type: string
    put:
      summary: Create or revision-conditionally update one resident schedule
      description: >-
        Create requires If-None-Match: *. Update requires the exact ETag in
        If-Match. Identical lost-response retries are unchanged and retain the
        revision.
      parameters:
        - $ref: '#/components/parameters/IfNoneMatch'
        - $ref: '#/components/parameters/IfMatch'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchedulePut'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleApply'
          description: Applied or unchanged
          headers:
            ETag:
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
        '412':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error envelope
components:
  parameters:
    IfNoneMatch:
      in: header
      name: If-None-Match
      required: false
      schema:
        const: '*'
        type: string
    IfMatch:
      in: header
      name: If-Match
      required: false
      schema:
        maxLength: 96
        type: string
  schemas:
    SchedulePut:
      additionalProperties: false
      properties:
        active:
          type: boolean
        afterSkip:
          enum:
            - next_slot
            - on_completion
          type: string
        jitter:
          enum:
            - hash
          type: string
        maxCostUsd:
          exclusiveMinimum: 0
          type: number
        maxLatenessSeconds:
          minimum: 0
          type: integer
        missed:
          enum:
            - catch-up
            - catch-up-once
            - skip
          type: string
        overlap:
          enum:
            - skip
            - queue
            - replace
          type: string
        pauseReason:
          maxLength: 1024
          type: string
        pauseUntil:
          format: date
          type: string
        tolerance:
          type: string
        when:
          oneOf:
            - additionalProperties: false
              properties:
                at:
                  format: date-time
                  type: string
                kind:
                  const: once
              required:
                - kind
                - at
              type: object
            - additionalProperties: false
              properties:
                expression:
                  maxLength: 4096
                  type: string
                kind:
                  const: cadence
              required:
                - kind
                - expression
              type: object
        workflow:
          maxLength: 1024
          pattern: ^[^/].*\.nika\.yaml$
          type: string
      required:
        - workflow
        - when
        - maxCostUsd
        - missed
      type: object
    ScheduleApply:
      additionalProperties: false
      properties:
        applied:
          const: true
          type: boolean
        changed:
          type: boolean
        status:
          $ref: '#/components/schemas/ScheduleStatus'
      required:
        - applied
        - changed
        - status
      type: object
    Error:
      additionalProperties: false
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
    ScheduleStatus:
      additionalProperties: true
      description: >-
        Normalized definition, origin, distinct schedule revision, active/pause
        state, due verdict, bounded next slots with shift evidence, earliest
        wake hint, and last durable decision.
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Exactly one Authorization: Bearer value from the token file'
      scheme: bearer
      type: http

````