> ## 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>
  This endpoint updates a <strong>branch</strong>. It accepts the
  <code>BranchRequestUpdateSchema</code> as the request body and returns
  <code>PublicApiBranchBaseResponse</code> on success.
</Info>

<Note>
  This endpoint does <strong>not</strong> behave like a <code>PATCH</code>.
  A <code>PUT</code> request replaces the entire resource. If you omit fields in the
  body, they may be overwritten with default or null values.
</Note>

## Overview

* **Method:** `PUT`
* **Path:** `/v0/branch/{branch_id}`
* **OperationId:** `public_update_branch_v0_branch__branch_id__put`
* **Authentication:** header `x-api-key` (`APIKeyHeader` in the OpenAPI)

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

### Fields

2. **cnpj** — Company / Branch identifier
   A CNPJ (Cadastro Nacional da Pessoa Jurídica) is the tax ID for a legal entity (company).
   A single company group may have multiple CNPJs, because each branch/worksite can have its own legal registration (branch-specific CNPJ).
   In our model, the Branch is identified by cnpj because that defines the legal employer entity responsible for compliance.

### Example Request

```bash theme={null}
curl -X PUT "https://public-api.salu.com.vc/dev/routes/v0/branch/{branch_id}" \
  -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

````