> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Get all workspaces

GET https://api.getpostman.com/network/private

Gets information workspaces added to your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).

Reference: https://learning.postman.com/api-docs/api-reference/private-api-network/list-private-network-workspaces

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /network/private:
    get:
      operationId: listPrivateNetworkWorkspaces
      summary: Get all workspaces
      description: >-
        Gets information workspaces added to your team's [Private API
        Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).
      tags:
        - privateApiNetwork
      parameters:
        - name: type
          in: query
          description: The `workspace` value.
          required: false
          schema:
            $ref: '#/components/schemas/elementTypeQuery'
        - name: name
          in: query
          description: >-
            Return only workspaces whose name includes the given value. Matching
            is not case-sensitive.
          required: false
          schema:
            $ref: '#/components/schemas/panElementName'
        - name: summary
          in: query
          description: >-
            Return only workspaces whose summary includes the given value.
            Matching is not case-sensitive.
          required: false
          schema:
            $ref: '#/components/schemas/panSummary'
        - name: description
          in: query
          description: >-
            Return only workspaces whose description includes the given value.
            Matching is not case-sensitive.
          required: false
          schema:
            $ref: '#/components/schemas/panElementDescription'
        - name: since
          in: query
          description: >-
            Return only results created since the given time, in [ISO
            8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
            format. This value cannot be later than the `until` value.
          required: false
          schema:
            $ref: '#/components/schemas/sinceDateTime'
        - name: until
          in: query
          description: >-
            Return only results created until this given time, in [ISO
            8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)
            format. This value cannot be earlier than the `since` value.
          required: false
          schema:
            $ref: '#/components/schemas/untilDateTime'
        - name: addedBy
          in: query
          description: Return only workspaces published by the given user ID.
          required: false
          schema:
            $ref: '#/components/schemas/panAddedBy'
        - name: sort
          in: query
          description: >-
            Sort the results by the given value. If you use this query
            parameter, you must also use the `direction` parameter.
          required: false
          schema:
            $ref: '#/components/schemas/sortCreatedUpdatedAt'
        - name: direction
          in: query
          description: >-
            Sort in ascending (`asc`) or descending (`desc`) order. Matching is
            not case-sensitive. If you use this query parameter, you must also
            use the `sort` parameter.
          required: false
          schema:
            $ref: '#/components/schemas/ascDesc'
        - name: createdBy
          in: query
          description: Return only results created by the given user ID.
          required: false
          schema:
            $ref: '#/components/schemas/createdBy'
        - name: offset
          in: query
          description: The zero-based offset of the first item to return.
          required: false
          schema:
            $ref: '#/components/schemas/offset'
            default: 0
        - name: limit
          in: query
          description: >-
            The maximum number of results to return. If the value exceeds the
            maximum value of `1000`, then the system uses the `1000` value.
          required: false
          schema:
            $ref: '#/components/schemas/limitDefault1000'
            default: 1000
        - name: parentFolderId
          in: query
          description: This parameter is deprecated.
          required: false
          schema:
            $ref: '#/components/schemas/panParentFolderId'
            default: 0
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getPanElements'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ListPrivateNetworkWorkspacesRequestUnauthorizedError
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ListPrivateNetworkWorkspacesRequestForbiddenError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ListPrivateNetworkWorkspacesRequestInternalServerError
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    elementTypeQuery:
      type: string
      enum:
        - workspace
      title: elementTypeQuery
    panElementName:
      type: string
      title: panElementName
    panSummary:
      type: string
      title: panSummary
    panElementDescription:
      type: string
      title: panElementDescription
    sinceDateTime:
      type: string
      format: date-time
      title: sinceDateTime
    untilDateTime:
      type: string
      format: date-time
      title: untilDateTime
    panAddedBy:
      type: integer
      title: panAddedBy
    sortCreatedUpdatedAt:
      type: string
      enum:
        - createdAt
        - updatedAt
      title: sortCreatedUpdatedAt
    ascDesc:
      type: string
      enum:
        - asc
        - desc
      title: ascDesc
    createdBy:
      type: integer
      title: createdBy
    offset:
      type: integer
      default: 0
      title: offset
    limitDefault1000:
      type: integer
      default: 1000
      title: limitDefault1000
    panParentFolderId:
      type: integer
      default: 0
      title: panParentFolderId
    GetPanElementsElementsItems:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the element was created.
        createdBy:
          type: integer
          description: The user who created the element.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the element was last updated.
        updatedBy:
          type: integer
          description: The user ID of the user who updated the element.
        addedAt:
          type: string
          format: date-time
          description: >-
            The date and time at which the element was published to your team's
            Private API Network. This value is the same as the `updatedAt`
            value.
        addedBy:
          type: integer
          description: The user ID of the user who published the element.
        description:
          type:
            - string
            - 'null'
          description: The element's description.
        id:
          type: string
          description: The element's ID.
        name:
          type: string
          description: The element's name.
        summary:
          type:
            - string
            - 'null'
          description: The element's summary.
        type:
          type: string
          description: The `workspace` element type.
        parentFolderId:
          type: integer
          description: The `0` value.
        href:
          type: string
          format: url
          description: The element's HREF.
      description: Information about the Private API Network element.
      title: GetPanElementsElementsItems
    GetPanElementsFoldersItems:
      type: object
      properties: {}
      title: GetPanElementsFoldersItems
    panMetadata:
      type: object
      properties:
        limit:
          type: integer
          description: >-
            The maximum number of elements returned. If the value exceeds the
            maximum value of `1000`, then the system uses the `1000` value.
        offset:
          type: integer
          description: The zero-based offset of the first item returned.
        totalCount:
          type: integer
          description: The total number of elements.
      description: The response's non-standard meta information.
      title: panMetadata
    getPanElements:
      type: object
      properties:
        elements:
          type: array
          items:
            $ref: '#/components/schemas/GetPanElementsElementsItems'
          description: A list of Private API Network elements.
        folders:
          type: array
          items:
            $ref: '#/components/schemas/GetPanElementsFoldersItems'
          description: This property is deprecated and only returns an empty array.
        meta:
          $ref: '#/components/schemas/panMetadata'
      title: getPanElements
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    ListPrivateNetworkWorkspacesRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ListPrivateNetworkWorkspacesRequestUnauthorizedError
    ListPrivateNetworkWorkspacesRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ListPrivateNetworkWorkspacesRequestForbiddenError
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    ListPrivateNetworkWorkspacesRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ListPrivateNetworkWorkspacesRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples



**Response**

```json
{
  "elements": [
    {
      "createdAt": "2024-11-29T06:31:24.000Z",
      "createdBy": 12345678,
      "updatedAt": "2024-11-29T06:31:24.000Z",
      "updatedBy": 12345678,
      "addedAt": "2024-11-29T06:31:24.000Z",
      "addedBy": 12345678,
      "description": null,
      "id": "5360b75f-447e-467c-9299-12fd6c92450d",
      "name": "Billing Team Workspace",
      "summary": "The Billing team's workspace.",
      "type": "workspace",
      "href": "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
      "parentFolderId": 0
    },
    {
      "createdAt": "2024-11-29T06:31:26.000Z",
      "createdBy": 12345678,
      "updatedAt": "2024-11-29T06:31:26.000Z",
      "updatedBy": 12345678,
      "addedAt": "2024-11-29T06:31:26.000Z",
      "addedBy": 12345678,
      "description": null,
      "id": "360b75f-447e-467c-9299-12fd3c92450d",
      "name": "Test Workspace",
      "summary": "This is a test workspace.",
      "type": "workspace",
      "href": "https://api.getpostman.com/workspaces/41f6dc6d-d8ab-45c6-8506-74a25acf5d5f",
      "parentFolderId": 0
    }
  ],
  "meta": {
    "limit": 1000,
    "offset": 0,
    "totalCount": 2
  },
  "folders": []
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.getpostman.com/network/private"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/network/private';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful Response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/network/private"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful Response
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/network/private")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Successful Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getpostman.com/network/private")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Successful Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getpostman.com/network/private', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/network/private");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/network/private")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```