> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Portfolios

> List all portfolios for which the current API key has read access.

Use the Prime SDK or CLI to test this endpoint by following the [quickstart](/prime/introduction/quickstart) guide and running with the following examples

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    PortfoliosService portfoliosService = PrimeServiceFactory.createPortfoliosService(client);

    ListPortfoliosResponse response = portfoliosService.listPortfolios();
    ```

    For more information, please visit the [Prime Java SDK](https://github.com/coinbase-samples/prime-sdk-java).
  </Tab>

  <Tab title=".NET">
    ```csharp wrap theme={null}
    var portfoliosService = new PortfoliosService(client);

    var response = portfoliosService.ListPortfolios();
    ```

    For more information, please visit the [Prime .NET SDK](https://github.com/coinbase-samples/prime-sdk-dotnet).
  </Tab>

  <Tab title="Go">
    ```go wrap theme={null}
    portfoliosService := portfolios.NewPortfoliosService(client)

    request := &portfolios.ListPortfolios{}

    response, err := portfoliosService.ListPortfolios(context.Background(), request)
    ```

    For more information, please visit the [Prime Go SDK](https://github.com/coinbase-samples/prime-sdk-go).
  </Tab>

  <Tab title="Python">
    ```python wrap theme={null}
    prime_client = PrimeClient(credentials)

    request = ListPortfoliosRequest()

    response = prime_client.list_portfolios(request)
    ```

    For more information, please visit the [Prime Python SDK](https://github.com/coinbase-samples/prime-sdk-py).
  </Tab>

  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl list-portfolios --entity-id ENTITY_ID_HERE
    ```

    For more information, please visit the [Prime CLI](https://github.com/coinbase-samples/prime-cli).
  </Tab>

  <Tab title="TS/JS">
    ```typescript wrap theme={null}
    const portfoliosService = new PortfoliosService(client);

    portfoliosService.listPortfolios().then(async (response) => {
        console.log('Portfolios: ', response);
    })
    ```

    For more information, please visit the [Prime TS SDK](https://github.com/coinbase-samples/prime-sdk-ts).
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /v1/portfolios
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/portfolios:
    get:
      tags:
        - Portfolios
      summary: List Portfolios
      description: List all portfolios for which the current API key has read access.
      operationId: PrimeRESTAPI_GetPortfolios
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetPortfoliosResponse
components:
  schemas:
    coinbase.public_rest_api.GetPortfoliosResponse:
      type: object
      properties:
        portfolios:
          type: array
          description: A list of portfolios.
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.Portfolio'
    coinbase.public_rest_api.Portfolio:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the portfolio
          example: e8bbed13-fa33-41de-86d5-4335d8f08166
        name:
          type: string
          description: The name of the portfolio
          example: CryptoBalances
        entity_id:
          type: string
          description: The ID of the entity to which the portfolio is associated
          example: 2c521d6c-1cfb-4371-bf9c-5a42938d3e75
        organization_id:
          type: string
          description: The ID of the organization to which the portfolio is associated
          example: 4c1d4464-e53b-429f-a81d-71ae7e2e687c
        entity_name:
          type: string
          description: The name of the entity to which the portfolio is associated
          example: Sample Prime Entity

````