> ## 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 Branch

<Info>
  Este endpoint atualiza uma <strong>unidade</strong> (Branch). Ele utiliza o
  schema <code>BranchRequestUpdateSchema</code> como corpo da requisição
  e retorna <code>PublicApiBranchBaseResponse</code> em caso de sucesso.
</Info>

<Note>
  Este endpoint <strong>não</strong> funciona como um <code>PATCH</code>.
  A requisição <code>PUT</code> substitui o recurso por completo. Caso você omita
  campos no corpo, eles poderão ser sobrescritos com valores padrão ou nulos.
</Note>

## Visão Geral

* **Método:** `PUT`
* **Path:** `/v0/branch/{branch_id}`
* **OperationId:** `public_update_branch_v0_branch__branch_id__put`
* **Autenticação:** header `x-api-key` (`APIKeyHeader` no OpenAPI)

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

### Campos

2. **cnpj** — Identificador da Empresa / Filial
   A CNPJ (Cadastro Nacional da Pessoa Jurídica) é o identificador fiscal de uma entidade legal (empresa).
   Um único grupo de empresas pode ter vários CNPJs, pois cada filial/local de trabalho pode ter seu próprio registro legal (CNPJ específico da filial).
   Em nosso modelo, a Filial é identificada pelo CNPJ porque isso define a entidade empregadora legal responsável pela conformidade.

### Exemplo de Requisição

```bash theme={null}
curl -X PUT "https://public-api.salu.com.vc/dev/routes/docs#/Branch/public_update_branch_v0_branch__branch_id__put\
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $SALU_PUBLIC_API_KEY" \
  -d @branch_update_payload.json
```


## OpenAPI

````yaml PUT /v0/branch/{branch_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/branch/{branch_id}:
    put:
      tags:
        - Branch
        - Branch
      summary: Public Update Branch
      operationId: public_update_branch_v0_branch__branch_id__put
      parameters:
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BranchRequestUpdateSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiBranchBaseResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    BranchRequestUpdateSchema:
      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
        display_name:
          type: string
          title: Display Name
        company_name:
          type: string
          title: Company Name
        cnpj:
          type: string
          title: Cnpj
        is_active:
          type: boolean
          title: Is Active
          default: true
        hr_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Hr Code
        cnae:
          anyOf:
            - type: string
            - type: 'null'
          title: Cnae
        client_integration_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Integration Code
        organization_id:
          type: string
          format: uuid
          title: Organization Id
      additionalProperties: false
      type: object
      required:
        - display_name
        - company_name
        - cnpj
        - organization_id
      title: BranchRequestUpdateSchema
    PublicApiBranchBaseResponse:
      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
        id:
          type: string
          format: uuid
          title: Id
        organization_id:
          type: string
          format: uuid
          title: Organization Id
        display_name:
          type: string
          title: Display Name
        company_name:
          type: string
          title: Company Name
        hr_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Hr Code
        cnpj:
          type: string
          title: Cnpj
        is_active:
          type: boolean
          title: Is Active
        client_integration_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Integration Code
      type: object
      required:
        - id
        - organization_id
        - display_name
        - company_name
        - cnpj
        - is_active
      title: PublicApiBranchBaseResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````