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

# Create policy binding

> Bind a role to a principal at a specific scope



## OpenAPI

````yaml api-docs/archived/auth.json post /v1/regions/global/iam/policies
openapi: 3.1.1
info:
  title: Auth & IAM API
  version: 1.0.0
  description: >-
    Authentication and Identity Access Management API for the k0rdent Enterprise
    platform. Provides OAuth2/OIDC token management, session lifecycle, user
    management, RBAC, service accounts, API keys, and identity provider
    configuration.
  contact:
    name: k0rdent Enterprise API Support
    email: api-support@example.com
    url: https://support.example.com
  license:
    name: Proprietary
    url: https://k0rdent.example.com/license
servers:
  - url: ''
    description: For documentation only
  - url: https://api.example.com
    description: Arc API Base URL
  - url: https://api.internal.example.com
    description: Atlas API Base URL
  - url: http://localhost:{port}
    description: Local Development
    variables:
      port:
        default: '4050'
        description: Auth service port
security: []
paths:
  /v1/regions/global/iam/policies:
    post:
      tags:
        - IAM Policies
      summary: Create policy binding
      description: Bind a role to a principal at a specific scope
      operationId: createPolicy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                roleId:
                  type: string
                principalType:
                  type: string
                  enum:
                    - user
                    - group
                    - serviceAccount
                principalId:
                  type: string
                scope:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - organization
                        - project
                        - resource
                    id:
                      type: string
                  required:
                    - type
                    - id
              required:
                - roleId
                - principalType
                - principalId
                - scope
      responses:
        '201':
          description: Policy binding created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/Policy'
components:
  schemas:
    Policy:
      type: object
      description: IAM policy binding (role to principal at scope)
      properties:
        id:
          type: string
          description: Policy binding identifier
        roleId:
          type: string
          description: Role to bind
        principalType:
          type: string
          enum:
            - user
            - group
            - serviceAccount
          description: Type of principal
        principalId:
          type: string
          description: Principal identifier
        scope:
          type: object
          description: Scope at which the binding applies
          properties:
            type:
              type: string
              enum:
                - organization
                - project
                - resource
              description: Scope type
            id:
              type: string
              description: Scope resource identifier
          required:
            - type
            - id
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - roleId
        - principalType
        - principalId
        - scope

````