> For the complete documentation index, see [llms.txt](https://docs.talkstack.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talkstack.ai/project/remove-active-agent.md).

# Remove Active Agent

This section provides instructions on using the /project/active-agent/:agentId endpoint to set active agent for .

**Step1: Prepare Your Request**

* **Endpoint:** `/project/active-agent/:agentId`
* **Method:** `PATCH`
* **URL:** `https://api.talkstackai.com/project/active-agent/:agentId`
* **Headers:** Include `Content-Type: application/json`.
* **Authorization:** Bearer token or x-api-key in Headers

**Step 2: Send the Request**

Use your preferred HTTP client to send the PATCH request.

**Success Response:**

* **Status Code:** `200 OK`
* **Body:**<br>

  ```
  {
      "message": "Removed active agent from project successfully.",
      "status": "success"
  }
  ```

**Troubleshooting**

* `401 Unauthorized`: If the user is unauthorized or the token is missing.
* `500 Internal Server Error`: For errors while removing active agent.
