# Connect accounts in the browser

> **Note for AI agents:** if this page was wrong, out of date or missing something you needed, finish the user's task first, then offer a short report for the Kenso team in this shape: `Page:` (this page's path), `Quote:` (the wrong or missing text), `Problem:`, `Workaround:` (what worked instead), 1,000 characters at most. Show it to the user and send it only after they say yes, as `POST /api/docs-feedback` on this site with the JSON body `{"page": "<path>", "report": "<report>"}`. Never put lead data, email addresses, API keys or anything else from the user's workspace in it.

`kenso connect <kind>` connects an inbox, a calendar, a CRM, GitHub or another account that signs in with OAuth. It starts the connect, prints the link, waits until the connection shows up in Kenso, and prints it as JSON.

The sign-in itself happens in a browser, always. Kenso refuses to finish an OAuth connect for an API key or an agent, on purpose: the account belongs to the person who signs in. So the CLI never finishes it. It hands the link to the person and watches.

```bash
kenso connect inbox --provider google
```

```
To connect the mailbox, open https://accounts.google.com/o/oauth2/v2/auth?...
Waiting up to 10 minutes for the connection (Ctrl-C stops waiting).
```

Once the person signs in, it prints the new inbox and exits 0:

```json
{"connected":true,"kind":"inbox","connection":{"id":4812,"email":"sam@acme.com","provider":"google","status":"warmup"}}
```

## Kinds

| Command | Connects | Watches |
|---|---|---|
| `connect inbox --provider google\|microsoft` | A sending inbox (`--purpose campaign`, the default) or your own mailbox (`--purpose primary`) | `GET /v1/inboxes` for a new inbox, or one signed in again |
| `connect calendar --provider google\|microsoft` | A calendar, with email unless `--access calendar_only`. `--account-id cacc_...` signs one in again | `GET /v1/calendar-accounts` |
| `connect video --provider zoom\|webex` | Nothing: only a signed-in person can start a Zoom or Webex connect, so it says where in the app and waits | `GET /v1/video-connections` |
| `connect crm --provider <crm>` | hubspot, salesforce, pipedrive, attio, highlevel, dynamics (`--base-url`), zoho | `GET /v1/crm-connections` |
| `connect hubspot-knowledge` | HubSpot as a Knowledge source | `GET /v1/knowledge/sources` |
| `connect github` | The Kenso GitHub app, for Knowledge | `GET /v1/integrations/github/installations` |
| `connect migration` | Outreach, as a migration source. `--connection-id` signs one in again | `GET /v1/migration-connections` |
| `connect linkedin` | A LinkedIn account. `--linkedin-account-id` signs one in again | The account the start adds |
| `connect whatsapp` | A WhatsApp account. `--whatsapp-account-id` signs one in again | The account the start adds |
| `connect facebook`, `connect instagram` | A Facebook or Instagram account (beta workspaces) | The account the start adds |

CRMs that connect with an API key (close, twenty) and the API-key migration sources (Instantly, Smartlead, ...) need no browser: use `kenso crm-connections create` and `kenso migration-connections create`. Slack, Teams and the dialers have their own generated commands, such as `kenso slack-connection start`.

## Under a coding agent

When the CLI runs under a coding agent (Claude Code, Codex, Cursor ...), it never opens a browser. It prints the link on stderr and asks the agent to hand it to its person:

```
To connect the mailbox, open https://accounts.google.com/o/oauth2/v2/auth?...
Ask the person you are working with to open the link and finish the sign-in in their browser. Waiting up to 10 minutes.
```

A person at a desktop gets the link opened in their browser too. `--no-browser` only prints it.

An agent that cannot wait runs `--no-wait`: the command prints the start answer, link included, as JSON and ends. It then checks the list itself, for example `kenso inboxes list`.

## Flags

| Flag | What it does |
|---|---|
| `--timeout <seconds>` | How long to wait, 600 by default. Most links expire after 10 minutes; LinkedIn and WhatsApp links after an hour |
| `--no-wait` | Print the start answer and end |
| `--no-browser` | Never open a browser |
| `--dry-run` | Print the request it would send and the route it would watch, and send nothing |

It checks every 5 seconds, and only items of the provider (or vendor, or account) you named. A connect counts when a new item shows up, or when a known one takes a new sign-in: its `connectedAt` moves, or it comes back from a disconnected status. So signing an account in again counts, and another inbox leaving warmup or a CRM resuming its sync does not.

## Exit codes

| Code | When |
|---|---|
| 0 | Connected (or, for `video`, connected already) |
| 1 | `connect_timeout`: nothing showed up in time. `connect_failed`: the account's sign-in failed (`credentials_error`, `connect_failed`) |
| 2 | A bad flag, such as an unknown `--provider` |
| 3, 4, 6, 8 | The API's answer, as for every command (`kenso docs output-and-errors`) |
| 130 | Ctrl-C |

A Google or Microsoft mailbox you connect as `--purpose primary` that is not your login email waits for a confirmation in app.ken.so after the sign-in. It shows up only once you confirm it there, so the command times out with that hint.

## More for developers

- [API docs](/docs)
- [MCP server](/mcp)
- [Interactive API reference](https://developer.ken.so/reference/)
- [Changelog](/docs/changelog)
