# Swap Employee Shifts

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /empeo/api/v1/employees/swap-shifts:
    post:
      summary: Swap Employee Shifts
      deprecated: false
      description: ''
      tags:
        - empeo/Core HR/Shifts
      parameters:
        - name: Authorization
          in: header
          description: Authorization credential utilized in API requests
          required: false
          example: '{{token}}'
          schema:
            type: string
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: Api subscription key get from the OpenAPI integration setting page
          required: false
          example: '{{subscription_key}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ToEmployeeRefId:
                  type: string
                  description: EmployeeNo of target employee
                DateSwapTo:
                  type: string
                  description: Target shift date to be taken from the other employee
                Description:
                  type: string
                CompanyName:
                  type: string
                  description: Company name of employees
                DateSwapFrom:
                  type: string
                  description: Original shift date of requester to be swapped out
                FromEmployeeRefId:
                  type: string
                  description: EmployeeNo of requester
              x-apidog-orders:
                - CompanyName
                - FromEmployeeRefId
                - ToEmployeeRefId
                - DateSwapFrom
                - DateSwapTo
                - Description
              required:
                - FromEmployeeRefId
                - ToEmployeeRefId
                - DateSwapFrom
                - DateSwapTo
                - Description
                - CompanyName
            example:
              CompanyName: Gofive
              FromEmployeeRefId: EMP001
              ToEmployeeRefId: EMP002
              DateSwapFrom: '2025-06-12'
              DateSwapTo: '2025-06-20'
              Description: Requesting shift swap due to a personal emergency.
      responses:
        '200':
          description: ''
          content:
            '*/*':
              schema:
                type: object
                properties:
                  01JXFA1R5XC2HG7YSCWE41RM7K:
                    type: string
                x-apidog-orders:
                  - 01JXFA1R5XC2HG7YSCWE41RM7K
                required:
                  - 01JXFA1R5XC2HG7YSCWE41RM7K
              example: "{\r\n    \"status\": {\r\n        \"code\": \"1000\",\r\n        \"description\": \"Success!\"\r\n    },\r\n    \"data\": {\r\n        \"message\": \"Saved successfully.\",\r\n        \"result\": true\r\n    }\r\n}"
          headers: {}
          x-apidog-name: Success
      security:
        - bearerAuth: []
          x-apidog:
            schemeGroups:
              - id: uyL_cJmK7q60QJZRTi5ot
                schemeIds:
                  - bearerAuth
            required: true
            use:
              id: uyL_cJmK7q60QJZRTi5ot
            scopes:
              uyL_cJmK7q60QJZRTi5ot:
                bearerAuth: []
      x-apidog-folder: empeo/Core HR/Shifts
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-17760894-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: ใส่ JWT Token ในรูปแบบ Bearer {token}
    bearer:
      type: bearer
      scheme: bearer
servers:
  - url: https://api.gofive.co.th
    description: Production
security:
  - bearerAuth: []
    x-apidog:
      schemeGroups:
        - id: uyL_cJmK7q60QJZRTi5ot
          schemeIds:
            - bearerAuth
      required: true
      use:
        id: uyL_cJmK7q60QJZRTi5ot
      scopes:
        uyL_cJmK7q60QJZRTi5ot:
          bearerAuth: []

```
