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

# Edit Shift

> Updates an existing shift. Only include the fields you want to change.

<Note>
  All fields are optional on edit. Only the fields you include will be updated.
</Note>


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json PATCH /events/{id}/shifts/{shift_id}
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /events/{id}/shifts/{shift_id}:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Event ID
      - schema:
          type: string
        name: shift_id
        in: path
        required: true
        description: Shift ID
    patch:
      tags:
        - Events
      summary: Edit Shift
      description: Updates an existing shift. Only include the fields you want to change.
      operationId: patch-event-shift
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                custom_name:
                  type: string
                start_time:
                  type: string
                  example: '2021-01-01 18:00:00'
                end_time:
                  type: string
                  example: '2021-01-01 20:00:00'
                skillset_id:
                  type: integer
                  description: Skillset ID for this shift.
                quantity:
                  type: string
                  minLength: 1
                  maxLength: 255
                alternate_quantity:
                  type: string
                  minLength: 0
                  maxLength: 255
                comments:
                  type: string
                  maxLength: 65535
        description: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shift'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid quantity:
                  value:
                    code: EVT-900
                    error: Invalid quantity
                Quantity less than assigned on shift:
                  value:
                    code: EVT-900
                    error: Quantity less than assigned on shift
                Invalid alternate quantity:
                  value:
                    code: EVT-900
                    error: Invalid alternate quantity
                Alternate quantity less than assigned on shift:
                  value:
                    code: EVT-900
                    error: Alternate quantity less than assigned on shift
                Comments exceeds maximum length:
                  value:
                    code: EVT-900
                    error: Comments exceeds maximum length
                No update fields provided:
                  value:
                    code: EVT-900
                    error: No update fields provided
                Skillset is required:
                  value:
                    code: EVT-1200
                    error: Skillset is required
                Invalid time format:
                  value:
                    code: EVT-1300
                    error: Invalid time format
                Custom name exceeds maximum length:
                  value:
                    code: EVT-1300
                    error: Custom name exceeds maximum length
                End time must be after start time:
                  value:
                    code: EVT-1400
                    error: End time must be after start time
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Insufficient permissions:
                  value:
                    code: EVT-800
                    error: Insufficient permissions to manage events
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Event not found:
                  value:
                    code: EVT-700
                    error: Event not found
                Shift not found:
                  value:
                    code: EVT-1100
                    error: Shift not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Failed to delete shift:
                  value:
                    code: EVT-900
                    error: Failed to delete shift
components:
  schemas:
    Shift:
      title: Shift
      type: object
      properties:
        id:
          type: string
        event_id:
          type: string
        custom_name:
          type: string
        start_time:
          type: string
        end_time:
          type: string
        skillsets:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
        quantity:
          type: integer
        filled:
          type: integer
        alternate_quantity:
          type: integer
        alternate_filled:
          type: integer
        comments:
          type: string
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````