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

# Create unit

> Creates a new unit and returns the created resource.



## OpenAPI

````yaml /openapi.yaml post /units
openapi: 3.0.0
info:
  title: Ziik API
  version: '1.0'
servers: []
security: []
tags:
  - name: Auth
    description: Auth
  - name: Posts
    description: Posts
  - name: Counters
    description: Counters
  - name: Groups
    description: Groups
  - name: Languages
    description: Languages
  - name: Timezones
    description: Timezones
  - name: Units
    description: Units
  - name: User unit memberships
    description: User unit memberships
  - name: Users
    description: Users
  - name: User types
    description: User types
  - name: Conversations
    description: Conversations
paths:
  /units:
    post:
      tags:
        - Units
      summary: Create unit
      description: Creates a new unit and returns the created resource.
      operationId: 7bf41a2f5d0072edfb27584457c7b88e
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - name
              properties:
                name:
                  description: Unit name
                  type: string
                reference:
                  description: External reference identifier
                  type: string
                  nullable: true
                parent_id:
                  description: Parent unit ID
                  type: integer
                  nullable: true
                description:
                  type: string
                  nullable: true
              type: object
      responses:
        '201':
          description: Unit created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unit'
        '422':
          description: Validation error
components:
  schemas:
    Unit:
      properties:
        content_type:
          type: string
          example: unit
        id:
          type: integer
          example: 1
        reference:
          type: string
          nullable: true
        name:
          type: string
          example: HQ
        description:
          type: string
          nullable: true
        level:
          description: Depth in unit tree
          type: integer
        path:
          description: Materialized path
          type: string
        unit_type:
          type: string
          example: unit
        falldown:
          description: From pivot when in context
          type: boolean
          nullable: true
        features:
          type: array
          items:
            type: object
          nullable: true
        departments:
          type: array
          items:
            type: object
          nullable: true
        parent:
          description: Parent unit when loaded
          type: object
          nullable: true
        image:
          description: Unit image when loaded
          type: object
          nullable: true
        children:
          type: array
          items:
            type: object
          nullable: true
        addresses:
          description: Company, delivery, invoicing addresses
          type: object
        contact:
          description: Contact name and phone
          type: object
        opening_hours:
          description: Office hours and closed days
          type: object
        geo:
          properties:
            lat:
              type: number
              nullable: true
            lng:
              type: number
              nullable: true
          type: object
        stats:
          properties:
            users:
              type: integer
            children:
              type: integer
            children_total:
              type: integer
          type: object
          nullable: true
        permissions:
          description: Permission flags for current user
          type: object
        url:
          type: string
          example: api/units/1
      type: object

````