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

# Create a role

> Create an operator-authored role. Admin-only; validates the grant map + base tier
before persist; 409 on a name collision. Bumps the policy version and audits.



## OpenAPI

````yaml /openapi.json post /api/auth/roles
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 0.1.1
servers: []
security: []
paths:
  /api/auth/roles:
    post:
      tags:
        - access-control
      summary: Create a role
      description: >-
        Create an operator-authored role. Admin-only; validates the grant map +
        base tier

        before persist; 409 on a name collision. Bumps the policy version and
        audits.
      operationId: post_api_auth_roles
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleCreate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data: {}
                required:
                  - data
                type: object
          description: Success.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Malformed request.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Conflict with the current resource state.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RoleCreate:
      description: >-
        The create-role request body: the grant map + base tier the operator
        authors; the

        base-tier jq is resolved server-side (no raw jq surface).
      properties:
        base_tier:
          title: Base Tier
          type: string
        description:
          default: ''
          title: Description
          type: string
        grants:
          additionalProperties:
            enum:
              - none
              - read
              - write
            type: string
          title: Grants
          type: object
        name:
          title: Name
          type: string
      required:
        - name
        - base_tier
      title: RoleCreate
      type: object
    Error:
      properties:
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````