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

# Delete An Agent

> Delete an agent



## OpenAPI

````yaml delete /{resourceSlug}/forms/agent/{agentId}
openapi: 3.0.0
info:
  title: Agentcloud Webapp API Docs
  description: The API docs for Agentcloud's webapp.
  version: 0.2.1
servers:
  - url: https://app.agentcloud.dev
    description: Use our public api endpoints!
  - url: '{custom_url}'
    description: Test the endpoints on your own instance of Agent Cloud!
    variables:
      custom_url:
        default: https://app.agentcloud.dev
security: []
tags: []
paths:
  /{resourceSlug}/forms/agent/{agentId}:
    delete:
      tags:
        - Agents
      summary: Delete An Agent
      description: Delete an agent
      operationId: deleteAgentApi
      parameters:
        - name: resourceSlug
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ObjectId'
          description: >-
            The resourceSlug is a url parameter of the teamId associated with
            the user
        - name: agentId
          in: path
          required: true
          description: the agentId of the agent that will be deleted
          schema:
            properties:
              agentId:
                type: string
                description: an existing agentId
      responses:
        '302':
          description: Successful operation, redirect to '/{resourceSlug}/agents'.
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/tempRedirectResponse'
        '400':
          description: ID error with agentId validation
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '403':
          description: >-
            Invalid Permissions on the resourceSlug, attempting to access an
            agent outside the permissions of the team
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '500':
          description: Internal error
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
components:
  schemas:
    ObjectId:
      description: >-
        Mongodb Object id, unique identifier, length of 24 characters fitting
        the following regex; [a-f0-9]{24}
      type: string
    tempRedirectResponse:
      description: Server response after successsfully adding a new object
      properties:
        _id:
          type: string
          description: The unique Mongo id of the newly inserted object.
        redirect:
          type: string
          description: >-
            a string containing the redirect link to get all objects after a
            successful insertion.
    dynamicResponse:
      description: Server response
      properties:
        message:
          type: string
          description: Error message to provide more detail
        code:
          type: integer
          description: the error code

````