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

# Create a permission group



## OpenAPI

````yaml /api-reference/ilyama.v1.json post /organizations/permission-groups
openapi: 3.1.0
info:
  description: >
    Generation-ready starter contract for ilyama's HTTP API.

    This is intentionally scoped to stable routes already mounted in
    services/apis

    so frontend clients can begin integrating against the rewrite immediately.
  title: ilyama Core API
  version: 0.1.0
servers:
  - url: /core/api/v1
security:
  - bearerAuth: []
tags:
  - name: Certificates (HTTP)
  - name: Device JITR
  - name: Device RPC
  - name: Devices
  - name: Edge replication
  - name: Fleets
  - name: Integrations
  - name: MDM
  - name: Notification Event Registry
  - name: Notifications
  - name: OTA
  - name: Observability & data
  - name: Organizations
  - name: Project settings
  - name: Projects
  - name: Projects — Email Templates
  - name: Projects — Notification Subscriptions
  - name: Projects — Status
  - name: System
  - name: Tickets & workflows
  - name: Webhooks
paths:
  /organizations/permission-groups:
    post:
      tags:
        - Organizations
      summary: Create a permission group
      operationId: createPermissionGroup
      parameters:
        - in: header
          name: ORG-ID
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePermissionGroupRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePermissionGroupResponse'
          description: Permission group created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Validation error
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Forbidden
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionGroupDegradedError'
          description: Permission group access contains invalid resources or actions
      security:
        - bearerAuth: []
components:
  schemas:
    CreatePermissionGroupRequest:
      properties:
        access:
          items:
            $ref: '#/components/schemas/EntityAccess'
          type: array
        active:
          type: boolean
        description:
          type: string
        name:
          type: string
        project_id:
          format: uuid
          type:
            - string
            - 'null'
      required:
        - name
      type: object
    CreatePermissionGroupResponse:
      properties:
        data:
          properties:
            id:
              format: uuid
              type: string
          required:
            - id
          type: object
        ok:
          enum:
            - 1
          type: integer
      required:
        - ok
        - data
      type: object
    ErrorEnvelope:
      properties:
        detail:
          type: string
        message:
          oneOf:
            - type: string
            - type: object
        ok:
          enum:
            - 0
          type: integer
      required:
        - ok
        - message
        - detail
      type: object
    PermissionGroupDegradedError:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              properties:
                invalid_items:
                  items:
                    $ref: '#/components/schemas/PermissionGroupInvalidItem'
                  type: array
              required:
                - invalid_items
              type: object
            message:
              type: string
          required:
            - code
            - message
            - details
          type: object
        ok:
          enum:
            - 0
          type: integer
      required:
        - ok
        - error
      type: object
    EntityAccess:
      properties:
        actions:
          items:
            type: string
          type: array
        resource:
          type: string
        resource_type:
          enum:
            - organizations
            - projects
            - device_data_definitions
            - device_data_points
            - device_shadow_definitions
            - context_definitions
            - device_profiles
            - logs
            - ota_updates
            - dashboards
            - fleets
            - tags
            - devices
            - groups
            - collections
            - dataspaces
          type: string
      required:
        - resource_type
        - resource
        - actions
      type: object
    PermissionGroupInvalidItem:
      allOf:
        - $ref: '#/components/schemas/EntityAccess'
        - properties:
            invalid_reason:
              enum:
                - resource_deleted
                - resource_moved
                - validation_failed
              type: string
          required:
            - invalid_reason
          type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````