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

# Update a custom instance role

> Rename a role or replace its permissions. Users who have it keep it under the new name, and permission changes apply to their next request. Requires the `roles:manage` permission; API keys are rejected.



## OpenAPI

````yaml /openapi.json put /admin/roles/{roleId}
openapi: 3.1.0
info:
  title: Kaneo API
  version: 1.0.0
  description: Kaneo Project Management API - Manage projects, tasks, labels, and more
servers:
  - url: https://cloud.kaneo.app/api
    description: Kaneo API Server
security:
  - bearerAuth: []
paths:
  /admin/roles/{roleId}:
    put:
      tags:
        - Admin
      summary: Update a custom instance role
      description: >-
        Rename a role or replace its permissions. Users who have it keep it
        under the new name, and permission changes apply to their next request.
        Requires the `roles:manage` permission; API keys are rejected.
      operationId: updateInstanceRole
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: roleId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  pattern: ^[a-z][a-z0-9-]{1,31}$
                  description: >-
                    Lowercase letters, digits and hyphens, starting with a
                    letter. `admin` and `user` are reserved.
                  example: support
                permissions:
                  type: array
                  items:
                    type: string
                    enum:
                      - users:read
                      - users:create
                      - users:update
                      - users:disable
                      - users:delete
                      - users:credentials
                      - users:sessions
                      - users:api_keys
                      - workspaces:read
                      - workspaces:manage
                      - workspaces:archive
                      - workspaces:delete
                      - audit:read
                      - system:read
                      - instance:settings
                  maxItems: 30
                  description: >-
                    Instance permissions the role grants. `roles:manage` belongs
                    to the built-in admin role only.
              required:
                - name
                - permissions
      responses:
        '200':
          description: The updated role
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstanceRole'
        '400':
          description: Invalid name or permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: The caller lacks the instance permission or used an API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Role not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: The name is taken, reserved, or already held by users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          $ref: '#/components/responses/ApiKeyRateLimited'
components:
  schemas:
    InstanceRole:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        permissions:
          type: array
          items:
            type: string
            enum:
              - users:read
              - users:create
              - users:update
              - users:disable
              - users:delete
              - users:credentials
              - users:sessions
              - users:api_keys
              - workspaces:read
              - workspaces:manage
              - workspaces:archive
              - workspaces:delete
              - audit:read
              - system:read
              - instance:settings
        userCount:
          type: integer
          description: Users who currently have this role.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - permissions
        - userCount
        - createdAt
        - updatedAt
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of the error.
          example: Task not found
        code:
          type: string
          description: >-
            Stable UPPER_SNAKE_CASE code. Derived from the status unless a more
            specific code applies, such as VALIDATION_ERROR or
            MISSING_PERMISSION.
          example: NOT_FOUND
        issues:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                description: >-
                  Dotted path to the invalid input, prefixed with the request
                  part (body, query, params, header).
                example: body.title
              message:
                type: string
                example: Required
            required:
              - path
              - message
          description: Every validation issue, for VALIDATION_ERROR.
        missingPermissions:
          type: array
          items:
            type: string
          description: >-
            Permissions the caller lacks for this route, as resource:action, for
            MISSING_PERMISSION and API_KEY_SCOPE.
          example:
            - task:update
      required:
        - message
        - code
  responses:
    ApiKeyRateLimited:
      description: >-
        The API key exceeded its rate limit or usage quota. Wait the number of
        seconds in Retry-After before retrying. The X-RateLimit headers are sent
        only when the rate limit was hit.
      headers:
        Retry-After:
          description: >-
            Seconds to wait before retrying. Omitted when an exhausted usage
            quota never refills.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests the API key may make per window.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left in the current window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix time in seconds when the current window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or session token (Bearer)

````

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