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

# Replace a role

> Replaces a custom role as a whole: its name, description, permissions and guardrail. The change applies at once to every member holding the role. System roles cannot be changed (403). A management key can only grant member management: a role with `org:manage`, `billing:manage` or `api_keys:manage` is refused (403). Requires the `manage:write` scope.



## OpenAPI

````yaml https://api.edenai.run/v2/info/splitted-schema/management_api/openapi.json put /v3/manage/roles/{role_id}/
openapi: 3.0.3
info:
  title: Organization Management
  version: '2.0'
  description: Your project description
servers:
  - url: https://api.edenai.run
security: []
paths:
  /v3/manage/roles/{role_id}/:
    put:
      tags:
        - Roles
      summary: Replace a role
      description: >-
        Replaces a custom role as a whole: its name, description, permissions
        and guardrail. The change applies at once to every member holding the
        role. System roles cannot be changed (403). A management key can only
        grant member management: a role with `org:manage`, `billing:manage` or
        `api_keys:manage` is refused (403). Requires the `manage:write` scope.
      operationId: manage_roles_update
      parameters:
        - in: path
          name: role_id
          schema:
            type: integer
          description: The role's id.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManageRoleRequestRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ManageRoleRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ManageRoleRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManageRole'
          description: ''
      security:
        - ManagementKeyAuth: []
components:
  schemas:
    ManageRoleRequestRequest:
      type: object
      description: >-
        A custom role. `permissions` are codes from `GET
        /v3/manage/permissions`; `guardrail_id`

        applies one of the organization's guardrails to everyone holding the
        role (null for none).

        Names are unique, and cannot reuse a system role's name.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
          nullable: true
          default: ''
          maxLength: 500
        permissions:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 100
        guardrail_id:
          type: integer
          nullable: true
      required:
        - name
        - permissions
    ManageRole:
      type: object
      description: >-
        A role. System roles (`is_system: true`) are shared by every
        organization and cannot be

        changed; the others are the organization's own. `guardrail_id` is the
        guardrail that applies

        to the role's members, or null.
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 100
        description:
          type: string
        is_system:
          type: boolean
        permissions:
          type: array
          items:
            type: string
            maxLength: 100
        guardrail_id:
          type: integer
          readOnly: true
      required:
        - guardrail_id
        - id
        - name
  securitySchemes:
    ManagementKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: >-
        A management key (created from the organization dashboard or with `POST
        /v3/manage/auth-keys`), sent as `Authorization: Bearer
        <management_key>`. Inference API keys (`sk-eden...`) are not accepted on
        these endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.