# Listing all endpoints of a branch

<mark style="color:green;">`GET`</mark> `/endpoints/list`

This api will list all the detected endpoints for the codebase that was parsed by momentum.

**Headers**

| Name          | Value            |
| ------------- | ---------------- |
| Authorization | `Bearer <token>` |

**Query Param**

| Name         | Type   | Description                                                |
| ------------ | ------ | ---------------------------------------------------------- |
| `project_id` | string | Project id that was generated when the project was parsed. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "/server.py": [
        {
            "entryPoint": "GET /",
            "identifier": "/server.py:index"
        },
        {
            "entryPoint": "GET /helloworld",
            "identifier": "/server.py:list"
        },
        {
            "entryPoint": "GET /search",
            "identifier": "/server.py:search"
        },
        {
            "entryPoint": "POST /add",
            "identifier": "/server.py:add"
        },
        {
            "entryPoint": "POST /delete",
            "identifier": "/server.py:delete"
        }
    ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "detail": "Project Details not found."
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The success response will give an empty array in case the repo does not have any REST endpoints.
{% endhint %}


---

# Agent Instructions: 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.momentum.sh/using-momentum/listing-all-endpoints-of-a-branch.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.
