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

# Change a member role

> Set a workspace membership role.

Requires Owner. Send `viewer`, `editor`, `admin`, or `owner`. The last remaining owner cannot be demoted (`409`). Invalid roles return `400`; a missing membership returns `404`. Role changes also change the member’s API-key access to this workspace.


## OpenAPI

````yaml PUT /api/v1/organizations/members/{member_id}/role
openapi: 3.1.0
info:
  title: Bandwidth Agent Builder API
  version: v1
  description: >-
    Manage agents, place calls, and retrieve conversation results in your
    workspace.
servers:
  - url: https://agents.labs.bandwidth.com
    description: Workspace API
security: []
paths:
  /api/v1/organizations/members/{member_id}/role:
    put:
      tags:
        - members
      summary: Change a member role
      description: |-
        **Authorization:** Requires the Owner role in the requested workspace.

        Set a workspace membership role.
      operationId: update_member_role_api_v1_organizations_members__member_id__role_put
      parameters:
        - in: path
          name: member_id
          required: true
          schema:
            title: Member Id
            type: integer
        - description: >-
            Required with X-BW-LABS-AGENTS-API-KEY: the positive local workspace
            ID to access. The key owner must be a current member. Missing or
            invalid IDs return 400; non-member workspaces return 403. Not
            required for bearer authentication, which uses the user's selected
            workspace.
          in: header
          name: X-VOAI-ORGANIZATION-ID
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Required with X-BW-LABS-AGENTS-API-KEY: the positive local
              workspace ID to access. The key owner must be a current member.
              Missing or invalid IDs return 400; non-member workspaces return
              403. Not required for bearer authentication, which uses the user's
              selected workspace.
            title: X-Voai-Organization-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemberRoleRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgMemberResponse'
          description: Successful Response
        '400':
          description: Invalid request or missing/invalid workspace header with an API key.
        '401':
          description: Missing, invalid, or expired credential.
        '403':
          description: >-
            The account lacks access to the workspace, resource, or required
            role.
        '404':
          description: Not found
        '409':
          description: The last workspace owner cannot be demoted.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - LabsAuth: []
        - LabsApiKey: []
components:
  schemas:
    UpdateMemberRoleRequest:
      properties:
        role:
          title: Role
          type: string
      required:
        - role
      title: UpdateMemberRoleRequest
      type: object
    OrgMemberResponse:
      properties:
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        id:
          title: Id
          type: integer
        is_self:
          default: false
          title: Is Self
          type: boolean
        joined_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Joined At
        last_active_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Active At
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        role:
          title: Role
          type: string
        user_id:
          title: User Id
          type: integer
      required:
        - id
        - user_id
        - role
      title: OrgMemberResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    LabsAuth:
      description: >-
        Bandwidth Labs OAuth access token. Uses the user's selected workspace;
        the workspace header is not required. Do not also send an API key.
        Bearer-only operations may additionally require the Labs `super_user`
        role.
      scheme: bearer
      type: http
    LabsApiKey:
      description: >-
        Bandwidth Labs API key. Also send `X-VOAI-ORGANIZATION-ID` with a
        positive local workspace ID belonging to the key owner. Access follows
        the owner's current workspace role. Do not also send a bearer token. API
        keys cannot access bearer-only or Labs `super_user` operations.
      in: header
      name: X-BW-LABS-AGENTS-API-KEY
      type: apiKey

````

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