---
name: schematics-sc-agentb1-delete
title: Deleting an agent
description: You can delete an agent or uninstall an agent from the Kubernetes cluster by using an agent delete command. This command requires an `AGENT_ID` as input argument.
last-updated: 2025-01-17
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/schematics?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Deleting an agent
{: #delete-agent-overview}

When an agent is no longer needed, you can delete the agent.



## Deleting an agent through UI
{: #delete-agentb1-ui}
{: ui}

1. Log in to your [IBM Cloud](https://cloud.ibm.com/){: external} account by using your credentials.
2. Navigate to **Schematics** > **Agents**.
3. Click the `...` dots > **Delete** agent.
4. In the Delete Agent pop-up window, type `<your agent name>` to confirm. **Note** the deleted agent action cannot be undone.
5. Click **Delete**.

## Deleting an agent through CLI
{: #delete-agentb1-cli}
{: cli}

You can delete an agent or uninstall an agent from the Kubernetes cluster by using an [agent delete](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference&interface=cli&format=markdown#schematics-agent-delete) command. This command requires an `AGENT_ID` as input argument.
{: shortdesc}

Example

```sh
ibmcloud schematics agent delete --id agent-ga-prod-cli-jan-10.soA.cd1c
```
{: pre}

Output

```text
Do you really want to delete the agent agent-ga-prod-cli-jan-10.soA.cd1c? [y/N]> y
Deleting Agent...
Agent agent-ga-prod-cli-jan-10.soA.cd1c deleted successfully
OK
```
{: screen}

When the agent is deleted, you can expect:

- All the agent microservices are uninstalled.
- All the agent related Kubernetes resources, such as Pods, Deployment, Configmap, and Namespaces are unavailable.
- All the credentials that are created as part of the agent deployment, such as HMAC credentials for the Object Storage bucket, trusted profile to communicate with Schematics are unavailable.
- All the information about the agent in the Schematics instance of your IBM Cloud account is deleted.

When the agent is deleted, the following do not happen:

- The Kubernetes cluster is not destroyed. The cluster continues to incur costs until it is deleted. 
- The Object Storage instance and the Object Storage bucket are deleted.
- The agent assignment policy for the agent is not deleted.

## Deleting an agent through API
{: #delete-agentb1-api}
{: api}

Follow the [steps](https://cloud.ibm.com/docs/schematics?topic=schematics-setup-api&format=markdown#cs_api) to retrieve your IAM access token and authenticate with IBM Cloud Schematics by using the API. 

Example

```json
GET /v2/agents/agent-beta1-testing.soA.748e/ HTTP/1.1
Host: schematics.cloud.ibm.com
Content-Type: application/json
Authorization: Bearer <auth_token>

```
{: codeblock}

Output

```text
{
    "requestid": "9dc76486-ec80-4a26-b159-6e2d46eeb39f",
    "timestamp": "2023-03-16T21:13:20.244850864Z",
    "messageid": "M1074",
    "message": "The requested object cannot be located. Check that the ID is correct and try your request again.",
    "statuscode": 404
}

```
{: screen}



## Next steps
{: #agent-delete-nextstep}

- You can view the [list of agents](https://cloud.ibm.com/docs/schematics?topic=schematics-display-agentb1-overview&interface=cli&format=markdown), and the [agent assignment policy](https://cloud.ibm.com/docs/schematics?topic=schematics-policy-manage&interface=cli&format=markdown).
- You can check out the [agent FAQ](https://cloud.ibm.com/docs/schematics?topic=schematics-faqs-agent&format=markdown) for any common questions that are related to delete an agent.