Gamma API
OrganizationsConnections

Add a connection

POST
/api/organizations/{slug}/connections

Saves a connection once the provider accepted it, as a test would. Refused with 400 otherwise.

Who may call it: An owner, security admin or admin of the organization. API keys: no.

Authorization

session
cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Host- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

Path Parameters

slug*string

The organization's slug, as in its URL.

Request Body

application/json
  1. body
provider*string
Length1 <= length <= 50
name*string
Length1 <= length <= 100
config*

The settings the provider's configFields name.

secret?

The secrets the provider's secretFields name. On an update, fields left out or empty keep the saved ones โ€” unless config changed, which needs them again.

allows?|

What projects may sync through it: for each entity that may, the widest way (bidirectional: both). An entity left out may not sync. Null: everything the provider can.

Response Body

Created.

application/json
  1. response
connection*

An organization's connection to an external provider. Its secrets are never sent back.

Example Request
curl -X POST 'http://localhost:3000/api/organizations/string/connections' \  -H 'Content-Type: application/json' \  -d '{  "provider": "string",  "name": "string",  "config": {    "property1": null,    "property2": null  }}'
Example Response
{  "connection": {    "id": "string",    "provider": "string",    "name": "string",    "config": {      "property1": null,      "property2": null    },    "allows": {      "property1": "inbound",      "property2": "inbound"    },    "disabledAt": "2019-08-24T14:15:22Z",    "lastCheckedAt": "2019-08-24T14:15:22Z",    "lastError": "string",    "projects": -9007199254740991,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}