> 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 governance group

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

Creates a custom governance group for the team.

Reference: https://learning.postman.com/api-docs/api-reference/api-governance/create-governance-group

## 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 governanceGroupCreate.

- `name` (string, required) — The governance group's name. Must be unique within the team.
- `description` (string, optional) — The governance group's description.

## Response

### 201

Governance Group Created

- `id` (string, required) — The resource's ID.

## Errors

### 400 Bad Request Error

Bad Request

- `CreateGovernanceGroupRequestBadRequestError`

### 401 Unauthorized Error

Unauthorized

- `CreateGovernanceGroupRequestUnauthorizedError`

### 403 Forbidden Error

Forbidden

- `CreateGovernanceGroupRequestForbiddenError`

### 409 Conflict Error

Conflict

- `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.

### 500 Internal Server Error

Internal Server Error

- `CreateGovernanceGroupRequestInternalServerError`

## Types

### commonErrorTypeTitleDetail

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

### 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.

### commonErrorNameMessageDetails

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

### commonErrorNameMessage

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

### CommonErrorTypeTitleDetailStatusType

The type of error.

### CommonErrorTypeTitleDetailDetail

Information about the error.

### CommonErrorNameMessageDetailsError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.
- `details` (CommonErrorNameMessageDetailsErrorDetails, optional) — Information about the error.

### CommonErrorNameMessageError

Information about the error.

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

### CommonErrorNameMessageDetailsErrorDetails

Information about the error.

## Examples

### Governance Group Created

**Request**

```json
undefined
```

**Response**

```json
{
  "id": "01JWSGROUP0123456789ABCDEF"
}
```

**SDK Code**

```python Governance Group Created
import requests

url = "https://api.postman.com/governance-groups"

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

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

print(response.json())
```

```javascript Governance Group Created
const url = 'https://api.postman.com/governance-groups';
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 Governance Group Created
package main

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

func main() {

	url := "https://api.postman.com/governance-groups"

	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 Governance Group Created
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/governance-groups")

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 Governance Group Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Governance Group Created
using RestSharp;

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

```swift Governance Group Created
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/governance-groups")! 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 Governance Group

**Request**

```json
{
  "name": "Payments workspaces",
  "description": "All payments-related workspaces."
}
```

**Response**

```json
{
  "id": "01JWSGROUP0123456789ABCDEF"
}
```

**SDK Code**

```python Create Governance Group
import requests

url = "https://api.postman.com/governance-groups"

payload = {
    "name": "Payments workspaces",
    "description": "All payments-related workspaces."
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Create Governance Group
const url = 'https://api.postman.com/governance-groups';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Payments workspaces","description":"All payments-related workspaces."}'
};

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

```go Create Governance Group
package main

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

func main() {

	url := "https://api.postman.com/governance-groups"

	payload := strings.NewReader("{\n  \"name\": \"Payments workspaces\",\n  \"description\": \"All payments-related workspaces.\"\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 Governance Group
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/governance-groups")

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  \"name\": \"Payments workspaces\",\n  \"description\": \"All payments-related workspaces.\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.postman.com/governance-groups")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Payments workspaces\",\n  \"description\": \"All payments-related workspaces.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.postman.com/governance-groups', [
  'body' => '{
  "name": "Payments workspaces",
  "description": "All payments-related workspaces."
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Create Governance Group
using RestSharp;

var client = new RestClient("https://api.postman.com/governance-groups");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Payments workspaces\",\n  \"description\": \"All payments-related workspaces.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Governance Group
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Payments workspaces",
  "description": "All payments-related workspaces."
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/governance-groups")! 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()
```