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

# Publish a shift template

> Publish a shift template



## OpenAPI

````yaml /api-reference/openapi.json post /api/shifts/{id}/publish
openapi: 3.1.0
info:
  title: ontime API
  description: APIs for ontime.v2
  version: 1.0.0
servers:
  - url: https://app.ontime.hosai.app
    description: Production
security:
  - apiKey: []
paths:
  /api/shifts/{id}/publish:
    post:
      tags:
        - Shifts
      summary: Publish a shift template
      description: Publish a shift template
      operationId: postApiShiftsByIdPublish
      parameters:
        - in: path
          name: id
          schema:
            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)$
          required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    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)$
                  orgId:
                    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)$
                  code:
                    type: string
                    enum:
                      - G
                      - M
                      - E
                      - 'N'
                      - F
                  category:
                    type: string
                    enum:
                      - G
                      - M
                      - E
                      - 'N'
                      - F
                      - FL
                  sku:
                    anyOf:
                      - type: string
                      - type: 'null'
                  name:
                    type: string
                  type:
                    type: string
                    enum:
                      - fixed
                      - flexible
                      - rotational
                      - field
                      - custom
                  status:
                    type: string
                    enum:
                      - draft
                      - published
                  tags:
                    type: array
                    items:
                      type: string
                  allLocations:
                    type: boolean
                  locationIds:
                    type: array
                    items:
                      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)$
                  effectiveFrom:
                    anyOf:
                      - type: string
                      - type: 'null'
                  startTime:
                    type: string
                  endTime:
                    type: string
                  workingHours:
                    type: number
                  unpaidBreakMinutes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  breakWindowStart:
                    anyOf:
                      - type: string
                      - type: 'null'
                  breakWindowEnd:
                    anyOf:
                      - type: string
                      - type: 'null'
                  gracePeriodMinutes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  halfDayCutoffHours:
                    type: number
                  weeklyOff:
                    type: array
                    items:
                      type: string
                  autoCheckoutAfter:
                    anyOf:
                      - type: string
                      - type: 'null'
                  otEligibleAfterMinutes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  otCapPerDayMinutes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  otMultiplierWeekday:
                    type: number
                    exclusiveMinimum: 0
                    maximum: 10
                  otMultiplierHolidayOff:
                    type: number
                    exclusiveMinimum: 0
                    maximum: 10
                  otApprovalThresholdMinutes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  workingDays:
                    anyOf:
                      - type: object
                        properties:
                          mon:
                            type: boolean
                          tue:
                            type: boolean
                          wed:
                            type: boolean
                          thu:
                            type: boolean
                          fri:
                            type: boolean
                          sat:
                            type: boolean
                          sun:
                            type: boolean
                          secondSatOff:
                            type: boolean
                          fourthSatOff:
                            type: boolean
                          restrictedHolidays:
                            type: boolean
                        required:
                          - mon
                          - tue
                          - wed
                          - thu
                          - fri
                          - sat
                          - sun
                          - secondSatOff
                          - fourthSatOff
                          - restrictedHolidays
                      - type: 'null'
                  punchSources:
                    anyOf:
                      - type: object
                        properties:
                          biometricOffice:
                            type: object
                            properties:
                              enabled:
                                type: boolean
                              hint:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - enabled
                              - hint
                          mobileGpsSelfie:
                            type: object
                            properties:
                              enabled:
                                type: boolean
                              hint:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - enabled
                              - hint
                          mobileOtpFallback:
                            type: object
                            properties:
                              enabled:
                                type: boolean
                              hint:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - enabled
                              - hint
                          webWfh:
                            type: object
                            properties:
                              enabled:
                                type: boolean
                              hint:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - enabled
                              - hint
                          qrKiosk:
                            type: object
                            properties:
                              enabled:
                                type: boolean
                              hint:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - enabled
                              - hint
                          managerMarked:
                            type: object
                            properties:
                              enabled:
                                type: boolean
                              hint:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - enabled
                              - hint
                        required:
                          - biometricOffice
                          - mobileGpsSelfie
                          - mobileOtpFallback
                          - webWfh
                          - qrKiosk
                          - managerMarked
                      - type: 'null'
                  lateDeduction:
                    anyOf:
                      - type: object
                        properties:
                          mode:
                            type: string
                            enum:
                              - none
                              - afterNLates
                          afterCount:
                            anyOf:
                              - type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              - type: 'null'
                          fraction:
                            anyOf:
                              - type: number
                              - type: 'null'
                        required:
                          - mode
                          - afterCount
                          - fraction
                      - type: 'null'
                  notifications:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          enum:
                            - fiveMinBefore
                            - lateBy10
                            - missedPunchOut
                            - otTriggered
                        label:
                          type: string
                        channelTarget:
                          type: string
                      required:
                        - key
                        - label
                        - channelTarget
                required:
                  - id
                  - orgId
                  - code
                  - category
                  - sku
                  - name
                  - type
                  - status
                  - tags
                  - allLocations
                  - locationIds
                  - effectiveFrom
                  - startTime
                  - endTime
                  - workingHours
                  - unpaidBreakMinutes
                  - breakWindowStart
                  - breakWindowEnd
                  - gracePeriodMinutes
                  - halfDayCutoffHours
                  - weeklyOff
                  - autoCheckoutAfter
                  - otEligibleAfterMinutes
                  - otCapPerDayMinutes
                  - otMultiplierWeekday
                  - otMultiplierHolidayOff
                  - otApprovalThresholdMinutes
                  - workingDays
                  - punchSources
                  - lateDeduction
                  - notifications
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: ont_ API key
      description: >-
        Issue keys in Settings → API. Send them as `Authorization: Bearer ont_…`
        (an `X-Api-Key: ont_…` header is also accepted). Session-cookie routes
        are used by the OnTime web apps and are shown for completeness.

````