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

# Migrate employee

## Overview

Migrate an employee from one company to another within the same Corporation. This will terminate the employee on the original company and will create a new one on the new company.


## OpenAPI

````yaml POST /companies/{companyId}/employees/{employeeId}/migrate
openapi: 3.0.1
info:
  title: Partners API
  description: >-
    Partners API definition where you can check the documentation for the
    different available operations to integrate with the platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://pre-partners-api.cobee.io/api/v3
  - url: https://partners-api.cobee.io/api/v3
security:
  - bearerAuth: []
paths:
  /companies/{companyId}/employees/{employeeId}/migrate:
    post:
      summary: >-
        Migrates an employee from one company to another within the same
        corporation
      parameters:
        - name: companyId
          in: path
          required: true
          description: The unique identifier of the company
          schema:
            type: string
            format: uuid
          example: a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
        - name: employeeId
          in: path
          required: true
          description: The unique identifier of the employee
          schema:
            type: string
          example: 7f4c9ba8-9c2d-4b82-8b8c-e5f8f8f8f8f8
      requestBody:
        description: Employee data needed for the new company
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MigrateEmployeeRequest'
      responses:
        '201':
          description: Employee migrated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: The unique identifier of the employee
        '404':
          description: Not Found - The employee ID was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Employee not found
        '409':
          description: Conflict - Employee migration cannot be completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: employee conflict
        '500':
          description: Internal Server Error - Something went wrong on our end
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Internal server error
components:
  schemas:
    MigrateEmployeeRequest:
      type: object
      required:
        - newCompanyId
        - email
        - legalId
        - name
        - surname
        - birthDate
        - grossSalary
        - hiringDate
        - taxRegime
      properties:
        newCompanyId:
          type: string
          format: uuid
          description: The id of the destination company
        email:
          type: string
          format: email
          description: The employee's email address
        legalId:
          type: string
          description: The employee's legal identifier
        name:
          type: string
          description: The employee's first name
        surname:
          type: string
          description: The employee's surname
        birthDate:
          type: string
          format: date
          description: The employee's date of birth in ISO 8601 format (YYYY-MM-DD)
        grossSalary:
          $ref: '#/components/schemas/MonetaryAmount'
          description: The employee's gross salary details
        hiringDate:
          type: string
          format: date
          description: The date when the employee was hired in ISO 8601 format (YYYY-MM-DD)
        taxRegime:
          type: string
          enum:
            - general
            - basque
            - navarrese
            - biscayan
          description: The employee's tax regime
        internalId:
          type: string
          description: Your internal identifier for the employee
        costCenter:
          type: string
          description: The cost centre associated with this employee
        payrollCompany:
          type: string
          description: >-
            The company handling the employee's payroll, if different from the
            main company
        metadata:
          type: object
          description: Additional metadata for the employee (key-value pairs)
          additionalProperties: true
          example:
            department: Finance
            manager: Jane Doe
            office: Madrid
        workdayConfiguration:
          $ref: '#/components/schemas/WorkdayConfiguration'
          description: Configuration of the employee's workday
      additionalProperties: false
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
      example:
        message: 'Bad request: Invalid field value'
    MonetaryAmount:
      type: object
      required:
        - amountInCents
        - currency
      properties:
        amountInCents:
          type: integer
          description: The monetary amount in cents (e.g., 4500000 for 45,000)
          minimum: 1
        currency:
          type: string
          description: The currency code (e.g., EUR)
          example: EUR
      example:
        amountInCents: 4500000
        currency: EUR
    WorkdayConfiguration:
      type: object
      required:
        - workTimePercentage
      properties:
        daysPerMonth:
          type: integer
          description: The number of working days per month for this employee
          example: 22
        workTimePercentage:
          type: number
          description: The percentage of a full-time schedule this employee works
          minimum: 0.01
          maximum: 100
          example: 100
        numberOfPaychecks:
          type: integer
          description: The number of salary payments the employee receives per year
          example: 14
        collectiveAgreementSalary:
          $ref: '#/components/schemas/MonetaryAmount'
          description: The salary established by the collective agreement, if applicable
      example:
        daysPerMonth: 22
        workTimePercentage: 100
        numberOfPaychecks: 14
        collectiveAgreementSalary:
          amountInCents: 3800000
          currency: EUR
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````