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

# Edit Area

> Updates an area's name or position in the hierarchy.

<Note>
  The API validates against circular references — an area cannot be set as its own parent (`ARA-500`). Only `name` and `parent_id` can be updated; the `id` is immutable.
</Note>


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json PATCH /areas/{id}
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /areas/{id}:
    parameters:
      - schema:
          type: string
          example: a1B2c
        name: id
        in: path
        required: true
        description: Unique area identifier.
    patch:
      tags:
        - Areas
      summary: Edit Area
      description: Updates an area's name or position in the hierarchy.
      operationId: patch-area
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New display name for the area.
                  maxLength: 50
                  example: Northeast Region
                parent_id:
                  type: string
                  description: New parent area ID, or empty string to make top-level.
                  example: ''
            examples:
              Rename an area:
                value:
                  name: Northeast Region
              Move area under a new parent:
                value:
                  parent_id: x9Km2
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Area'
              examples:
                Updated area:
                  value:
                    id: a1B2c
                    name: Northeast Region
                    parent_id: ''
                    nlevel: 0
                    protected: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid area ID:
                  value:
                    code: ARA-100
                    error: Invalid area ID format
                Name too long:
                  value:
                    code: ARA-300
                    error: Name exceeds maximum length of 50 characters
                Invalid parent:
                  value:
                    code: ARA-400
                    error: Invalid parent_id
                Self-referencing parent:
                  value:
                    code: ARA-500
                    error: Area cannot be its own parent
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Insufficient permissions:
                  value:
                    code: ARA-600
                    error: Insufficient permissions to manage areas
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Area not found:
                  value:
                    code: ARA-700
                    error: Area not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Internal server error:
                  value:
                    code: ARA-1000
                    error: An unexpected error occurred
components:
  schemas:
    Area:
      title: Area
      type: object
      properties:
        id:
          type: string
          description: Unique area identifier.
          example: a1B2c
        name:
          type: string
          description: Display name of the area.
          example: Northeast
        parent_id:
          type: string
          description: Parent area ID, or empty string if top-level.
          example: ''
        nlevel:
          type: integer
          description: Nesting depth (0 = top-level).
          example: 0
        protected:
          type: boolean
          description: Whether the area is system-protected.
          example: false
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````