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

# Assign a permission group to a subject



## OpenAPI

````yaml /api-reference/ilyama.v1.json post /organizations/permission-groups/{group_id}/assignments
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/{group_id}/assignments:
    post:
      tags:
        - Organizations
      summary: Assign a permission group to a subject
      operationId: createPermissionGroupAssignment
      parameters:
        - in: header
          name: ORG-ID
          required: true
          schema:
            format: uuid
            type: string
        - in: path
          name: group_id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePermissionGroupAssignmentRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionGroupAssignmentResponse'
          description: Permission group assignment 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
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Permission group not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Permission group is inactive, degraded, or has invalid access
      security:
        - bearerAuth: []
components:
  schemas:
    CreatePermissionGroupAssignmentRequest:
      additionalProperties: false
      properties:
        subject_id:
          type: string
        subject_kind:
          enum:
            - user
            - user_group
            - api_key
          type: string
      required:
        - subject_kind
        - subject_id
      type: object
    PermissionGroupAssignmentResponse:
      properties:
        data:
          $ref: '#/components/schemas/PermissionGroupAssignment'
        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
    PermissionGroupAssignment:
      properties:
        created_at:
          format: date-time
          type: string
        created_by:
          type: string
        effective:
          type: boolean
        id:
          format: uuid
          type: string
        org_id:
          format: uuid
          type: string
        permission_group_id:
          format: uuid
          type: string
        project_id:
          format: uuid
          type:
            - string
            - 'null'
        subject_id:
          type: string
        subject_kind:
          enum:
            - user
            - user_group
            - api_key
          type: string
      required:
        - id
        - permission_group_id
        - subject_kind
        - subject_id
        - org_id
        - project_id
        - effective
        - created_by
        - created_at
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````