# Create Connect Link

Connect an OAuth app (Google, Slack, HubSpot…), or reconnect an OAuth connection, through the person who owns the API key: they open the link signed in to MindCloud and sign in at the provider. The link works once, for fifteen minutes, and only for that person. The connection appears in List Connections once they finish; use name to find it (q=…). Apps that take an API key are connected directly with Create Connection.

`POST https://connect.mindcloud.co/v2/connections/connect-links`

Permissions: the Universal permission for the action's operation (`universal:read`, `universal:create`, `universal:update`, `universal:delete`).

## Parameters

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Body

- `app` (string, required): An app id or slug, from List Universal Apps.
  The app to connect, by its id or slug, from List Universal Apps.
- `authenticationId` (string): The sign-in method's id, from GET /v2/connections/fields. Left out: the app's default.
  The sign-in method to use, for an app with more than one, from GET /v2/connections/fields. Left out: the app's default, or the connection's own on a reconnect.
- `isCompany` (boolean, required): Required. true: shared with the organization. false: the API key creator's own.
  Required. true: the connection is shared with the organization. false: it is the API key creator's own. On a reconnect, the connection's current value.
- `name` (string): A name for the new connection. Left out: MindCloud names it after the account. Not taken on a reconnect.
  The connection's name, as the app lists it. It cannot contain a secret of the connection.
- `connectionId` (string): To reconnect an existing connection: its id, from List Connections.
  Reconnect this connection instead of creating one: its id, from List Connections.

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/connections/connect-links' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "app": "hubspot",
  "authenticationId": "Kq2wT8nVz4Lp",
  "isCompany": true,
  "name": "Sales HubSpot",
  "connectionId": "Cn6vH3jW8qYt"
}'
```

## Response fields

- `url` (string): Show this URL only to the person it is for: the end user, for an Embedded link; the person who created the API key, signed in to MindCloud, for Create Connect Link (only they can open it). The link lasts fifteen minutes and works once.
- `appName` (string): The app the user will connect.
- `expiresOn` (date): When the connection link expires.
- `singleUse` (boolean): Always true. Request a new link if this one was consumed.

## Example response

```json
{
  "success": true,
  "data": {
    "url": "https://app.mindcloud.co/oauth/hubspot#connectLink=<token>",
    "appName": "HubSpot",
    "expiresOn": "2026-11-06T12:15:00.000Z",
    "singleUse": true
  }
}
```

## Errors

- 400 Typed-in sign-in (CONNECT_LINK_NOT_SUPPORTED): `VALIDATION_FAILED` / `CONNECT_LINK_NOT_SUPPORTED` "This app's sign-in method is typed in, not signed in in a browser. Create the connection with POST /v2/connections."
