> 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 a workspace

GET https://api.getpostman.com/workspaces/{workspaceId}

Gets information about a workspace.

**Note:**

This endpoint's response contains the `visibility` field. [Visibility](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#changing-workspace-visibility) determines who can access the workspace:
- `personal` — Only you can access the workspace.
- `team` — All team members can access the workspace.
- `private` — Only invited team members can access the workspace ([**Team** and **Enterprise** plans only](https://www.postman.com/pricing)).
- `public` — Everyone can access the workspace.
- `partner` — Only invited team members and [partners](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/) can access the workspace ([**Team** and **Enterprise** plans only](https://www.postman.com/pricing)).


Reference: https://learning.postman.com/api-docs/api-reference/workspaces/get-workspace

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /workspaces/{workspaceId}:
    get:
      operationId: getWorkspace
      summary: Get a workspace
      description: >
        Gets information about a workspace.


        **Note:**


        This endpoint's response contains the `visibility` field.
        [Visibility](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#changing-workspace-visibility)
        determines who can access the workspace:

        - `personal` — Only you can access the workspace.

        - `team` — All team members can access the workspace.

        - `private` — Only invited team members can access the workspace
        ([**Team** and **Enterprise** plans
        only](https://www.postman.com/pricing)).

        - `public` — Everyone can access the workspace.

        - `partner` — Only invited team members and
        [partners](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/)
        can access the workspace ([**Team** and **Enterprise** plans
        only](https://www.postman.com/pricing)).
      tags:
        - workspaces
      parameters:
        - name: workspaceId
          in: path
          description: The workspace's ID.
          required: true
          schema:
            $ref: '#/components/schemas/workspaceId'
        - name: include
          in: query
          description: >
            Include the following information in the endpoint's response:

            - `mocks:deactivated` — Include all deactivated mock servers in the
            response.

            - `scim` — Return the SCIM user IDs of the workspace creator and who
            last modified it.
          required: false
          schema:
            $ref: '#/components/schemas/workspaceIncludeQuery'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getWorkspace'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWorkspaceRequestUnauthorizedError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/workspace404Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetWorkspaceRequestInternalServerError'
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:
    workspaceId:
      type: string
      title: workspaceId
    workspaceIncludeQuery:
      type: string
      enum:
        - mocks:deactivated
        - scim
      title: workspaceIncludeQuery
    GetWorkspaceWorkspaceType:
      type: string
      enum:
        - personal
        - team
        - private
        - public
        - partner
      description: The type of workspace.
      title: GetWorkspaceWorkspaceType
    GetWorkspaceWorkspaceVisibility:
      type: string
      enum:
        - personal
        - team
        - private
        - public
        - partner
      description: >
        The workspace's visibility.
        [Visibility](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#changing-workspace-visibility)
        determines who can access the workspace:

        - `personal` — Only you can access the workspace.

        - `team` — All team members can access the workspace.

        - `private` — Only invited team members can access the workspace
        ([**Team** and **Enterprise** plans
        only](https://www.postman.com/pricing)).

        - `public` — Everyone can access the workspace.

        - `partner` — Only invited team members and
        [partners](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/)
        can access the workspace ([**Team** and **Enterprise** plans
        only](https://www.postman.com/pricing)).
      title: GetWorkspaceWorkspaceVisibility
    GetWorkspaceWorkspaceCollectionsItems:
      type: object
      properties:
        id:
          type: string
          description: The collection's ID.
        name:
          type: string
          description: The collection's name.
        uid:
          type: string
          format: uid
          description: The collection's unique ID.
      description: Information about the collection.
      title: GetWorkspaceWorkspaceCollectionsItems
    GetWorkspaceWorkspaceEnvironmentsItems:
      type: object
      properties:
        id:
          type: string
          description: The environment's ID.
        name:
          type: string
          description: The environment's name.
        uid:
          type: string
          format: uid
          description: The environment's unique ID.
      description: Information about the environment.
      title: GetWorkspaceWorkspaceEnvironmentsItems
    GetWorkspaceWorkspaceMocksItems:
      type: object
      properties:
        id:
          type: string
          description: The mock server's ID.
        name:
          type: string
          description: The mock server's name.
        uid:
          type: string
          format: uid
          description: The mock server's unique ID.
        deactivated:
          type: boolean
          description: >-
            If true, the mock server is not active. Mock servers deactivate when
            a linked collection or environment is deleted.
      description: Information about the mock server.
      title: GetWorkspaceWorkspaceMocksItems
    GetWorkspaceWorkspaceMonitorsItems:
      type: object
      properties:
        id:
          type: string
          description: The monitor's ID.
        name:
          type: string
          description: The monitor's name.
        uid:
          type: string
          format: uid
          description: The monitor's unique ID.
        deactivated:
          type: boolean
          description: If true, the monitor is not active.
      description: Information about the monitor.
      title: GetWorkspaceWorkspaceMonitorsItems
    GetWorkspaceWorkspaceSpecsItems:
      type: object
      properties:
        id:
          type: string
          description: The API specification's ID.
        name:
          type: string
          description: The API specification's name.
        uid:
          type: string
          format: uid
          description: The API specification's unique ID.
      description: Information about the API specification.
      title: GetWorkspaceWorkspaceSpecsItems
    GetWorkspaceWorkspaceScim:
      type: object
      properties:
        createdBy:
          type: string
          description: The SCIM user ID of the user who created the workspace.
        updatedBy:
          type: string
          description: The SCIM user ID of the user who last updated the workspace.
      description: >-
        An object containing SCIM user IDs. This object only returns if you pass
        the `include=scim` query parameter.
      title: GetWorkspaceWorkspaceScim
    GetWorkspaceWorkspace:
      type: object
      properties:
        id:
          type: string
          description: The workspace's ID.
        name:
          type: string
          description: The workspace's name.
        type:
          $ref: '#/components/schemas/GetWorkspaceWorkspaceType'
          description: The type of workspace.
        description:
          type: string
          description: The workspace's description.
        visibility:
          $ref: '#/components/schemas/GetWorkspaceWorkspaceVisibility'
          description: >
            The workspace's visibility.
            [Visibility](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/managing-workspaces/#changing-workspace-visibility)
            determines who can access the workspace:

            - `personal` — Only you can access the workspace.

            - `team` — All team members can access the workspace.

            - `private` — Only invited team members can access the workspace
            ([**Team** and **Enterprise** plans
            only](https://www.postman.com/pricing)).

            - `public` — Everyone can access the workspace.

            - `partner` — Only invited team members and
            [partners](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/)
            can access the workspace ([**Team** and **Enterprise** plans
            only](https://www.postman.com/pricing)).
        createdBy:
          type: string
          description: The user ID of the user who created the workspace.
        updatedBy:
          type: string
          description: The user ID of the user who last updated the workspace.
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the workspace was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the workspace was last updated.
        about:
          type: string
          description: A brief summary about the workspace.
        collections:
          type: array
          items:
            $ref: '#/components/schemas/GetWorkspaceWorkspaceCollectionsItems'
          description: The workspace's collections.
        environments:
          type: array
          items:
            $ref: '#/components/schemas/GetWorkspaceWorkspaceEnvironmentsItems'
          description: The workspace's environments.
        mocks:
          type: array
          items:
            $ref: '#/components/schemas/GetWorkspaceWorkspaceMocksItems'
          description: The workspace's mock servers.
        monitors:
          type: array
          items:
            $ref: '#/components/schemas/GetWorkspaceWorkspaceMonitorsItems'
          description: The workspace's monitors.
        specs:
          type: array
          items:
            $ref: '#/components/schemas/GetWorkspaceWorkspaceSpecsItems'
          description: The workspace's API specifications.
        scim:
          $ref: '#/components/schemas/GetWorkspaceWorkspaceScim'
          description: >-
            An object containing SCIM user IDs. This object only returns if you
            pass the `include=scim` query parameter.
      description: Information about the workspace.
      title: GetWorkspaceWorkspace
    getWorkspace:
      type: object
      properties:
        workspace:
          $ref: '#/components/schemas/GetWorkspaceWorkspace'
          description: Information about the workspace.
      title: getWorkspace
    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
    GetWorkspaceRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetWorkspaceRequestUnauthorizedError
    Workspace404ErrorError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
        statusCode:
          type: number
          format: double
          description: The error's HTTP status code.
      title: Workspace404ErrorError
    workspace404Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Workspace404ErrorError'
      title: workspace404Error
    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
    GetWorkspaceRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetWorkspaceRequestInternalServerError
  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

### Successful Response



**Response**

```json
{
  "workspace": {
    "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "visibility": "team",
    "createdBy": "12345678",
    "updatedBy": "12345678",
    "createdAt": "2022-07-06T16:18:32.000Z",
    "updatedAt": "2022-07-06T20:55:13.000Z",
    "about": "Team workspace.",
    "collections": [
      {
        "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
        "name": "Test Collection",
        "uid": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2"
      }
    ],
    "environments": [
      {
        "id": "5daabc50-8451-43f6-922d-96b403b4f28e",
        "name": "Test Environment",
        "uid": "12345678-5daabc50-8451-43f6-922d-96b403b4f28e"
      }
    ],
    "mocks": [
      {
        "id": "e3d951bf-873f-49ac-a658-b2dcb91d3289",
        "name": "Test Mock",
        "uid": "12345678-e3d951bf-873f-49ac-a658-b2dcb91d3289",
        "deactivated": false
      }
    ],
    "monitors": [
      {
        "id": "1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
        "name": "Test Monitor",
        "uid": "12345678-1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
        "deactivated": false
      }
    ],
    "specs": [
      {
        "id": "73e15000-bc7a-4802-b80e-05fff18fd7f8",
        "name": "Sample API",
        "uid": "12345678-73e15000-bc7a-4802-b80e-05fff18fd7f8"
      }
    ],
    "apis": [
      {
        "id": "387c2863-6ee3-4a56-8210-225f774edade",
        "name": "Test API",
        "uid": "12345678-387c2863-6ee3-4a56-8210-225f774edade"
      }
    ]
  }
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"

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

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9';
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/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"

	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/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9")

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/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9")
  .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/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9");
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/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9")! 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()
```

### Include SCIM IDs



**Response**

```json
{
  "workspace": {
    "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "visibility": "team",
    "createdBy": "12345678",
    "updatedBy": "12345678",
    "createdAt": "2022-07-06T16:18:32.000Z",
    "updatedAt": "2022-07-06T20:55:13.000Z",
    "about": "Team workspace.",
    "collections": [
      {
        "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
        "name": "Test Collection",
        "uid": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2"
      }
    ],
    "environments": [
      {
        "id": "5daabc50-8451-43f6-922d-96b403b4f28e",
        "name": "Test Environment",
        "uid": "12345678-5daabc50-8451-43f6-922d-96b403b4f28e"
      }
    ],
    "mocks": [
      {
        "id": "e3d951bf-873f-49ac-a658-b2dcb91d3289",
        "name": "Test Mock",
        "uid": "12345678-e3d951bf-873f-49ac-a658-b2dcb91d3289",
        "deactivated": false
      }
    ],
    "monitors": [
      {
        "id": "1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
        "name": "Test Monitor",
        "uid": "12345678-1e6b6cc1-c760-48e0-968f-4bfaeeae9af1",
        "deactivated": false
      }
    ],
    "specs": [
      {
        "id": "73e15000-bc7a-4802-b80e-05fff18fd7f8",
        "name": "Sample API",
        "uid": "12345678-73e15000-bc7a-4802-b80e-05fff18fd7f8"
      }
    ],
    "scim": {
      "createdBy": "405775fe15ed41872a8eea4c8aa2b38cda9749812cc55c99",
      "updatedBy": "405775fe15ed41872a8eea4c8aa2b38cda9749812cc55c99"
    },
    "apis": [
      {
        "id": "387c2863-6ee3-4a56-8210-225f774edade",
        "name": "Test API",
        "uid": "12345678-387c2863-6ee3-4a56-8210-225f774edade"
      }
    ]
  }
}
```

**SDK Code**

```python Include SCIM IDs
import requests

url = "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"

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

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

print(response.json())
```

```javascript Include SCIM IDs
const url = 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9';
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 Include SCIM IDs
package main

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

func main() {

	url := "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"

	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 Include SCIM IDs
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9")

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 Include SCIM IDs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Include SCIM IDs
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Include SCIM IDs
using RestSharp;

var client = new RestClient("https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Include SCIM IDs
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/workspaces/1f0df51a-8658-4ee8-a2a1-d2567dfa09a9")! 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()
```