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

# Update an employee

> Update an employee. Only the provided fields are changed; omitted fields are left untouched.

`teams` replaces the full set of teams. `job`, `workLocation`, `legalEntity` and `teams` accept either an existing reference `id` or a `name` — a new reference is created when the name does not match an existing one.

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json patch /employees/{employeeId}
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /employees/{employeeId}:
    patch:
      tags:
        - Employees
      summary: Update an employee
      description: >-
        Update an employee. Only the provided fields are changed; omitted fields
        are left untouched.


        `teams` replaces the full set of teams. `job`, `workLocation`,
        `legalEntity` and `teams` accept either an existing reference `id` or a
        `name` — a new reference is created when the name does not match an
        existing one.
      operationId: updateEmployee
      parameters:
        - name: employeeId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEmployeeBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetEmployee_Output'
components:
  schemas:
    UpdateEmployeeBody:
      type: object
      properties:
        firstName:
          description: First name of the employee
          type: string
          minLength: 1
        lastName:
          description: Last name of the employee
          type: string
          minLength: 1
        email:
          description: Work email address of the employee
          type: string
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        personalEmail:
          description: Personal email address of the employee
          anyOf:
            - type: string
              format: email
              pattern: >-
                ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
            - type: 'null'
        phone:
          description: Phone number of the employee
          anyOf:
            - type: string
            - type: 'null'
        gender:
          description: Gender of the employee
          anyOf:
            - type: string
              enum:
                - MALE
                - FEMALE
                - OTHER
                - PREFER_NOT_TO_DISCLOSE
            - type: 'null'
        picture:
          description: URL of the employee profile picture
          anyOf:
            - type: string
            - type: 'null'
        managerId:
          description: ID of the manager employee
          anyOf:
            - type: string
            - type: 'null'
        employmentType:
          description: Employment type of the employee
          type: string
          enum:
            - INTERNAL
            - CONTRACTOR
        job:
          description: Job title. Created if it does not exist yet.
          anyOf:
            - type: object
              properties:
                id:
                  description: >-
                    ID of an existing reference. Omit or set null to
                    create/match by name.
                  anyOf:
                    - type: string
                    - type: 'null'
                name:
                  description: Display name of the reference.
                  type: string
                  minLength: 1
              required:
                - name
            - type: 'null'
        teams:
          description: >-
            Teams the employee belongs to. Replaces the current set. Teams are
            created if they do not exist yet.
          type: array
          items:
            type: object
            properties:
              id:
                anyOf:
                  - type: string
                  - type: 'null'
              name:
                type: string
                minLength: 1
            required:
              - id
              - name
        workLocation:
          description: Work location. Created if it does not exist yet.
          anyOf:
            - type: object
              properties:
                id:
                  description: >-
                    ID of an existing reference. Omit or set null to
                    create/match by name.
                  anyOf:
                    - type: string
                    - type: 'null'
                name:
                  description: Display name of the reference.
                  type: string
                  minLength: 1
              required:
                - name
            - type: 'null'
        legalEntity:
          description: Legal entity. Created if it does not exist yet.
          anyOf:
            - type: object
              properties:
                id:
                  description: >-
                    ID of an existing reference. Omit or set null to
                    create/match by name.
                  anyOf:
                    - type: string
                    - type: 'null'
                name:
                  description: Display name of the reference.
                  type: string
                  minLength: 1
              required:
                - name
            - type: 'null'
    GetEmployee_Output:
      type: object
      properties:
        id:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        teams:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
            required:
              - id
              - name
            additionalProperties: false
        jobs:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
            required:
              - id
              - name
            additionalProperties: false
        groups:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
            required:
              - id
              - name
            additionalProperties: false
        workLocation:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
              additionalProperties: false
            - type: 'null'
        legalEntity:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
              additionalProperties: false
            - type: 'null'
        managerId:
          anyOf:
            - type: string
            - type: 'null'
        startDate:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        terminationDate:
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        onboardingStatus:
          anyOf:
            - type: string
              enum:
                - PENDING
                - SCHEDULED
                - IN_PROGRESS
                - CLOSED
                - CANCELED
            - type: 'null'
        offboardingStatus:
          anyOf:
            - type: string
              enum:
                - PENDING
                - SCHEDULED
                - IN_PROGRESS
                - CLOSED
                - CANCELED
            - type: 'null'
        deviceIds:
          type: array
          items:
            type: string
        accessoryIds:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updatedAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - firstName
        - lastName
        - email
        - teams
        - jobs
        - groups
        - onboardingStatus
        - offboardingStatus
        - deviceIds
        - accessoryIds
        - createdAt
        - updatedAt
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````