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

# Batch Update Users

> Apply one set of changes to up to 1000 users, resolved by id/email/slug.

Identifiers that match no user are reported in `notFound` rather than
failing the batch.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/admin/users/batch
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/users/batch:
    post:
      tags:
        - admin-users
      summary: Batch Update Users
      description: |-
        Apply one set of changes to up to 1000 users, resolved by id/email/slug.

        Identifiers that match no user are reported in `notFound` rather than
        failing the batch.
      operationId: batch_update_users_api_admin_users_batch_post
      parameters:
        - name: dryRun
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Resolve the identifiers and report what would change, without
              writing.
            default: false
            title: Dryrun
          description: >-
            Resolve the identifiers and report what would change, without
            writing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchUpdateUsersRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_BatchUpdateUsersResult_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    BatchUpdateUsersRequest:
      properties:
        identifiers:
          items:
            type: string
          type: array
          maxItems: 1000
          minItems: 1
          title: Identifiers
        updates:
          $ref: '#/components/schemas/BatchUserUpdates'
      additionalProperties: false
      type: object
      required:
        - identifiers
        - updates
      title: BatchUpdateUsersRequest
      description: >-
        Apply one set of changes to many users.


        ``identifiers`` accepts a user id, email or slug for each user, so the

        caller does not have to resolve them first; anything that matches
        nothing is

        reported back rather than failing the batch.
    GenericResponse_BatchUpdateUsersResult_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/BatchUpdateUsersResult'
            - type: 'null'
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[BatchUpdateUsersResult]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    BatchUserUpdates:
      properties:
        isBanned:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isbanned
        hasBetaAccess:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hasbetaaccess
        blacklistAdd:
          items:
            $ref: '#/components/schemas/BlacklistEnum'
          type: array
          title: Blacklistadd
        blacklistRemove:
          items:
            $ref: '#/components/schemas/BlacklistEnum'
          type: array
          title: Blacklistremove
      additionalProperties: false
      type: object
      title: BatchUserUpdates
      description: >-
        The fields a batch edit may change. At least one must be given.


        Mirrors the admin UI's batch panel: ban/unban, grant/revoke beta, and

        add/remove blacklist modules. Blacklist changes are add/remove rather
        than a

        replacement list, because a batch spans users with different blacklists
        and

        a replacement would flatten them all to the same value.
    BatchUpdateUsersResult:
      properties:
        matched:
          type: integer
          title: Matched
        updated:
          type: integer
          title: Updated
        notFound:
          items:
            type: string
          type: array
          title: Notfound
        dryRun:
          type: boolean
          title: Dryrun
          default: false
        cacheFailures:
          type: integer
          title: Cachefailures
          default: 0
      type: object
      required:
        - matched
        - updated
      title: BatchUpdateUsersResult
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
    BlacklistEnum:
      type: string
      enum:
        - PROVISIONING
        - MULTINODE
        - BILLING
        - COUPONS
        - CREATE_TEAM
        - CREATE_API_KEYS
        - ENVIRONMENTS
        - INFERENCE
        - RFT
        - SECRETS
      title: BlacklistEnum
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````