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

# Bulk Set Agent State

> Atomic bulk update of agent visibility state.

All-or-nothing: if any id is missing, no agent is mutated and no audit row
is written. The response lists every id and its previous state.



## OpenAPI

````yaml /openapi.json post /api/v1/admin/agents/bulk-state
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/admin/agents/bulk-state:
    post:
      tags:
        - Admin
      summary: Bulk Set Agent State
      description: >-
        Atomic bulk update of agent visibility state.


        All-or-nothing: if any id is missing, no agent is mutated and no audit
        row

        is written. The response lists every id and its previous state.
      operationId: bulk_set_agent_state_api_v1_admin_agents_bulk_state_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkStateChangeRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BulkStateChangeRequest:
      properties:
        ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 200
          minItems: 1
          title: Ids
        state:
          type: string
          enum:
            - draft
            - coming_soon
            - beta
            - live
            - hidden
          title: State
        note:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Note
      type: object
      required:
        - ids
        - state
      title: BulkStateChangeRequest
      description: |-
        Atomic bulk state change (agents or teams).

        Bounded at 200 ids to keep a single transaction's memory footprint and
        lock window small. Exceeding the bound → 422.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````