> 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/agent/get-all-agents.md).

# Get All agents

**Step1: Prepare Your Request**

* **Endpoint:** `/agent/:projectId`
* **Method:** `GET`
* **URL:** `https://api.talkstackai.com/agent/:projectId`
* **Headers:** Include `Content-Type: application/json`.
* **Authorization:** Bearer token  or x-api-key in headers

**Step2: Setting Request parameters**

* `projectId`: The id of the project from which you want to fetch a list of agents.

```
{
    "projectId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
```

**Step 3: Send the Request**

Use your preferred HTTP client to send the GET request with route params.

**Step 4: Handle the request**

The response will show a detailed list of all active agents in the project.

**Success Response:**

* **Status Code:** `200 OK`
* **Body:** The response gives a list of all agents.

```
[
    {
        "name": "John",
        "projectId": "XXXXXXXXXXXXXXXXXXX",
        "systemInstruction": "Instructions given to the agent.".
        "id": "XXXXXXXXXXXXXXXXXXXXXXXX"
    },
    {
        "name": "Jack",
        "projectId": "XXXXXXXXXXXXXXXXXXX",
        "systemInstruction": "Instructions given to the agent.".
        "id": "XXXXXXXXXXXXXXXXXXXXXXXX"
    },
]
```

**Troubleshooting**

* `400 Bad Request`: If the `projectId` is missing in the request.
* `404 Not Found`: If there are no agents.
* `500 Internal Server Error`: For errors in getting the agent list

Last updated 15 hours ago


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.talkstack.ai/agent/get-all-agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
