Endpoint
Authentication
Requires JWT authentication viaAuthorization: Bearer <token> header.
Description
Permanently deletes an agent, including all its versions, configuration, and associated triggers. This action is irreversible. What Gets Deleted:- Agent record
- All versions (v1, v2, v3, etc.)
- Version configurations (system prompts, tools, MCPs)
- Agent triggers (if any)
- Agent cache entries
- Agent runs (preserved for history)
- Threads created by this agent
- Messages generated by this agent
Path Parameters
The unique identifier (UUID) of the agent to delete.
Restrictions
The following agents cannot be deleted:- Default Agent: Agents with
is_default: truemust first be unset as default - Suna System Agent: Agents with
metadata.is_suna_default: trueare protected
400 Bad Request.
Response
Success confirmation message
Success Response
Examples
Error Responses
Agent does not exist or user does not have access
User does not own this agent or lacks permission to delete
Attempting to delete a protected agentOr:
Missing or invalid authentication token
Server error during deletion
Safe Deletion Pattern
Before deleting an agent, ensure it’s not the default:Cleanup Actions
When an agent is deleted, the following cleanup occurs automatically:- Agent Record: Removed from
agentstable - Versions: All version records deleted from
agent_versionstable - Triggers: Associated triggers deleted via trigger service
- Cache: Agent configuration cache invalidated
- User Limits Cache: Agent count cache invalidated to reflect new limit
Trigger Cleanup
If the agent has configured triggers (e.g., scheduled runs, webhooks), they are automatically deleted:Recovering from Accidental Deletion
Agent deletion is permanent and cannot be undone. To minimize risk:- Export Before Deleting: Use the export endpoint to save configuration
- Verify Agent ID: Double-check the agent ID before deletion
- Check Dependencies: Ensure no active runs are using this agent
Export Before Delete
Notes
- Irreversible: Deletion is permanent; consider exporting first
- Default Protection: Cannot delete default agent; unset default first
- System Protection: Suna and other system agents cannot be deleted
- History Preserved: Agent runs and messages remain in the database for audit purposes
- Cache Invalidation: Triggers automatic cache cleanup
- Trigger Cleanup: All associated triggers are deleted
Related Endpoints
- Get Agent - View agent before deleting
- Update Agent - Unset default flag if needed
- Export Agent - Backup configuration before deletion
- List Agents - Find agents to delete