---
title: "Update an existing area"
method: PUT
path: "/os/v1/areas/external/{externalCode}"
tags: ["Area", "Area"]
---

# Update an existing area

`PUT /os/v1/areas/external/{externalCode}`

Updates an area identified by `externalCode` in the URL.

**Business Rules:**
- `name`: Required. Maximum 300 characters.
- `externalCode`: Required. Maximum 50 characters. Must be unique within the company (must not match another area's code).
- `similarity`: Required. Must be a valid area similarity value.
- `description`: Optional. Maximum 900 characters.
- `organizationUnit`: Optional. If provided, identify the department by `uuid` and/or `externalCode` (at least one). If both are sent, `uuid` is used for lookup.
- `costCenter`: Optional. If provided, identify the cost center by `uuid` and/or `externalCode` (at least one). If both are sent, `uuid` is used for lookup.

**Validation:**
- All required fields must be provided and not empty.
- The area identified by `externalCode` in the URL must exist for the company.

**Errors (HTTP):**
- `404` when no area matches the URL `externalCode` for the company.
- `422` when a nested cost center or organization unit reference cannot be resolved.
- `500` for any other unexpected failure (generic `Internal server error` response).

## Path parameters

- `externalCode` string, required

## Request body

- UpdateAreaPublicRequestDto
  - `name` string, required — area name
  - `organizationUnit` ExternalCodeOrUuidReferenceDto
    - `uuid` string, uuid — Entity UUID within the company
    - `externalCode` string — External code identifying the entity within the company
  - `costCenter` ExternalCodeOrUuidReferenceDto
    - `uuid` string, uuid — Entity UUID within the company
    - `externalCode` string — External code identifying the entity within the company
  - `similarity` 'ADMINISTRATIVE' | 'FINANCIAL' | 'AGRONOMY' | 'ARCHITECTURE' | 'AUDITING' | 'QUALITY' | 'CUSTOMER_SERVICE' | 'COMMERCIAL' | 'PURCHASING' | 'COMMUNICATION' | 'DESIGN' | 'MARKETING' | 'ACCOUNTING' | 'CONTROLLING' | 'ENGINEERING' | 'MAINTENANCE' | 'TECHNICAL_SERVICES' | 'LEGAL' | 'INNOVATION' | 'PRODUCT' | 'LOGISTICS' | 'OPERATION' | 'PROJECTS' | 'PROCESSES' | 'HUMAN_RESOURCES' | 'SECURITY' | 'TECHNOLOGY', required — Area Similarity
  - `externalCode` string, required — Area external code
  - `description` string — Area description

## Response `200`

The area has been successfully updated.

## Other responses

- `400` — Bad Request - Validation errors
- `401` — Unauthorized - Invalid or missing token
- `404` — Not Found - no area for the company matches the externalCode in the URL (AreaNotFoundError)
- `422` — Unprocessable Entity - cost center or department reference not found (by uuid or external code)
- `500` — Internal Server Error - Unexpected failure

---

[API](https://skmtc.net/gupy/apis/gupy-public-api.md) · [All operations](https://skmtc.net/gupy/apis/gupy-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gupy/gupy-public-api/versions/3f26defa2a42/schema)
