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

# Delete Agent

> Soft-deletes an agent that belongs to the API key's company.

Permanently deletes an agent (interview template). **This action cannot be undone.**

## Overview

The delete agent endpoint permanently removes an agent configuration and all its associated interviews from your account. This is useful for removing outdated templates.

## Use Cases

* **Remove Unused Agents**: Clean up agents that are no longer needed
* **Archive Old Configurations**: Permanently remove outdated agent configurations
* **Compliance**: Delete agents for data retention compliance
* **Organization**: Maintain a clean agent library

## Permanent Deletion Behavior

<Info>
  Deleting an agent permanently removes the template from your account. This action is irreversible and will also remove all interviews that were created using this agent.
</Info>

## Impact on Existing Interviews

<Warning>
  Deleting an agent does not affect interviews that have already been scheduled or completed. Those interviews retain their association with the agent for historical accuracy. However, you cannot create new interviews using a deleted agent.
</Warning>

## Company Isolation

You can only delete agents that belong to your API key's company. Attempting to delete an agent from another company will result in a `403 Forbidden` error.

## Error Scenarios

* **404 Not Found**: Agent doesn't exist or has already been deleted
* **403 Forbidden**: Agent belongs to a different company

## Related Resources

<CardGroup cols={2}>
  <Card title="Agents Resource Guide" icon="robot" href="/guides/resources/agents">
    Learn about agent management
  </Card>

  <Card title="List Agents" icon="list" href="/api-reference/agents/list-agents">
    View all active agents
  </Card>

  <Card title="Create Agent" icon="plus" href="/api-reference/agents/create-agent">
    Create new agents
  </Card>
</CardGroup>


## OpenAPI

````yaml DELETE /agents/{id}
openapi: 3.0.0
info:
  title: InstaView API
  description: |-
    InstaView API Documentation

    ## Authentication

    All endpoints require API key authentication using Bearer token:
    ```
    Authorization: Bearer sk_your_api_key_here
    ```

    ## API Key Management

    The API Key module provides comprehensive key management for:
    - **Direct Client Keys**: Company-scoped keys for your applications
    - **ATS Partner Keys**: Resource-scoped keys for ATS integrations

    ### Key Features
    - HMAC-SHA256 hashing for API key storage
    - Configurable rate limiting
    - Comprehensive audit logging
    - Company-level isolation
    - Resource scoping for ATS partners
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.instaview.sk
    description: Production API Gateway
security: []
tags: []
paths:
  /agents/{id}:
    delete:
      tags:
        - Agents
      summary: Delete agent
      description: Soft-deletes an agent that belongs to the API key's company.
      operationId: PublicAgentsController_deleteAgent_v1
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            format: uuid
        - name: companyId
          required: false
          in: query
          description: >-
            Required for ATS API keys to specify which company to access.
            Ignored for standard company API keys.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: boolean
      security:
        - bearer: []
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: API key for authentication using Bearer scheme

````