POST
/
connection
import Openint from '@openint/sdk';

const client = new Openint({
  apiKey: process.env['OPENINT_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.createConnection({
    connector_config_id: 'ccfg_',
    customer_id: 'customer_id',
    data: { connector_name: 'dummy-oauth2', settings: { oauth: {} } },
  });

  console.log(response);
}

main();
{
  "id": "<string>",
  "customer_id": "<string>",
  "connector_config_id": "<string>",
  "integration_id": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "display_name": "<string>",
  "disabled": true,
  "metadata": {},
  "connector_name": "<string>",
  "settings": {
    "oauth": {
      "credentials": {
        "access_token": "<string>",
        "client_id": "<string>",
        "scope": "<string>",
        "refresh_token": "<string>",
        "expires_in": 123,
        "expires_at": "<string>",
        "token_type": "<string>",
        "raw": {}
      },
      "created_at": "<string>",
      "updated_at": "<string>",
      "last_fetched_at": "<string>",
      "metadata": {}
    }
  }
}

Authorizations

Authorization
string
header
required

Organization API key generated in the OpenInt Console and passed in the authorization header with format: Bearer {apiKey}

Body

application/json
connector_config_id
string
required

The id of the connector config, starts with ccfg_

customer_id
string
required

The id of the customer in your application. Ensure it is unique for that customer.

data
object
required

Connector specific data

metadata
object

Response

200
application/json
Successful response

Connector specific data

id
string
required
customer_id
string | null
required
connector_config_id
string
required
integration_id
string | null
required
created_at
string
required
updated_at
string
required
display_name
string | null
required
disabled
boolean | null
required
connector_name
string
required
Allowed value: "dummy-oauth2"
settings
object
required
metadata
object | null

JSON object can can be used to associate arbitrary metadata to avoid needing a separate 1-1 table just for simple key values in your application. During updates this object will be shallowly merged