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

# Update Member Roles

> Updates the RBAC roles assigned to a team member. The roles array
replaces the member's existing roles entirely.
Requires `team:change_role` permission.




## OpenAPI

````yaml PATCH /api/accounts/current/members/{userId}/roles
openapi: 3.1.0
info:
  title: Naturalead Accounts & Teams API
  version: 1.0.0
  description: >
    API for managing accounts, team members, and RBAC roles in the Naturalead
    platform.

    All endpoints require API key authentication and are scoped to the caller's
    account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: Accounts
    description: Account profile and settings
  - name: Team
    description: Team member management and role assignment
  - name: Roles
    description: RBAC role and permission introspection
paths:
  /api/accounts/current/members/{userId}/roles:
    patch:
      tags:
        - Team
      summary: Update member roles
      description: |
        Updates the RBAC roles assigned to a team member. The roles array
        replaces the member's existing roles entirely.
        Requires `team:change_role` permission.
      operationId: updateMemberRoles
      parameters:
        - name: userId
          in: path
          required: true
          description: The user ID of the team member
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                roles:
                  type: array
                  items:
                    type: string
                    enum:
                      - owner
                      - integrator
                      - ai_architect
                      - operator
                      - analyst
                  minItems: 1
                  description: New set of roles for the member
              required:
                - roles
      responses:
        '200':
          description: Roles updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          description: Invalid roles provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````