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

# Remove an agent

> Removes an agent from the workspace. Their Adraa Inbox account and message history remain; they simply lose access to this workspace. Re-adding the same email restores access.

The workspace must keep at least one admin, and platform-managed agents (the AI agent) cannot be removed.

Rate limit: 30 requests per minute.



## OpenAPI

````yaml /api-reference/openapi.json delete /api/v1/agents/{agentId}
openapi: 3.1.0
info:
  title: Adraa Inbox API
  description: >-
    Public REST API for Adraa Inbox. Assign agents to conversations and send
    messages from your own systems. Authenticate every request with a workspace
    API token.
  version: 1.0.0
  contact:
    email: support@adraa.ai
servers:
  - url: https://api.inbox.adraa.ai
    description: Production
security:
  - apiToken: []
paths:
  /api/v1/agents/{agentId}:
    delete:
      summary: Remove an agent
      description: >-
        Removes an agent from the workspace. Their Adraa Inbox account and
        message history remain; they simply lose access to this workspace.
        Re-adding the same email restores access.


        The workspace must keep at least one admin, and platform-managed agents
        (the AI agent) cannot be removed.


        Rate limit: 30 requests per minute.
      operationId: removeAgent
      parameters:
        - $ref: '#/components/parameters/agentId'
      responses:
        '200':
          description: Agent removed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '400':
          description: Removing the last admin, or a platform-managed agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: LAST_ADMIN
                  message: The workspace must keep at least one admin
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/AgentNotFound'
components:
  parameters:
    agentId:
      name: agentId
      in: path
      required: true
      description: ID of the agent. List agents with `GET /api/v1/agents` to find it.
      schema:
        type: string
        example: cmbxgwq1e0000ph01i0j1k2l3
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable explanation.
            details:
              description: Field-level details for validation errors.
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
  responses:
    Unauthorized:
      description: Missing, invalid, or revoked API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_TOKEN
              message: Invalid or revoked API token
    AgentNotFound:
      description: Agent is not an active member of this workspace
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: AGENT_NOT_FOUND
              message: Agent not found in this workspace
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer
      description: >-
        Workspace API token created in Settings → API. Tokens start with
        `adraa_`.

````