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

# Create role

> Creates a new role in etcd with specified permission scopes



## OpenAPI

````yaml /api-reference/gns3util-master-api-docs.json post /api/v1/auth/roles
openapi: 3.0.0
info:
  description: API for gns3util cluster management
  title: gns3util cluster master API
  contact: {}
  version: '1.0'
servers: []
security: []
paths:
  /api/v1/auth/roles:
    post:
      tags:
        - auth
        - rbac
      summary: Create role
      description: Creates a new role in etcd with specified permission scopes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.CreateRoleRequest'
        description: Role definition
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.RoleInfo'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/helpers.APIErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/helpers.APIErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    models.CreateRoleRequest:
      type: object
      properties:
        description:
          type: string
        name:
          type: string
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/models.ScopeInfo'
    models.RoleInfo:
      type: object
      properties:
        created_at:
          type: string
        description:
          type: string
        name:
          type: string
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/models.ScopeInfo'
        updated_at:
          type: string
    helpers.APIErrorResponse:
      type: object
      properties:
        code:
          type: string
          example: unauthorized
        details:
          type: string
          example: invalid or missing join token
        error:
          type: string
          example: Unauthorized
    models.ScopeInfo:
      type: object
      properties:
        action:
          type: string
        resource:
          type: string
  securitySchemes:
    BearerAuth:
      description: Type "Bearer" followed by a space and JWT token.
      type: apiKey
      name: Authorization
      in: header

````