---
title: "createOrgGroup"
---

> Documentation Index
> Fetch the complete documentation index at: https://buildrforge.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# createOrgGroup

Path: Forge API › groups

`POST /orgs/{org_id}/groups`

Create a group. Its name is unique in the org, ignoring case. Takes manageGroups on the org.

## Path parameters

- `org_id` (`createOrgGroup.path.org_id`; string, required)
  - pattern: `^org_[0-7][0-9a-hjkmnp-tv-z]{25}$`

## Request body

_Required._

- `name` (`createOrgGroup.name`; string, required)
  - minLength: `1` · pattern: `^\S[\s\S]*\S$|^\S$|^$`

## Example request

```json
{
  "name": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/orgs/<org_id>/groups' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string"
}
'
```

### TypeScript

```typescript
const url = '<base-url>/orgs/<org_id>/groups';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({name: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/orgs/<org_id>/groups"

payload = { "name": "string" }
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 201

OrgGroup

#### Example

```json
{
  "id": "string",
  "name": "string",
  "is_default": true
}
```

- `id` (`createOrgGroup.response.201.id`; string, required)
  - pattern: `^group_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `name` (`createOrgGroup.response.201.name`; string, required)
  - minLength: `1` · pattern: `^\S[\s\S]*\S$|^\S$|^$`
- `is_default` (`createOrgGroup.response.201.is_default`; boolean, required)

### 400

InvalidRequest | RequestBodyTooDeep

#### Example

```json
{
  "_tag": "InvalidRequest",
  "part": "path",
  "issues": [
    {
      "path": [
        "string"
      ],
      "message": "string"
    }
  ]
}
```

Any of the following:

- `InvalidRequestEncoded`
  - `_tag` (`InvalidRequestEncoded._tag`; string, required)
    - one of `"InvalidRequest"`
  - `part` (`InvalidRequestEncoded.part`; string, required)
    - one of `"path"`, `"query"`, `"headers"`, `"body"`
  - `issues` (`InvalidRequestEncoded.issues`; array of object, required)
    - `path` (`InvalidRequestEncoded.issues.path`; array\<any of\>, required)
      - any of the following: `string`, `integer`
    - `message` (`InvalidRequestEncoded.issues.message`; string, required)
- `RequestBodyTooDeepEncoded`
  - `_tag` (`RequestBodyTooDeepEncoded._tag`; string, required)
    - one of `"RequestBodyTooDeep"`
  - `max_depth` (`RequestBodyTooDeepEncoded.max_depth`; integer, required)
    - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 401

InvalidCredentials

#### Example

```json
{
  "_tag": "InvalidCredentials"
}
```

- `_tag` (`createOrgGroup.response.401._tag`; string, required)
  - one of `"InvalidCredentials"`

### 403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired

#### Example

```json
{
  "_tag": "Forbidden",
  "message": "string"
}
```

Any of the following:

- `ForbiddenEncoded`
  - `_tag` (`ForbiddenEncoded._tag`; string, required)
    - one of `"Forbidden"`
  - `message` (`ForbiddenEncoded.message`; string, required)
- `ForbiddenOriginEncoded`
  - `_tag` (`ForbiddenOriginEncoded._tag`; string, required)
    - one of `"ForbiddenOrigin"`
- `RequiresPersonalSessionEncoded`
  - `_tag` (`RequiresPersonalSessionEncoded._tag`; string, required)
    - one of `"RequiresPersonalSession"`
- `RunBranchRequiredEncoded`
  - `_tag` (`RunBranchRequiredEncoded._tag`; string, required)
    - one of `"RunBranchRequired"`
  - `branch` (`RunBranchRequiredEncoded.branch`; string, required)
    - minLength: `1`
  - `message` (`RunBranchRequiredEncoded.message`; string, required)

### 404

OrgNotFound

#### Example

```json
{
  "_tag": "OrgNotFound"
}
```

- `_tag` (`createOrgGroup.response.404._tag`; string, required)
  - one of `"OrgNotFound"`

### 409

GroupNameTaken

#### Example

```json
{
  "_tag": "GroupNameTaken",
  "group_id": "string",
  "group_name": "string"
}
```

- `_tag` (`createOrgGroup.response.409._tag`; string, required)
  - one of `"GroupNameTaken"`
- `group_id` (`createOrgGroup.response.409.group_id`; string, required)
  - pattern: `^group_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `group_name` (`createOrgGroup.response.409.group_name`; string, required)
  - minLength: `1`

### 413

RequestBodyTooLarge

#### Example

```json
{
  "_tag": "RequestBodyTooLarge",
  "max_bytes": -9007199254740991
}
```

- `_tag` (`createOrgGroup.response.413._tag`; string, required)
  - one of `"RequestBodyTooLarge"`
- `max_bytes` (`createOrgGroup.response.413.max_bytes`; integer, required)
  - maximum: `9007199254740991` · minimum: `-9007199254740991`

### 429

RateLimited

#### Example

```json
{
  "_tag": "RateLimited"
}
```

- `_tag` (`createOrgGroup.response.429._tag`; string, required)
  - one of `"RateLimited"`

### 500

OrgFailure

#### Example

```json
{
  "_tag": "OrgFailure",
  "reason": "string"
}
```

- `_tag` (`createOrgGroup.response.500._tag`; string, required)
  - one of `"OrgFailure"`
- `reason` (`createOrgGroup.response.500.reason`; string, required)

### 503

SessionUnavailable | RateLimitUnavailable

#### Example

```json
{
  "_tag": "SessionUnavailable"
}
```

Any of the following:

- `SessionUnavailableEncoded`
  - `_tag` (`SessionUnavailableEncoded._tag`; string, required)
    - one of `"SessionUnavailable"`
- `RateLimitUnavailableEncoded`
  - `_tag` (`RateLimitUnavailableEncoded._tag`; string, required)
    - one of `"RateLimitUnavailable"`


Source: https://buildrforge.com/docs/api/create-org-group/index.md
