---
title: "createOrgConnectionRequest"
---

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

# createOrgConnectionRequest

Path: Forge API › connections

`POST /orgs/{org_id}/connection-requests`

Request a connection to a provider, and answer the link where a person signs in to complete it. A member whom the org allows createConnections may ask. audience is org to share the connection with the org, or user to keep it to you. extension_name names the extension it is for, whose latest release's provider reads the credentials' health; it is refused when no published version of that extension, a branch's prerelease included, declares a connection to the provider.

## Path parameters

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

## Request body

_Required._

- `provider_id` (`createOrgConnectionRequest.provider_id`; string, required)
  - pattern: `^prv_[0-9a-f]{64}$`
- `audience` (`createOrgConnectionRequest.audience`; string, required)
  - one of `"org"`, `"user"`
- `extension_name` (`createOrgConnectionRequest.extension_name`; string, optional)
  - maxLength: `129` · pattern: `^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$`
- `expires_in_seconds` (`createOrgConnectionRequest.expires_in_seconds`; integer, optional)
  - maximum: `1800` · minimum: `1`

## Example request

```json
{
  "provider_id": "string",
  "audience": "org",
  "extension_name": "string",
  "expires_in_seconds": 1
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url '<base-url>/orgs/<org_id>/connection-requests' \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider_id": "string",
  "audience": "org",
  "extension_name": "string",
  "expires_in_seconds": 1
}
'
```

### TypeScript

```typescript
const url = '<base-url>/orgs/<org_id>/connection-requests';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    provider_id: 'string',
    audience: 'org',
    extension_name: 'string',
    expires_in_seconds: 1
  })
};

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>/connection-requests"

payload = {
    "provider_id": "string",
    "audience": "org",
    "extension_name": "string",
    "expires_in_seconds": 1
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 201

CreatedConnectionRequest

#### Example

```json
{
  "id": "string",
  "provider": {
    "id": "string",
    "definition": {
      "name": "string",
      "auth": {
        "property1": {
          "type": "secrets",
          "label": "string",
          "fields": {},
          "plain": [
            "string"
          ],
          "raw": [
            "string"
          ],
          "request": [
            {
              "in": "header",
              "name": "string",
              "value": [
                null
              ]
            }
          ],
          "sign_in": {
            "url": "string",
            "check": "string",
            "username": "string",
            "password": "string"
          }
        },
        "property2": {
          "type": "secrets",
          "label": "string",
          "fields": {},
          "plain": [
            "string"
          ],
          "raw": [
            "string"
          ],
          "request": [
            {
              "in": "header",
              "name": "string",
              "value": [
                null
              ]
            }
          ],
          "sign_in": {
            "url": "string",
            "check": "string",
            "username": "string",
            "password": "string"
          }
        }
      },
      "hosts": [
        "string"
      ]
    }
  },
  "audience": "org",
  "status": "pending",
  "extension_name": "string",
  "connection_id": "string",
  "oauth": [
    {
      "method": "string",
      "issuer": "string",
      "client": {
        "client_id": "string",
        "managed": true
      }
    }
  ],
  "created_by_id": "string",
  "created_at": "string",
  "expires_at": "string",
  "link": "string"
}
```

- `id` (`createOrgConnectionRequest.response.201.id`; string, required)
  - pattern: `^connection_request_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `provider` (`createOrgConnectionRequest.response.201.provider`; object, required)
  - `id` (`createOrgConnectionRequest.response.201.provider.id`; string, required)
    - pattern: `^prv_[0-9a-f]{64}$`
  - `definition` (`createOrgConnectionRequest.response.201.provider.definition`; object, required)
    - `name` (`createOrgConnectionRequest.response.201.provider.definition.name`; string, required)
      - minLength: `1`
    - `auth` (`createOrgConnectionRequest.response.201.provider.definition.auth`; map of AuthMethodDefinition, required)
    - `hosts` (`createOrgConnectionRequest.response.201.provider.definition.hosts`; array of string, required)
      - pattern: `^(\*\.(?=[^.:]+\.))?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*(?::[1-9][0-9]{0,4})?$`
- `audience` (`createOrgConnectionRequest.response.201.audience`; string, required)
  - one of `"org"`, `"user"`
- `status` (`createOrgConnectionRequest.response.201.status`; string, required)
  - one of `"pending"`, `"completed"`, `"expired"`
- `extension_name` (`createOrgConnectionRequest.response.201.extension_name`; any of, required)
  - any of the following: `string`, `null`
- `connection_id` (`createOrgConnectionRequest.response.201.connection_id`; any of, required)
  - any of the following: `ConnectionId`, `null`
- `oauth` (`createOrgConnectionRequest.response.201.oauth`; array of object, required)
  - `method` (`createOrgConnectionRequest.response.201.oauth.method`; string, required)
    - minLength: `1`
  - `issuer` (`createOrgConnectionRequest.response.201.oauth.issuer`; string, required)
  - `client` (`createOrgConnectionRequest.response.201.oauth.client`; any of, required)
    - any of the following:
      - `object`
        - `client_id` (`createOrgConnectionRequest.response.201.oauth.client.1.client_id`; string, required)
        - `managed` (`createOrgConnectionRequest.response.201.oauth.client.1.managed`; boolean, required)
      - `null`
- `created_by_id` (`createOrgConnectionRequest.response.201.created_by_id`; string, required)
  - pattern: `^(?:user|extension)_[0-7][0-9a-hjkmnp-tv-z]{25}$`
- `created_at` (`createOrgConnectionRequest.response.201.created_at`; string, required)
- `expires_at` (`createOrgConnectionRequest.response.201.expires_at`; string, required)
- `link` (`createOrgConnectionRequest.response.201.link`; string, 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` (`createOrgConnectionRequest.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

ProviderNotFound | ExtensionNotFound | OrgNotFound

#### Example

```json
{
  "_tag": "ProviderNotFound",
  "provider_id": "string"
}
```

Any of the following:

- `ProviderNotFoundEncoded`
  - `_tag` (`ProviderNotFoundEncoded._tag`; string, required)
    - one of `"ProviderNotFound"`
  - `provider_id` (`ProviderNotFoundEncoded.provider_id`; string, required)
    - pattern: `^prv_[0-9a-f]{64}$`
- `ExtensionNotFoundEncoded`
  - `_tag` (`ExtensionNotFoundEncoded._tag`; string, required)
    - one of `"ExtensionNotFound"`
  - `extension_name` (`ExtensionNotFoundEncoded.extension_name`; string, required)
    - minLength: `1`
- `OrgNotFoundEncoded`
  - `_tag` (`OrgNotFoundEncoded._tag`; string, required)
    - one of `"OrgNotFound"`

### 409

ProviderNotDeclared

#### Example

```json
{
  "_tag": "ProviderNotDeclared",
  "extension_name": "string",
  "provider_id": "string",
  "message": "string"
}
```

- `_tag` (`createOrgConnectionRequest.response.409._tag`; string, required)
  - one of `"ProviderNotDeclared"`
- `extension_name` (`createOrgConnectionRequest.response.409.extension_name`; string, required)
- `provider_id` (`createOrgConnectionRequest.response.409.provider_id`; string, required)
  - pattern: `^prv_[0-9a-f]{64}$`
- `message` (`createOrgConnectionRequest.response.409.message`; string, required)

### 413

RequestBodyTooLarge

#### Example

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

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

### 429

RateLimited

#### Example

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

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

### 500

OrgFailure

#### Example

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

- `_tag` (`createOrgConnectionRequest.response.500._tag`; string, required)
  - one of `"OrgFailure"`
- `reason` (`createOrgConnectionRequest.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-connection-request/index.md
