> For the complete documentation index, see [llms.txt](https://help.cloudstoragesec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.cloudstoragesec.com/trouble-shooting/i-cannot-create-delete-an-api-agent.md).

# I Cannot Create/Delete an API Agent

When trying to delete an Api Agent, you may just go to ECS and delete the ApiAgentService. This provokes an additional issue to then create a new Api Agent

If you want to delete a service or modify any resources created by the AV Console, **you must always perform these actions through the AV Console**—**never directly from the AWS Console**.

Managing resources manually through AWS may cause issues in the Cloud Storage Security (CSS) Console. This can break the deployment state and will require additional manual intervention to fix.

For example, if you want to delete resources like the API Service or the Event Service that were created by the AV Console, please follow [this guide](https://help.cloudstoragesec.com/console-overview/monitoring/deployment-overview#solution-cleanup-uninstall) for proper cleanup instructions.

> **IMPORTANT:** DO NOT manage resources and services created by the Cloud Storage Security Console directly through the AWS Console.

***

#### What Happens If You Delete a Service Manually?

If you manually delete a resource in AWS (e.g., the API Agent Service), the CSS Console will still believe the service exists. This inconsistency can prevent you from creating or deleting services properly and may lead to console errors.

***

#### How to Fix It

If you've manually deleted a service like the API Agent through the AWS Console, follow these steps to restore proper state:

1. **Go to DynamoDB**\
   Navigate to **DynamoDB > Tables > `<Your App ID>DeploymentStatus`**.
2. **Explore Table Items**
   * Click **Explore Table Items**.
   * Locate the region where the service was deleted.
   * Find the `HasApiService` value and **change it from `1` to `0`**.
   * Save and close the table.
3. **Update ECS Service**
   * Go to **ECS > ConsoleService > UpdateService**.
   * Perform a **force new deployment**.
   * Click **Update**.

![](https://d33v4339jhl8k0.cloudfront.net/inline/157705/8fea6fac10d11bfaf90b679b5f8711a046e5cfb2/f536c1e2fbdc026a86156d4e7c800c0d6db8851d/Tutorial-on-how-to-change-DynamoDB-table-for-API-and-reboot-the-AV-Console-2.gif)

After completing these steps, you should be able to create the API Agent again. The console will correctly detect that the previous service no longer exists.<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.cloudstoragesec.com/trouble-shooting/i-cannot-create-delete-an-api-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
