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

# Create Rule



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/admin/entitlement-rules
openapi: 3.1.0
info:
  title: Sakshi — Agent Governance API
  description: >-
    Registry (KYA), decision flight recorder, bounded autonomy, evidence packs,
    fairness screens. Auth: bearer ingest keys create evidence; OIDC JWTs with
    governance roles mutate state.
  version: 0.1.0
servers:
  - url: https://demo.rotavision.com
    description: Public demo (read-only, synthetic data)
  - url: https://{host}
    description: Your Sakshi deployment (single-tenant, in your environment)
    variables:
      host:
        default: sakshi.your-company.internal
security:
  - bearerAuth: []
paths:
  /api/v1/admin/entitlement-rules:
    post:
      tags:
        - access
      summary: Create Rule
      operationId: create_rule_api_v1_admin_entitlement_rules_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleIn'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RuleIn:
      properties:
        match_on:
          type: string
          title: Match On
        claim_value:
          type: string
          maxLength: 512
          minLength: 1
          title: Claim Value
        match_mode:
          type: string
          title: Match Mode
          default: exact
        grants_role:
          anyOf:
            - type: string
            - type: 'null'
          title: Grants Role
        grants_org_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Grants Org Unit
        priority:
          type: integer
          title: Priority
          default: 100
        enabled:
          type: boolean
          title: Enabled
          default: true
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
      type: object
      required:
        - match_on
        - claim_value
      title: RuleIn
    RuleOut:
      properties:
        id:
          type: string
          title: Id
        match_on:
          type: string
          title: Match On
        match_mode:
          type: string
          title: Match Mode
        claim_value:
          type: string
          title: Claim Value
        grants_role:
          anyOf:
            - type: string
            - type: 'null'
          title: Grants Role
        grants_org_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Grants Org Unit
        priority:
          type: integer
          title: Priority
        enabled:
          type: boolean
          title: Enabled
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - id
        - match_on
        - match_mode
        - claim_value
        - grants_role
        - grants_org_unit
        - priority
        - enabled
        - note
        - created_by
        - created_at
        - updated_at
      title: RuleOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Ingest API key or OIDC JWT. See /authentication.

````