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

# Create a role

> Create a new role in the system



## OpenAPI

````yaml /api-reference/5.9/fusion-api-api-docs.json post /roles
openapi: 3.0.1
info:
  title: Fusion Proxy API
  description: Manage Fusion users, roles, realms, access tokens, and API keys.
  contact:
    name: Lucidworks
    url: www.lucidworks.com
    email: support@lucidworks.com
  license:
    name: License of API
    url: https://lucidworks.com/legal/developer-license-agreement/
  version: '5.9'
servers:
  - url: https://{FUSION HOST}/api
    description: Fusion
    variables:
      FUSION HOST:
        default: FUSION_HOST
        description: Your environment host.
security: []
tags:
  - name: Realm management
    description: >-
      Endpoints for creating, configuring, and managing authentication realms
      such as LDAP, SAML, OIDC, and others.
  - name: User management
    description: >-
      Endpoints for creating, updating, deleting, and retrieving Fusion users
      and their associated metadata.
  - name: Suggestions
    description: >-
      Endpoints that provide query suggestions or autocomplete results to
      improve search experiences.
  - name: API key management
    description: >-
      Endpoints for managing API keys used to authenticate Fusion services and
      integrations.
  - name: OAuth 2.0
    description: >-
      Endpoints that support OAuth 2.0 authentication, including token issuance
      and validation.
  - name: Role management
    description: >-
      Endpoints for creating and managing user roles and their associated
      permissions within Fusion.
  - name: System status
    description: >-
      Endpoints for retrieving basic system health, configuration, and
      authentication status.
externalDocs:
  description: Lucidworks Documentation
  url: https://doc.lucidworks.com/
paths:
  /roles:
    post:
      tags:
        - Role management
      summary: Create a role
      description: Create a new role in the system
      operationId: createRole
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Role'
            example:
              name: test-role
              desc: For testing only
              permissions:
                - methods:
                    - GET
                    - OPTIONS
                  path: /
              uiPermissions: []
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Role'
              example:
                id: e4ac80c6-8905-4eaf-9670-b541b41f732e
                name: test-role
                createdAt: '2025-10-31T18:12:59Z'
                desc: For testing only
                permissions:
                  - methods:
                      - OPTIONS
                      - GET
                    path: /
                uiPermissions: []
        '409':
          description: Role with a name or ID already exists
          content:
            application/json:
              example:
                traceId: 5048edcc-728739
                service: proxy
                error: conflict
                msg: Role with name test-role already exists
                path: /api/roles
                messages:
                  - Role with name test-role already exists
                timestamp: '2025-10-31T18:14:07.881063643'
                message: Role with name test-role already exists
components:
  schemas:
    Role:
      required:
        - name
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        createdAt:
          type: string
          format: date-time
          example: '2025-09-23T17:48:07Z'
        updatedAt:
          type: string
          format: date-time
          example: '2025-10-31T12:28:04Z'
        desc:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/GlobPermission'
        uiPermissions:
          type: array
          items:
            type: string
    GlobPermission:
      type: object
      properties:
        methods:
          uniqueItems: true
          type: array
          items:
            type: string
            enum:
              - GET
              - POST
              - PUT
              - DELETE
              - HEAD
              - PATCH
              - OPTIONS
        path:
          type: string
        params:
          type: object
          additionalProperties:
            type: array
            items:
              type: string

````