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

# Update Employee

<Info>
  Atualiza dados de um <strong>funcionário</strong> existente.
</Info>

<Note>
  Este endpoint <strong>funciona como um PATCH real</strong>.

  * Envie <strong>apenas</strong> os campos que deseja atualizar.
  * <strong>Não</strong> é necessário reenviar todos os campos do funcionário.
  * Campos omitidos <strong>não</strong> serão alterados.
</Note>

## Visão Geral

### Campos

| Campo                          | Descrição                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `gov_id` (CPF)                 | **Identificador da Pessoa / Funcionário** <br /> No Brasil, toda pessoa física possui um CPF (Cadastro de Pessoa Física), que é o número de identificação do contribuinte nacional. É único por pessoa e normalmente não muda. Em nossa API, ele é exposto como `gov_id`. Na prática, desempenha um papel semelhante ao SSN (nos EUA) ou a um número de identificação fiscal pessoal em outros países. <br /> **Ponto chave:** `gov_id` identifica o ser humano, não a relação de trabalho.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `hr_code`                      | **“Matrícula RH” (ID interno de RH da empresa) — opcional** <br /> Corresponde à Matrícula RH, que é um código interno do funcionário criado pela empresa para sistemas de RH/folha de pagamento/administrativos. Opcional (não exigido por lei). Usado para controles internos e integrações com as ferramentas de HRIS/folha de pagamento da empresa. Pode variar de empresa para empresa e pode mudar se a empresa migrar de sistemas. Pense nisso como um ID de Funcionário típico dentro de uma organização.                                                                                                                                                                                                                                                                                                                                                                                                               |
| `employee_registration_number` | **“Matrícula eSocial” (ID de vínculo empregatício do governo) — obrigatório (quando aplicável)** <br /> Corresponde à Matrícula eSocial, que é um identificador oficial vinculado à relação de trabalho formal sob a legislação trabalhista brasileira (CLT). Obrigatório por lei para o reporte formal de emprego (eSocial). É único por relação de trabalho (por “vínculo de trabalho”), não necessariamente por pessoa para toda a vida. Pode não estar disponível na admissão, pois geralmente é atribuído/confirmado somente após a folha de pagamento/contabilidade registrar formalmente o funcionário, incluindo o registro na CTPS. <br /> **Nuance importante:** Uma pessoa (`gov_id`) pode existir no sistema antes que a Matrícula eSocial seja conhecida. Uma vez que o emprego é formalizado, `employee_registration_number` se torna a referência oficial do “lado do governo” para aquele vínculo empregatício. |

* **Método:** `PATCH`
* **Path:** `/v0/employee/{employee_id}`
* **OperationId:** `public_update_employee_v0_employee__employee_id__patch`
* **Autenticação:** header `x-api-key`

<OpenAPIPlayground openapi="/public-api/openapi.json" operationId="public_update_employee_v0_employee__employee_id__patch" />

### Exemplos de requisição

#### 1) Atualização parcial mínima (somente um campo)

```bash theme={null}
curl -X PATCH "https://public-api.salu.com.vc/dev/routes/v0/employee/EMPLOYEE_ID_AQUI" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $SALU_PUBLIC_API_KEY" \
  --data '{
    "employee_name": "Maria de Souza"
  }'
```

Neste exemplo, apenas o campo `employee_name` será alterado; os demais campos do funcionário permanecem inalterados.

#### 2) Atualização de múltiplos campos (omitindo os demais)

```bash theme={null}
curl -X PATCH "https://public-api.salu.com.vc/dev/routes/v0/employee/EMPLOYEE_ID_AQUI" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $SALU_PUBLIC_API_KEY" \
  --data '{
    "employee_name": "Maria de Souza",
    "is_active": true,
    "client_integration_code": "EMP-001-INT"
  }'
```

Somente os campos presentes no corpo (`employee_name`, `is_active`, `client_integration_code`) serão atualizados; todos os outros permanecem como estão.


## OpenAPI

````yaml PATCH /v0/employee/{employee_id}
openapi: 3.1.0
info:
  title: Public API v0
  description: API publica da Salu para integracoes de SST.
  version: 0.1.0
servers:
  - url: https://public-api.salu.com.vc/dev/routes
    description: Development
  - url: https://public-api.salu.com.vc/prd/routes
    description: Production
security: []
paths:
  /v0/employee/{employee_id}:
    patch:
      tags:
        - Employee
        - Employee
      summary: Public Update Employee
      operationId: public_update_employee_v0_employee__employee_id__patch
      parameters:
        - name: employee_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Employee Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicApiUpdateEmployeeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiEmployeeUpdateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PublicApiUpdateEmployeeRequest:
      properties:
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
        address_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Number
        address_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Detail
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
        neighborhood:
          anyOf:
            - type: string
            - type: 'null'
          title: Neighborhood
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        social_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Social Name
        gov_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Gov Id
        birth_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Birth Date
        is_disabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Disabled
        status:
          anyOf:
            - $ref: '#/components/schemas/PublicApiStatusEnum'
            - type: 'null'
        sex:
          anyOf:
            - $ref: '#/components/schemas/PublicApiSexEnum'
            - type: 'null'
        gender:
          anyOf:
            - $ref: '#/components/schemas/PublicApiGenderIdentityEnum'
            - type: 'null'
        mother_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Mother Name
        marital_status:
          anyOf:
            - $ref: '#/components/schemas/PublicApiMaritalStatusEnum'
            - type: 'null'
        place_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Place Of Birth
        educational_stage:
          anyOf:
            - $ref: '#/components/schemas/PublicApiEducationalStageEnum'
            - type: 'null'
        human_skin_tone:
          anyOf:
            - $ref: '#/components/schemas/PublicApiHumanSkinToneEnum'
            - type: 'null'
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        cell_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Cell Phone
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        personal_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Personal Email
        admission_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Admission Date
        hr_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Hr Code
        employee_registration_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Employee Registration Number
        work_shift:
          anyOf:
            - type: string
            - type: 'null'
          title: Work Shift
        organization_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Organization Id
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
        position_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Position Id
        sector_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Sector Id
        client_integration_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Integration Code
        dismissal_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dismissal Date
      type: object
      title: PublicApiUpdateEmployeeRequest
    PublicApiEmployeeUpdateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        social_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Social Name
        gov_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Gov Id
        birth_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Birth Date
        is_disabled:
          type: boolean
          title: Is Disabled
        status:
          type: string
          title: Status
        sex:
          type: string
          title: Sex
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
        mother_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Mother Name
        marital_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Marital Status
        place_of_birth:
          anyOf:
            - type: string
            - type: 'null'
          title: Place Of Birth
        educational_stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Educational Stage
        human_skin_tone:
          anyOf:
            - type: string
            - type: 'null'
          title: Human Skin Tone
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        cell_phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Cell Phone
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        personal_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Personal Email
        admission_date:
          type: string
          format: date
          title: Admission Date
        dismissal_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dismissal Date
        hr_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Hr Code
        employee_registration_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Employee Registration Number
        work_shift:
          anyOf:
            - type: string
            - type: 'null'
          title: Work Shift
        is_active:
          type: boolean
          title: Is Active
        client_integration_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Integration Code
        organization:
          $ref: '#/components/schemas/SimpleEntity'
        branch:
          $ref: '#/components/schemas/SimpleEntity'
        position:
          $ref: '#/components/schemas/SimpleEntity'
        sector:
          $ref: '#/components/schemas/SimpleEntity'
        address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
      type: object
      required:
        - id
        - name
        - is_disabled
        - status
        - sex
        - admission_date
        - is_active
        - organization
        - branch
        - position
        - sector
      title: PublicApiEmployeeUpdateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PublicApiStatusEnum:
      type: string
      enum:
        - Ativo
        - Inativo
        - Afastado
        - Férias
        - Pendente
      title: PublicApiStatusEnum
    PublicApiSexEnum:
      type: string
      enum:
        - M
        - F
      title: PublicApiSexEnum
    PublicApiGenderIdentityEnum:
      type: string
      enum:
        - Cis
        - Trans
      title: PublicApiGenderIdentityEnum
    PublicApiMaritalStatusEnum:
      type: string
      enum:
        - Não informado
        - Solteiro
        - Casado
        - Separado
        - Desquitado
        - Viúvo
        - Outros
        - Divorciado
        - União Estável
      title: PublicApiMaritalStatusEnum
    PublicApiEducationalStageEnum:
      type: string
      enum:
        - Indefinida
        - Ensino Fundamental Incompleto
        - Ensino Fundamental Completo
        - Ensino Medio Incompleto
        - Ensino Medio Completo
        - Ensino Superior Incompleto
        - Ensino Superior Completo
        - Profissionalizante
        - Técnico Incompleto
        - Técnico Completo
        - Tecnólogo Incompleto
        - Tecnólogo Completo
        - Pós-graduação Incompleta
        - Pós-graduação Completo
        - Mestrado Incompleto
        - Mestrado Completo
        - Doutorado Incompleto
        - Doutorado Completo
        - PHD Incompleto
        - PHD Completo
        - Não Informado
        - Analfabeto
      title: PublicApiEducationalStageEnum
    PublicApiHumanSkinToneEnum:
      type: string
      enum:
        - Indefinido
        - Branca
        - Preta
        - Parda
        - Amarela
        - Indígena
        - Mulato
      title: PublicApiHumanSkinToneEnum
    SimpleEntity:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: SimpleEntity
    Address:
      properties:
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
        address_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Number
        address_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Address Detail
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
        neighborhood:
          anyOf:
            - type: string
            - type: 'null'
          title: Neighborhood
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
      type: object
      title: Address
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````