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

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Update workspace member roles in bulk

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Changes the roles of up to 200 members at once, the same way as [Update workspace member role](/api-reference/update-workspace-member-role).

You can't change your own role or the owner's. A role that a group grants can only be changed at the group, with [Update workspace group](/api-reference/update-workspace-group) or by changing its members. `admin` needs the Business plan or higher. Moving someone to `viewer` removes their own credit limit, and promoting a guest makes them a full member.

Every item is checked before anything changes. If any item can't be applied, nothing changes and the request returns a `400` whose `detail.errors` lists each rejected item with its `email`, a `message`, and an `error_code` when there is one. A member who isn't in the workspace, or a change you couldn't make on the single-member endpoint, is reported there rather than as a `403` or `404`.

A `200` has one entry in `results` per item, in request order. An item whose member changed while the request ran comes back with `status` `skipped` and wasn't applied. Count only `success` entries as done. A member whose role a group took over, or whose membership changed, is skipped and keeps their role.

This is limited to 5 requests per minute, shared by [Update workspace member roles in bulk](/api-reference/update-workspace-member-roles-in-bulk), [Remove workspace members in bulk](/api-reference/remove-workspace-members-in-bulk), and [Set member credit limits in bulk](/api-reference/set-member-credit-limits-in-bulk). A signed-in session has its own limit, and every personal access token for the workspace shares one. Some workspaces have a different limit.

<Note>Call this as an owner or admin of the workspace, with a personal access token for that workspace sent as a Bearer token, or from a signed-in session. A read-only token is refused, and workspace API keys aren't accepted.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json put /api/workspace/members/bulk/role
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/workspace/members/bulk/role:
    put:
      summary: Update workspace member roles in bulk
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Changes the roles of up to 200 members at once, the same way as [Update
        workspace member role](/api-reference/update-workspace-member-role).


        You can't change your own role or the owner's. A role that a group
        grants can only be changed at the group, with [Update workspace
        group](/api-reference/update-workspace-group) or by changing its
        members. `admin` needs the Business plan or higher. Moving someone to
        `viewer` removes their own credit limit, and promoting a guest makes
        them a full member.


        Every item is checked before anything changes. If any item can't be
        applied, nothing changes and the request returns a `400` whose
        `detail.errors` lists each rejected item with its `email`, a `message`,
        and an `error_code` when there is one. A member who isn't in the
        workspace, or a change you couldn't make on the single-member endpoint,
        is reported there rather than as a `403` or `404`.


        A `200` has one entry in `results` per item, in request order. An item
        whose member changed while the request ran comes back with `status`
        `skipped` and wasn't applied. Count only `success` entries as done. A
        member whose role a group took over, or whose membership changed, is
        skipped and keeps their role.


        This is limited to 5 requests per minute, shared by [Update workspace
        member roles in
        bulk](/api-reference/update-workspace-member-roles-in-bulk), [Remove
        workspace members in
        bulk](/api-reference/remove-workspace-members-in-bulk), and [Set member
        credit limits in bulk](/api-reference/set-member-credit-limits-in-bulk).
        A signed-in session has its own limit, and every personal access token
        for the workspace shares one. Some workspaces have a different limit.


        <Note>Call this as an owner or admin of the workspace, with a personal
        access token for that workspace sent as a Bearer token, or from a
        signed-in session. A read-only token is refused, and workspace API keys
        aren't accepted.</Note>
      operationId: bulk_update_member_role_api_workspace_members_bulk_role_put
      parameters:
        - name: workspaceId
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            description: >-
              ID of the workspace. With a personal access token, use the token's
              workspace. Get it from `organization_id` in [Get
              app](/api-reference/get-app).
            title: Workspaceid
          description: >-
            ID of the workspace. With a personal access token, use the token's
            workspace. Get it from `organization_id` in [Get
            app](/api-reference/get-app).
          example: 67e0b12c4d8a3f005b21c9e4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkUpdateMemberRoleRequest'
      responses:
        '200':
          description: The outcome for each member.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkMemberOperationResponse'
        '400':
          description: >-
            At least one item can't be applied, and nothing changed.
            `detail.errors` lists each one.
          content:
            application/json:
              example:
                detail:
                  message: Some members could not be updated. No changes were applied.
                  errors:
                    - email: sam@acme.com
                      error_code: MEMBER_NOT_FOUND
                      message: >-
                        Member sam@acme.com not found in workspace
                        67e0b12c4d8a3f005b21c9e4
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You aren't an owner or admin of the workspace, your token is for a
            different workspace or is read-only, or your credential can't be
            used on this endpoint.
        '409':
          description: Your workspace requires an unlocked SSO session.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit exceeded.
components:
  schemas:
    BulkUpdateMemberRoleRequest:
      properties:
        items:
          items:
            $ref: '#/components/schemas/BulkMemberRoleItem'
          type: array
          maxItems: 200
          minItems: 1
          title: Items
          description: The role changes, 1 to 200. Each email can appear once.
          example:
            - email: dana@acme.com
              role: editor
            - email: sam@acme.com
              role: viewer
      type: object
      required:
        - items
      title: BulkUpdateMemberRoleRequest
      description: Role changes to apply in one request.
    BulkMemberOperationResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/BulkMemberResult'
          type: array
          title: Results
          description: One entry per item, in request order.
          example:
            - email: dana@acme.com
              message: Member role updated to editor.
              status: success
      type: object
      required:
        - results
      title: BulkMemberOperationResponse
      description: The outcome of each item.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BulkMemberRoleItem:
      properties:
        email:
          type: string
          minLength: 1
          title: Email
          description: >-
            Email of the member, exactly as `email` in [List workspace
            members](/api-reference/list-workspace-members) returns it. Matching
            is exact, including case.
          example: dana@acme.com
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
          description: The member's new role. `admin` needs the Business plan or higher.
          example: editor
      type: object
      required:
        - email
        - role
      title: BulkMemberRoleItem
      description: One member's role change.
    BulkMemberResult:
      properties:
        email:
          type: string
          title: Email
          description: Email of the member.
          example: dana@acme.com
        status:
          type: string
          enum:
            - success
            - skipped
          title: Status
          description: >-
            `success` when the change was applied, `skipped` when the member
            changed while the request ran and nothing was applied.
          default: success
          example: success
        message:
          type: string
          title: Message
          description: Short explanation. Its wording can change, so don't parse it.
          example: Member role updated to editor.
      type: object
      required:
        - email
        - status
        - message
      title: BulkMemberResult
      description: What happened to one item.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````

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