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

# Edit an existing role



## OpenAPI

````yaml api-reference/openapi.json put /api/roles/{id}
openapi: 3.0.0
info:
  title: Bigcapital
  description: Financial accounting software
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /api/roles/{id}:
    put:
      tags:
        - Roles
      summary: Edit an existing role
      operationId: RolesController_editRole
      parameters:
        - name: Authorization
          in: header
          description: >-
            Value must be 'Bearer <token>' where <token> is an API key prefixed
            with 'bc_' or a JWT token.
          required: true
          schema:
            type: string
            example: Bearer bc_1234567890abcdef
        - name: organization-id
          in: header
          description: >-
            Required if Authorization is a JWT token. The organization ID to
            operate within.
          required: true
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Role ID
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditRoleDto'
      responses:
        '200':
          description: Role updated successfully
components:
  schemas:
    EditRoleDto:
      type: object
      properties:
        roleName:
          type: string
          example: admin
          description: The name of the role
        roleDescription:
          type: string
          example: Administrator
          description: The description of the role
        permissions:
          description: The permissions of the role
          type: array
          items:
            $ref: '#/components/schemas/EditRolePermissionDto'
      required:
        - roleName
        - roleDescription
        - permissions
    EditRolePermissionDto:
      type: object
      properties:
        subject:
          type: string
          example: subject
          description: The subject of the permission
        ability:
          type: string
          example: read
          description: The action of the permission
        value:
          type: boolean
          example: true
          description: The value of the permission
        permissionId:
          type: number
          example: 1
          description: The permission ID
      required:
        - subject
        - ability
        - value
        - permissionId

````