> For the complete documentation index, see [llms.txt](https://docs.opshub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opshub.com/v7.237/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/projects-list.md).

# Get All Projects

## Overview

Get the projects from the end system that the integration user has access to.

> **Note**: Return the `OH_NO_PROJECT` if the end system does not have the Projects' structure.

## API URI

This is the URI OpsHub will execute to call this API:

```bash
GET: /mbse/api/1.0/projects?
    startIndex=<startIndex>
    maxResults=<maxResults>
```

## URI Parameters

| Name       | In    | Required | Type    | Description                                                                             |
| ---------- | ----- | -------- | ------- | --------------------------------------------------------------------------------------- |
| startIndex | Query | True     | Integer | Start index from which list of projects should be returned                              |
| maxResults | Query | True     | Integer | Maximum number of projects to be returned by custom connector, starting from startIndex |

## Response Payload

```json
[
  {
    "id": "unique identifier",
    "name": "project name",
    "parentWorkSpaceId": "parent workspace id"
  }
]
```

| Name              | Type              | Required | Description                                                                                                    |
| ----------------- | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| id                | Integer or String | True     | Id or internal name of the project                                                                             |
| name              | String            | True     | Display name of the project                                                                                    |
| parentWorkSpaceId | String            | False    | If end system supports workspace-project hierarchy, set the id or internal name of the direct parent workspace |

## Examples

### Flat project list

**Example 1:**

```json
[
  {
    "id": "1",
    "name": "Sample Project",
    "parentWorkSpaceId": ""
  },
  {
    "id": "2",
    "name": "Demo Project",
    "parentWorkSpaceId": ""
  }
]
```

### Example 2

```json
[
  {
    "id": "SAMP",
    "name": "Sample Project",
    "parentWorkSpaceId": ""
  },
  {
    "id": "DEMO",
    "name": "Demo Project",
    "parentWorkSpaceId": ""
  }
]
```

### Workspace-Project hierarchy

```json
[
  {
    "id": "1",
    "name": "Main Project",
    "parentWorkSpaceId": "ws-1"
  },
  {
    "id": "2",
    "name": "Sample Project",
    "parentWorkSpaceId": "ws-1"
  },
  {
    "id": "3",
    "name": "Demo Project",
    "parentWorkSpaceId": "ws-2"
  },
  {
    "id": "4",
    "name": "Trial Project",
    "parentWorkSpaceId": "ws-2"
  }
]

```


---

# 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://docs.opshub.com/v7.237/mbse-connector-sdk-index/mbse-sdk-connector-apis/metadata-apis/projects-list.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.
