Get all projects within an organization

How to get all projects within an organization in version 2?

It will depend on what you mean by project - in the circleci GUI the project list seems to be a dynamic list of all the repos available at the configured repo platform, based on the rights of the account used to connect to the repo platform. When the ‘Set Up Project’ button is used this seems to create a Pipeline entry that is tied to the repo.

So from the published API it seems that you can scan all the defined Pipelines (max 250), which will provide the names of the repos/projects that have pipelines defined against them.

There is an endpoint in V1.1 to get all project with all the other details:
https://circleci.com/api/v1.1/projects

Same like that, do we have any endpoint using which we can get all the project details?

I’ve never used the V1.1 api, but as the description of v1.1/projects seems to be

Returns an array of all projects you are currently following on CircleCI, with build information organized by branch.

That would seem to match the V2.0 API call of Pipeline - get a list of pipelines, which returns a list of all the projects being tracked by CircleCI. The build info by branch is a little more complicated as you would then have to use the Insights API.