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

# Delete an agent

> Soft-delete an agent by ID.

<Warning>
  The agent will no longer be accessible. Existing conversations will be preserved
  but new conversations cannot be started.
</Warning>




## OpenAPI

````yaml /openapi.yaml delete /agents
openapi: 3.1.0
info:
  title: AsterAgents API
  version: 1.0.0
  description: >
    API for AsterAgents platform operations.


    - **Admin endpoints** (`/admin/*`) require organization admin privileges
    (`org:admin` role)

    - **Agent endpoints** (`/agents`) require agent management permissions or
    `org:admin` role

    - **Knowledge base endpoints** (`/kb/*`) require standard authentication

    - **Skills endpoints** (`/skills/*`) require standard authentication

    - **File endpoints** (`/upload/*`, `/kb/files`, `/skills/files`) require
    standard authentication
  contact:
    name: AsterAgents Support
    url: https://asteragents.com/support
servers:
  - url: https://asteragents.com/api
    description: Production
  - url: http://localhost:3000/api
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Users
    description: Manage active organization users
  - name: Invitations
    description: Manage organization invitations
  - name: Files
    description: Upload and manage files
  - name: Knowledge Bases
    description: Manage knowledge bases and their files
  - name: Knowledge Base Management
    description: Create, update, and delete knowledge bases
  - name: Agents
    description: Create, update, and delete agents
  - name: Agent Tags
    description: Organize agents with tags
  - name: Tools
    description: Discover the tool catalog available to your organization
  - name: Skills
    description: Manage agent skills
  - name: Skill Files
    description: Manage bundled files for skills
  - name: Conversations
    description: Invoke agents and retrieve conversation history and messages
  - name: Scheduled Tasks
    description: Schedule agents to run automatically on a cron schedule
paths:
  /agents:
    delete:
      tags:
        - Agents
      summary: Delete an agent
      description: |
        Soft-delete an agent by ID.

        <Warning>
          The agent will no longer be accessible. Existing conversations will be preserved
          but new conversations cannot be started.
        </Warning>
      operationId: deleteAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agentId
              properties:
                agentId:
                  type: integer
                  description: The ID of the agent to delete
                  example: 1
            examples:
              simple:
                value:
                  agentId: 1
      responses:
        '200':
          description: Agent deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          description: Bad request - missing agent ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Agent ID is required
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    Agent:
      type: object
      required:
        - id
        - name
        - stage
        - showInChat
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
          description: Unique agent identifier
          example: 1
        name:
          type: string
          description: Agent name
          example: Customer Support Agent
        description:
          type: string
          nullable: true
          description: Short description of the agent's purpose
          example: Handles customer inquiries and support tickets
        logoUrl:
          type: string
          nullable: true
          description: URL to the agent's logo image
        conversationStarters:
          type: array
          nullable: true
          description: Suggested conversation starters shown to users
          items:
            type: string
          example:
            - How can I help you today?
            - What issue are you experiencing?
        model:
          type: string
          nullable: true
          description: Model identifier (e.g., `openai:gpt-4o`)
          example: openai:gpt-4o
        maxToolRoundtrips:
          type: integer
          nullable: true
          description: Maximum number of tool call roundtrips per response
          example: 50
        systemPrompt:
          type: string
          nullable: true
          description: System prompt / instructions for the agent
        tools:
          type: object
          nullable: true
          description: Tool definitions keyed by tool name
          additionalProperties: true
        mcpServers:
          type: array
          nullable: true
          description: Connected MCP server IDs (integer mcp_server.id values)
          items:
            type: integer
        stage:
          type: string
          description: Agent lifecycle stage
          enum:
            - development
            - released
          example: development
        showInChat:
          type: boolean
          description: Whether the agent appears in the chat interface
          example: true
        emailSlug:
          type: string
          nullable: true
          description: Custom email slug for the agent's email address
          example: support-bot
        publishedVersionId:
          type: integer
          nullable: true
          description: |
            ID of the `agent_version` snapshot this agent's config currently
            reflects. Every save appends a version and advances this pointer;
            see `GET /agents/versions`. The live agent fields above remain the
            source of truth — this is bookkeeping for history and rollback.
          example: 42
        createdAt:
          type: string
          format: date-time
          description: When the agent was created
          example: '2024-01-15T10:30:00.000Z'
        updatedAt:
          type: string
          format: date-time
          description: When the agent was last updated
          example: '2024-01-20T14:00:00.000Z'
        tags:
          type: array
          description: Tags associated with this agent
          items:
            type: object
            properties:
              id:
                type: integer
                example: 1
              name:
                type: string
                example: Production
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Bad Request
        details:
          type: array
          items:
            type: object
            additionalProperties: true
  responses:
    Forbidden:
      description: Forbidden - User is not an admin in the organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Unauthorized: User is not an admin in this organization'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal Server Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        JWT token from Clerk authentication.

        Must be from a user with `org:admin` role.

````