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

# Create Area

> Creates a new area. Areas can be organized hierarchically by setting a parent_id.

To create a child area, set `parent_id` to the ID of an existing area. Omit `parent_id` (or pass an empty string) for a top-level area.


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json POST /areas
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:
    post:
      tags:
        - Areas
      summary: Create Area
      description: >-
        Creates a new area. Areas can be organized hierarchically by setting a
        parent_id.
      operationId: post-area
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: Display name of the area.
                  maxLength: 50
                  example: Northeast
                parent_id:
                  type: string
                  description: >-
                    ID of the parent area. Omit or pass an empty string for a
                    top-level area.
                  example: ''
            examples:
              Create top-level area:
                value:
                  name: Northeast
              Create child area:
                value:
                  name: New York City
                  parent_id: a1B2c
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Area'
              examples:
                Created top-level area:
                  value:
                    id: a1B2c
                    name: Northeast
                    parent_id: ''
                    nlevel: 0
                    protected: false
                Created child area:
                  value:
                    id: d3E4f
                    name: New York City
                    parent_id: a1B2c
                    nlevel: 1
                    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:
                Name is required:
                  value:
                    code: ARA-200
                    error: Name is required
                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
        '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

````