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

## Servers

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

## Request

### Body (application/json)

- `workspace` (object, optional) — 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.

## Response

### 200

Successful Response

- `workspace` (object, optional) — Information about the created workspace.
  - `id` (string, optional) — The workspace's ID.
  - `name` (string, optional) — The workspace's name.

## Examples

### Workspace Created

**Request**

```json
undefined
```

**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>",
    "Content-Type": "application/json"
}

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>', 'Content-Type': 'application/json'},
  body: undefined
};

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>")
	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 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>'
request["Content-Type"] = 'application/json'

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>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/workspaces', [
  'headers' => [
    'Content-Type' => 'application/json',
    '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>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Workspace Created
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

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