---
title: "createOrgInvite"
---

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

# createOrgInvite

Path: Forge API › invites

`POST /orgs/{org_id}/invites`

Invite an email to the org as a member or an owner, in the groups you name, and email it the invite's link. A member who accepts with none of the invite's groups left, or with none named, joins the org's default group, if the org has one; an owner does not. Inviting an email with a pending invite resends it with this role and these groups. Takes inviteMembers on the org; an owner invite takes owning the org, and groups take manageGroups.

## Path parameters

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

## Request body

_Required._

- `email` (`createOrgInvite.email`; string, required)
  - pattern: `^[^\s@]+@[^\s@]+\.[^\s@]+$`
- `owner` (`createOrgInvite.owner`; boolean, required)
- `group_ids` (`createOrgInvite.group_ids`; array of string, required)
  - pattern: `^group_[0-7][0-9a-hjkmnp-tv-z]{25}$`

## Example request

```json
{
  "email": "string",
  "owner": true,
  "group_ids": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/orgs/<org_id>/invites' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "string",
  "owner": true,
  "group_ids": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = '<base-url>/orgs/<org_id>/invites';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({email: 'string', owner: true, group_ids: ['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>/invites"

payload = {
    "email": "string",
    "owner": True,
    "group_ids": ["string"]
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 201

OrgInvite

#### Example

```json
{
  "id": "string",
  "email": "string",
  "owner": true,
  "group_ids": [
    "string"
  ],
  "invited_by": "string",
  "invited_by_name": "string",
  "created_at": "string",
  "expires_at": "string"
}
```

- `id` (`createOrgInvite.response.201.id`; string, required)
  - pattern: `^invite_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `email` (`createOrgInvite.response.201.email`; string, required)
  - pattern: `^[^\s@]+@[^\s@]+\.[^\s@]+$`
- `owner` (`createOrgInvite.response.201.owner`; boolean, required)
- `group_ids` (`createOrgInvite.response.201.group_ids`; array of string, required)
  - pattern: `^group_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `invited_by` (`createOrgInvite.response.201.invited_by`; string, required)
  - pattern: `^(?:user|extension)_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `invited_by_name` (`createOrgInvite.response.201.invited_by_name`; string, required)
  - minLength: `1`
- `created_at` (`createOrgInvite.response.201.created_at`; string, required)
  - minLength: `1`
- `expires_at` (`createOrgInvite.response.201.expires_at`; string, required)
  - minLength: `1`

### 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` (`createOrgInvite.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 | GroupNotFound

#### Example

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

Any of the following:

- `OrgNotFoundEncoded`
  - `_tag` (`OrgNotFoundEncoded._tag`; string, required)
    - one of `"OrgNotFound"`
- `GroupNotFoundEncoded`
  - `_tag` (`GroupNotFoundEncoded._tag`; string, required)
    - one of `"GroupNotFound"`

### 409

AlreadyMember

#### Example

```json
{
  "_tag": "AlreadyMember"
}
```

- `_tag` (`createOrgInvite.response.409._tag`; string, required)
  - one of `"AlreadyMember"`

### 413

RequestBodyTooLarge

#### Example

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

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

### 429

RateLimited

#### Example

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

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

### 500

OrgFailure | ControlPlaneFailure

#### Example

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

Every option has:

- `reason` (`<option>.reason`; string, required)

Any of the following, each adding:

- `OrgFailureEncoded`
  - `_tag` (`OrgFailureEncoded._tag`; string, required)
    - one of `"OrgFailure"`
- `ControlPlaneFailureEncoded`
  - `_tag` (`ControlPlaneFailureEncoded._tag`; string, required)
    - one of `"ControlPlaneFailure"`

### 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-invite/index.md
