> ## 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.

# Set member credit limits in bulk

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

Sets or removes the credit limits of up to 200 members at once, the same way as [Set member credit limit](/api-reference/set-member-credit-limit).

A limit can't be more than the workspace's monthly credits. Viewers can't have a limit, since they can't use credits, but you can remove one. The workspace owner is never limited.

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 who became a viewer, or whose membership changed, is skipped and keeps their limit.

Member credit limits need the Business plan or higher. Below it, this returns a `402`.

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/credit-limit
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/credit-limit:
    put:
      summary: Set member credit limits in bulk
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Sets or removes the credit limits of up to 200 members at once, the same
        way as [Set member credit
        limit](/api-reference/set-member-credit-limit).


        A limit can't be more than the workspace's monthly credits. Viewers
        can't have a limit, since they can't use credits, but you can remove
        one. The workspace owner is never limited.


        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 who became a viewer, or whose membership changed, is skipped and
        keeps their limit.


        Member credit limits need the Business plan or higher. Below it, this
        returns a `402`.


        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_credit_limit_api_workspace_members_bulk_credit_limit_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/BulkUpdateMemberCreditLimitRequest'
      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.
        '402':
          description: The workspace's plan doesn't include member credit limits.
        '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:
    BulkUpdateMemberCreditLimitRequest:
      properties:
        items:
          items:
            $ref: '#/components/schemas/BulkMemberCreditLimitItem'
          type: array
          maxItems: 200
          minItems: 1
          title: Items
          description: The credit limits, 1 to 200. Each email can appear once.
          example:
            - credit_limit: 500
              email: dana@acme.com
            - email: sam@acme.com
      type: object
      required:
        - items
      title: BulkUpdateMemberCreditLimitRequest
      description: Credit limits 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
    BulkMemberCreditLimitItem:
      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
        credit_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Credit Limit
          description: >-
            Most credits the member can use in the workspace each month, at
            least 1. `null`, or leaving it out, removes their own limit, so the
            workspace default applies.
          example: 500
      type: object
      required:
        - email
      title: BulkMemberCreditLimitItem
      description: One member's credit limit.
    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.