> This page is for Postman API Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Create a workspace

POST https://api.postman.com/workspaces
Content-Type: application/json

Creates a new [workspace](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/creating-workspaces/).

**Note:**

- This endpoint returns a 403 `Forbidden` response if the user does not have permission to create workspaces. [Admins and Super Admins](https://learning.postman.com/docs/collaborating-in-postman/roles-and-permissions/#team-roles) can configure workspace permissions to restrict users and/or user groups from creating workspaces or require approvals for the creation of team workspaces.
- Private and [Partner Workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/) are available on Postman [**Team** and **Enterprise** plans](https://www.postman.com/pricing).
- There are rate limits when publishing public workspaces.
- Public team workspace names must be unique.
- The `teamId` property must be passed in the request body if [Postman Organizations](https://learning.postman.com/docs/administration/onboarding-checklist) is enabled.


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

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Body (application/json)

This endpoint expects a createWorkspace.

- `workspace` (createWorkspaceData, optional) — Information about the workspace.

## Response

### 200

Successful Response

- `workspace` (CreateWorkspaceResponseWorkspace, optional) — Information about the created workspace.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### 401 Unauthorized Error

Unauthorized

- `CreateWorkspaceRequestUnauthorizedError`
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

### 403 Forbidden Error

Forbidden

- `error` (Workspace403ErrorError, optional) — Information about the error.

### 429 Too Many Requests Error

Rate Limit Exceeded

- `error` (string, optional) — The error type.
- `message` (string, optional) — The error message.

### 500 Internal Server Error

Internal Server Error

- `CreateWorkspaceRequestInternalServerError`
  - Error (Type, Title, Detail): commonErrorTypeTitleDetail
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

## Types

### createWorkspaceData

Information about the workspace.

- `name` (string, required) — The workspace's name.
- `type` (enum, required) — The type of workspace: - `personal` - `private` — Private workspaces are available on Postman [**Team** and **Enterprise** plans](https://www.postman.com/pricing). - `public` - `team` - `partner` — [Partner Workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/) are available on Postman [**Team** and **Enterprise** plans](https://www.postman.com/pricing)).
  - Allowed values: `personal`, `private`, `public`, `team`, `partner`
- `description` (string, optional) — The workspace's description.
- `about` (string, optional) — A brief summary about the workspace.
- `teamId` (string, optional) — The team ID to assign to the workspace. This property is required if Postman [Organizations](https://learning.postman.com/docs/administration/managing-your-team/overview) is enabled.

### CreateWorkspaceResponseWorkspace

Information about the created workspace.

- `id` (string, optional) — The workspace's ID.
- `name` (string, optional) — The workspace's name.

### CommonErrorNameMessageError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### commonErrorTypeTitleDetailStatus

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### commonErrorNameMessage

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### Workspace403ErrorError

Information about the error.

- `status` (double, optional) — The error's HTTP status code.
- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.
- `detail` (string, optional) — Information about the error.
- `instance` (string, optional) — The URI reference that identifies the specific occurrence of the problem.

### commonErrorTypeTitleDetail

- `type` (string, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (CommonErrorTypeTitleDetailDetail, optional) — Information about the error.

### CommonErrorTypeTitleDetailStatusType

The type of error.

- string
- string

### CommonErrorTypeTitleDetailDetail

Information about the error.

- string
- map from string to any

## Examples

### Workspace Created

**Response**

```json
{
  "workspace": {
    "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
    "name": "Team Workspace"
  }
}
```

**SDK Code**

```python Workspace Created
import requests

url = "https://api.postman.com/workspaces"

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

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

print(response.json())
```

```javascript Workspace Created
const url = 'https://api.postman.com/workspaces';
const options = {method: 'POST', 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 Workspace Created
package main

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

func main() {

	url := "https://api.postman.com/workspaces"

	req, _ := http.NewRequest("POST", 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 Workspace Created
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/workspaces")

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

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

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

```java Workspace Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/workspaces")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Workspace Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/workspaces', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Workspace Created
using RestSharp;

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

```swift Workspace Created
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/workspaces")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### Create Workspace

**Request**

```json
{
  "workspace": {
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "about": "Team workspace."
  }
}
```

**Response**

```json
{
  "workspace": {
    "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
    "name": "Team Workspace"
  }
}
```

**SDK Code**

```python Create Workspace
import requests

url = "https://api.postman.com/workspaces"

payload = { "workspace": {
        "name": "Team Workspace",
        "type": "team",
        "description": "This is a team workspace.",
        "about": "Team workspace."
    } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create Workspace
const url = 'https://api.postman.com/workspaces';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"workspace":{"name":"Team Workspace","type":"team","description":"This is a team workspace.","about":"Team workspace."}}'
};

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

```go Create Workspace
package main

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

func main() {

	url := "https://api.postman.com/workspaces"

	payload := strings.NewReader("{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Create Workspace
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/workspaces")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\"\n  }\n}"

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

```java Create Workspace
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/workspaces")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\"\n  }\n}")
  .asString();
```

```php Create Workspace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/workspaces', [
  'body' => '{
  "workspace": {
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "about": "Team workspace."
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Create Workspace
using RestSharp;

var client = new RestClient("https://api.postman.com/workspaces");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Workspace
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["workspace": [
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "about": "Team workspace."
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/workspaces")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Create Workspace in a Team

**Request**

```json
{
  "workspace": {
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "about": "Team workspace.",
    "teamId": "1234"
  }
}
```

**Response**

```json
{
  "workspace": {
    "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
    "name": "Team Workspace"
  }
}
```

**SDK Code**

```python Create Workspace in a Team
import requests

url = "https://api.postman.com/workspaces"

payload = { "workspace": {
        "name": "Team Workspace",
        "type": "team",
        "description": "This is a team workspace.",
        "about": "Team workspace.",
        "teamId": "1234"
    } }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create Workspace in a Team
const url = 'https://api.postman.com/workspaces';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"workspace":{"name":"Team Workspace","type":"team","description":"This is a team workspace.","about":"Team workspace.","teamId":"1234"}}'
};

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

```go Create Workspace in a Team
package main

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

func main() {

	url := "https://api.postman.com/workspaces"

	payload := strings.NewReader("{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\",\n    \"teamId\": \"1234\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby Create Workspace in a Team
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/workspaces")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\",\n    \"teamId\": \"1234\"\n  }\n}"

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

```java Create Workspace in a Team
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.postman.com/workspaces")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\",\n    \"teamId\": \"1234\"\n  }\n}")
  .asString();
```

```php Create Workspace in a Team
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/workspaces', [
  'body' => '{
  "workspace": {
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "about": "Team workspace.",
    "teamId": "1234"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Create Workspace in a Team
using RestSharp;

var client = new RestClient("https://api.postman.com/workspaces");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"workspace\": {\n    \"name\": \"Team Workspace\",\n    \"type\": \"team\",\n    \"description\": \"This is a team workspace.\",\n    \"about\": \"Team workspace.\",\n    \"teamId\": \"1234\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Workspace in a Team
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["workspace": [
    "name": "Team Workspace",
    "type": "team",
    "description": "This is a team workspace.",
    "about": "Team workspace.",
    "teamId": "1234"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/workspaces")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```