# Connection

> Connections: named links to your users' accounts on other services, and what those services can do.

```python
gmail = noclick.Connection.from_name("gmail", integration="gmail", create_if_missing=True)
if not gmail.connected:
    send_to_user(gmail.connect_url)
gmail.wait()
gmail.run("send_email_message", {...})
```

A connection is a name in one scope (a user, or your account's own). Code,
toolkits and agents name it, so they always act in exactly that account; two
accounts on one service are two connections. Reconnecting keeps the name.

An operation that needs no account (`exa`'s web search) needs no connection
either: `noclick.run("exa.search", {...})` and `tools=["exa.search"]` run it
on NoClick's key, for every user. A connection named `exa` holding your own
key takes over the same refs. `Connection.integrations()` finds a service,
and `operations()` says what a connection's service can do.

## noclick.Connection

```python
class Connection
```

A named connection to an account on another service. Secrets never come
back; `token()` mints an OAuth access token when the key has
`credentials:token`.

`status` is `pending` until someone connects an account at
`connect_url`, `connected` after, and `disconnected` once the account
is revoked (`connect_link()` mints a link to reconnect it). Operations
that need no account run on NoClick's key even while it's pending.

The accounts connected in the NoClick app are connections too, in your
account's own scope: `origin` is `"app"` and the id is
`credential:<id>` (their name is the app's, so refer to them by id).
They run, look up, verify and take `require_approval` like any
connection, and an account agent takes one as a tool (the `Connection`,
or `"credential:<id>"`, `"credential:<id>.operation"`; a user's agent
can't); the app connects them, and `delete()` removes one as the app
does. A connect link (`connect_link()`, `request()`) reconnects one in
place: a key typed there replaces its own in the same credential, so
everything using it keeps working; its owner makes the link, or someone
it's shared with to edit. One shared with your account has `access`
`"view"` or `"edit"`: it runs, but its token, approval rules and
deletion stay its owner's. A Claude or ChatGPT plan you
signed in to in the app is one too, an account agent's
`model_connection`; a plan shared with you, or filled in by someone
else, isn't.

One a teammate shared with a team workspace you're in is that team's to
use, in its workspace only: name the workspace (`organization_id=`)
to list, find and run it there. A connection read in a team workspace
carries it (`organization_id`), and everything it does goes there, as
the team's work.

An app's preview only reads through a connection: an operation that writes
in its account is refused (`noclick.PermissionDenied`) unless the
connection is a test account (`mark_test_account()`).

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `str` |  |
| `name` | `str` |  |
| `integration` | `str` |  |
| `credential_type` | `str | None` |  |
| `user_id` | `str | None` |  |
| `status` | `str` |  |
| `origin` | `str` | `api` for a named connection, `app` for an account connected in the app. |
| `access` | `str` | Your account's access: `owner`, or `edit`/`view` on one shared with it. |
| `organization_id` | `str | None` | The team workspace it was read in (`organization_id=`), where it runs; `None` in your account's own. |
| `approval_operations` | `list[str]` | Operations its owner approves call by call wherever it runs (`*`: all of them); `require_approval` adds to them and `lift_approval` lifts them. |
| `account` | `str | None` | The account it reaches, as the app's Connections list names it: its login, else its email, else who a check verified it as, else the number it links; `None` when none is known. |
| `credential_id` | `str | None` | The id of the account it holds, as a workflow step's `connections` names it, so a step's account is matched to its connection; `None` while none is connected. |
| `test_account` | `bool` | Whether it's a test account, which an app's preview writes through as well as reads. |
| `used_by` | `list[dict[str, Any]]` | What holds it: agents (in their tools, as their `model_connection`, given it by their user, or with a trigger on it), channels and workspaces subscribed to its events, hosted MCP servers with it in their tools, apps that bind it or whose code made it, numbers connected through it, and the automations whose steps use its account (yours, and for an account yours owns, those in its workspace). Each is `kind` (`agent`, `channel`, `workspace`, `mcp_server`, `project`, `phone_number` or `workflow`), `id`, `name`, `user_id`, an app's `binding` name and an automation's `marks` (the node types its steps are, by which the app draws it; null for anything else). |
| `connected_at` | `Any` |  |
| `created_at` | `Any` |  |
| `updated_at` | `Any` |  |
| `connected` | `bool` |  |
| `connect_url` | `str | None` | The open link where someone connects (or reconnects) the account, if one is open. |
| `verification` | `Verification | None` |  |
| `shared` | `ConnectionShared | None` | How one connected in the app and shared with your account reaches it, and who shared it; None for your own and for a named connection. |
| `health` | `ConnectionHealth | None` | The provider's live word on a linked session (a WhatsApp number's, a Discord install's), read with the connection; None where there's nothing to ask or no telling. |
| `plan` | `Plan | None` | A Claude or ChatGPT plan's tier, what it runs and why it runs none; None on anything but a plan. |
| `usage_summary` | `PlanUsageSummary | None` | A plan's usage as last read, over every window; None on anything but a plan, or one never read. `usage()` reads it in full, for a model. |
| `console_url` | `str | None` | This connection's kind in the developer console (None off the hosted API). |

### Connection.from_name

```python
noclick.Connection.from_name(
    name, *, integration=None, create_if_missing=False, credential_type=None,
    data=None, redirect_url=None, reason=None, send_to=None, user=..., client=None
) -> Connection
```

A lazy reference to the connection called `name` in the current
(or given) user. With `create_if_missing=True` it's created on
first use, for `integration` (a name, or an `IntegrationInfo`):
holding `data` when given (a key you hold), else pending with a
connect link (the link options are `create`'s). An existing
connection is used as it is: `data` and the link options apply only when it's
created. `integration` and `credential_type` say what the connection is, so they're
checked, with or without `create_if_missing`: one of another integration or credential
type raises `noclick.Conflict` naming it. `operations()`, `operation()` and
`events()` read `integration`'s catalog without loading or
creating it.

Parameters:

- `name` (`str`, required)
- `integration` (`Any`, default `None`)
- `create_if_missing` (`bool`, default `False`)
- `credential_type` (`str | None`, default `None`)
- `data` (`dict[str, Any] | None`, default `None`)
- `redirect_url` (`str | None`, default `None`)
- `reason` (`str | None`, default `None`)
- `send_to` (`Any`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Connection` A connection that loads, or is created, the first time it's used. Nothing is sent yet.

Usage:

Refer to a connection that already exists:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
print(gmail.status)   # loads it now; noclick.NotFound if there's none
```

Or create it the first time it's used, pending with a link for the user.
The same line works for a new user and a returning one:

```python
with noclick.as_user("user_42"):
    gmail = noclick.Connection.from_name(
        "gmail", integration="gmail", create_if_missing=True,
        reason="to send your weekly summaries",
    )
    print(gmail.status, gmail.connect_url)   # pending https://noclick.com/credential/provide/...
```

With a key you already hold, it's created holding that key (and never overwrites one):

```python
crm = noclick.Connection.from_name(
    "crm", integration="affinity", data={"api_key": "..."},
    create_if_missing=True, user="user_42",
)
```

### Connection.from_id

```python
noclick.Connection.from_id(
    connection_id, *, organization_id=None, client=None, user=...
) -> Connection
```

A lazy reference to a connection by NoClick id, in the current (or
given) user; `credential:<id>` for an account connected in the app.
`organization_id` names a team workspace you're in, where one shared
with that team is used.

Parameters:

- `connection_id` (`str`, required)
- `organization_id` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).

Returns: `Connection` A connection that loads the first time you read a field. Nothing is sent yet.

Usage:

```python
connection = noclick.Connection.from_id("3f1d2c4b-8a7e-4f6d-9b2a-1c5e7d9f0a31", user="user_42")
print(connection.name, connection.status)

slack = noclick.Connection.from_id("credential:9b2a1c5e-7d9f-4a31-8f6d-3f1d2c4b8a7e")
slack.run("send_message", {"channel": "#ops", "text": "Deployed."})
```

### Connection.create

```python
noclick.Connection.create(
    name, *, integration=None, credential_type=None, data=None, redirect_url=None,
    reason=None, send_to=None, allow_existing=False, user=..., client=None
) -> Connection
```

Create a connection called `name` (unique per user; a duplicate
raises `noclick.Conflict` with `existing_id`). With `allow_existing=True`
a taken name returns the connection already there, as it is: its credential isn't
replaced and no link is made. One of another integration still raises the `Conflict`.
With `data` it holds that credential at once (validated and probed first); without, it's
pending and `connect_url` is where someone connects it. `send_to`
("user", an email, or a dict) also delivers the link.

Parameters:

- `name` (`str`, required)
- `integration` (`Any`, default `None`)
- `credential_type` (`str | None`, default `None`)
- `data` (`dict[str, Any] | None`, default `None`)
- `redirect_url` (`str | None`, default `None`)
- `reason` (`str | None`, default `None`)
- `send_to` (`Any`, default `None`)
- `allow_existing` (`bool`, default `False`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Connection` The new connection: `pending` with its `connect_url`, or `connected`
(with its `verification`) when you passed `data`.

Usage:

Create a pending connection and show the user its link:

```python
with noclick.as_user("user_42"):
    slack = noclick.Connection.create("slack", integration="slack", reason="to post your team's standup")
    print(slack.connect_url)
```

Or create it holding a key you already have. A key the provider
rejects raises `noclick.InvalidRequest` and saves nothing:

```python
crm = noclick.Connection.create("crm", integration="affinity", data={"api_key": "..."}, user="user_42")
print(crm.status)   # connected
```

A model provider's connection is what an agent on a CLI harness thinks with (its
`model_connection`). Pass a key as `api_key`; a Claude or ChatGPT plan is
signed in only at the link, by the person it belongs to, on your account's
connection as on a user's:

```python
claude = noclick.Connection.create("claude", integration="anthropic", data={"api_key": "sk-ant-..."})
with noclick.as_user("user_42"):
    plan = noclick.Connection.create("claude", integration="anthropic")
    print(plan.connect_url)   # "Paste a Claude key" or "Sign in with Claude"
```

If the name may be taken, take the connection already there as it is:

```python
slack = noclick.Connection.create("slack", integration="slack", user="user_42", allow_existing=True)
if not slack.connected:
    print(slack.connect_url)
```

### Connection.get

```python
noclick.Connection.get(
    ref, *, organization_id=None, user=..., client=None
) -> Connection
```

Load the connection with this id or name now; an unknown one raises `noclick.NotFound`.
`organization_id` names a team workspace you're in, where one shared with that team is found.

Parameters:

- `ref` (`str`, required)
- `organization_id` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Connection` The connection, loaded.

Usage:

```python
with noclick.as_user("user_42"):
    gmail = noclick.Connection.get("gmail")
    print(gmail.status, gmail.account)
```

### Connection.list

```python
noclick.Connection.list(
    *, integration=None, origin=None, organization_id=None, limit=None,
    user_filter=None, user=..., client=None
) -> list[Connection]
```

The current user's connections (the account's own outside
`as_user`), or those `user_filter` covers: named ones newest first,
then, in the account's own scope, the accounts connected in the app.
`origin` keeps only `"api"` or `"app"` ones; `organization_id`
reads in a team workspace you're in, where those shared with that team
are listed too (and each runs there).

Parameters:

- `integration` (`Any`, default `None`)
- `origin` (`str | None`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `limit` (`int | None`, default `None`): Return at most this many.
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[Connection]` Every matching connection (or the first `limit`), fetched page by page.

Usage:

```python
with noclick.as_user("user_42"):
    for connection in noclick.Connection.list():
        print(connection.name, connection.integration, connection.status)

every_gmail = noclick.Connection.list(integration="gmail", user_filter=noclick.ALL_USERS)
from_the_app = noclick.Connection.list(origin="app")
the_teams = noclick.Connection.list(organization_id="5c0d9e4a-7b1f-4e2a-9c3d-8f6b2a1e4d70")
```

### Connection.list_page

```python
noclick.Connection.list_page(
    *, cursor=None, limit=None, integration=None, origin=None, organization_id=None,
    user_filter=None, user=..., client=None
) -> Page
```

One page of connections; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `integration` (`Any`, default `None`)
- `origin` (`str | None`, default `None`)
- `organization_id` (`str | None`, default `None`)
- `user_filter` (`Any`, default `None`): Which users a read covers: `noclick.ALL_USERS`, `noclick.NO_USER`, a `User`, or your id for one. It filters without acting as that user.
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Page` A page whose `data` holds the connections and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.Connection.list_page(limit=50, user_filter=noclick.ALL_USERS)
while True:
    for connection in page.data:
        print(connection.user_id, connection.name, connection.status)
    if page.next_cursor is None:
        break
    page = noclick.Connection.list_page(limit=50, user_filter=noclick.ALL_USERS, cursor=page.next_cursor)
```

### Connection.integrations

```python
noclick.Connection.integrations(
    query=None, *, kind=None, client=None
) -> list[IntegrationInfo]
```

The services NoClick can operate and the model providers its agents think
with: every one, or those whose name or label contains `query` (ignoring
case). `kind="app"` keeps the services, whose operations are tools;
`kind="model"` keeps the model providers (`anthropic`, `openai`,
`openrouter`, ...), which an agent names as its `model_connection`. The
catalog is your account's, the same for every user.

Parameters:

- `query` (`str | None`, default `None`)
- `kind` (`str | None`, default `None`)
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `list[IntegrationInfo]` Each one's `name` (what `integration=` takes), `label`, `kind`, `operation_count`,
`account_free_operation_count` (how many run with no account, by the service's name),
`connect_with` (how a person connects an account), `events` (the app events an
`OnEvent` trigger takes from it, empty for one that only acts) and `subscription`
(whether its link also offers signing in with a Claude or ChatGPT plan).

Usage:

Find a service, then make a connection to it:

```python
[crm] = noclick.Connection.integrations("affinity")
print(crm.label, crm.connect_with)   # Affinity ['key']
with noclick.as_user("user_42"):
    affinity = noclick.Connection.from_name("crm", integration=crm, create_if_missing=True)
    print(affinity.connect_url)
```

Or list every service a person connects by signing in:

```python
for service in noclick.Connection.integrations():
    if "oauth" in service.connect_with:
        print(service.name, service.label)
```

Or the services with operations that need no account, which run by the service's
name with no connection (`noclick.run("exa.search", ...)`):

```python
for service in noclick.Connection.integrations():
    if service.account_free_operation_count:
        print(service.name, service.account_free_operation_count)   # exa 4
```

Or whether a service can wake an agent at all, before you build on it:

```python
[tiktok] = noclick.Connection.integrations("tiktok")
print(tiktok.events)   # [] : it publishes, and no OnEvent hears it
```

Or the model providers an agent's `model_connection` can name:

```python
for provider in noclick.Connection.integrations(kind="model"):
    print(provider.name, provider.connect_with, provider.subscription)   # anthropic ['key'] True
```

### Connection.only

```python
connection.only(*operations) -> ConnectionOperations
```

A tool ref to some of its operations, for `tools=` (`gmail.only("send_email_message")`);
a lazy `create_if_missing` connection is still created first.

Parameters:

- `operations` (`str`)

Returns: `ConnectionOperations` A ref to just those operations of this connection, to list in `tools=`; `bind(...)` on it fixes
arguments the model mustn't choose.

Usage:

A large integration doesn't fit an agent whole, so name the operations it needs:

```python
with noclick.as_user("user_42"):
    stripe = noclick.Connection.from_name("stripe", integration="stripe", create_if_missing=True)
    support = noclick.Agent.from_name(
        "support", create_if_missing=True,
        instructions="You answer the user's billing questions.",
        tools=[stripe.only("list_invoices", "search_charges"), "search"],
    )
```

### Connection.checkout

```python
connection.checkout(repository, *, branch=None, path=None, push=None) -> RepoCheckout
```

One of this connection's repositories (`owner/name` on its git host; a
`github` connection) checked out in an agent's workspace, for `Agent(repos=[...])`:
cloned into `/workspace/<path>` (the repository's name when omitted) at a
conversation's first turn, on `branch` (its default when omitted). The agent's git
reaches this repository only, through NoClick, with a key made for its sandbox and
revoked when the sandbox ends; the connection's own token never enters it. `push`
is the branches it may push to, as globs: NoClick refuses a push to any other ref,
and without `push` the checkout is read-only. `gh` reads the repository
(`gh api repos/<owner>/<name>/...`) and nothing more, since its writes could move a
branch past `push`: give the agent the connection's operations
(`github.only("create_pull_request")`) for pull requests and issues, which your policy
judges. Sends nothing; a lazy `create_if_missing` connection is created when the agent
is saved, and the connection must be connected before a turn can clone.

Parameters:

- `repository` (`str`, required)
- `branch` (`str | None`, default `None`)
- `path` (`str | None`, default `None`)
- `push` (`str | Sequence[str] | None`, default `None`)

Returns: `RepoCheckout` A `RepoCheckout` to list in an agent's `repos`.

Usage:

A docs agent that pushes only to branches it names `noclick/...`:

```python
github = noclick.Connection.from_name("github", integration="github", create_if_missing=True)
writer = noclick.Agent.from_name(
    "docs-writer",
    create_if_missing=True,
    instructions="You fix the docs issues you're given in /workspace/docs and open a pull request.",
    harness="claude_code",
    model_connection="claude",
    tools=[github.only("create_pull_request")],
    repos=[github.checkout("acme/docs", push="noclick/*")],
)
```

Read-only, on a branch, in a folder of your choosing:

```python
github = noclick.Connection.from_name("github")
reference = github.checkout("acme/api", branch="release-2.4", path="api")
```

### Connection.operations

```python
connection.operations(search=None) -> list[IntegrationOperation]
```

The operations of this connection's integration: every one, or those
whose name or description contains `search` (ignoring case).

Parameters:

- `search` (`str | None`, default `None`)

Returns: `list[IntegrationOperation]` Each operation's `name`, `description`, the JSON schema of its `parameters`,
`needs_account` (False when it runs on NoClick's key, with no connection or on a
pending one) and `read_only`, a hint from its name rather than a guarantee.

Usage:

See what a user's Slack can do before anyone has connected it. With `integration=`
nothing is loaded or created to answer:

```python
with noclick.as_user("user_42"):
    slack = noclick.Connection.from_name("slack", integration="slack", create_if_missing=True)
    for op in slack.operations(search="message"):
        print(op.name, op.read_only, op.description)
```

Find the operations that need no account. They run by the integration's name with no
connection at all (`noclick.run("exa.search", ...)`), and reading them creates nothing:

```python
exa = noclick.Connection.from_name("exa", integration="exa")
keyless = [op.name for op in exa.operations() if not op.needs_account]
```

### Connection.operation

```python
connection.operation(name) -> IntegrationOperation
```

One operation of this connection's integration; an unknown name raises `noclick.NotFound`.

Parameters:

- `name` (`str`, required)

Returns: `IntegrationOperation` The operation, with the JSON schema of the `parameters` that `run` takes for it.

Usage:

Read an operation's parameters before running it:

```python
slack = noclick.Connection.from_name("slack", integration="slack", user="user_42")
send = slack.operation("send_message_to_channel")
print(send.description, send.parameters["required"])
slack.run("send_message_to_channel", {"channel": "#general", "text": "Standup in 5"})
```

### Connection.events

```python
connection.events() -> list[IntegrationEvent]
```

The app events this connection's integration can wake an agent with, for `noclick.OnEvent`.
A poll (new mail in Gmail, say) is no event here: only what the app pushes as it happens.

Returns: `list[IntegrationEvent]` Every event, with its `description` and the `filters` it takes
(`channel` for a Slack message, `repository` for a GitHub issue).

Usage:

```python
slack = noclick.Connection.from_name("slack", integration="slack", user="user_42")
for event in slack.events():
    print(event.name, event.description, list(event.filters))
```

### Connection.connect_link

```python
connection.connect_link(*, redirect_url=None, reason=None, send_to=None) -> ConnectLink
```

Mint a new link where someone connects (or reconnects) this
connection's account. `send_to` ("user", "owner" for your account's
owner, an email, or a dict) also delivers it. On an account connected in
the app (`credential:<id>`), a key typed there goes into that same
credential, once, before the link expires; one shared with you to use
raises `PermissionDenied`.

Parameters:

- `redirect_url` (`str | None`, default `None`)
- `reason` (`str | None`, default `None`)
- `send_to` (`Any`, default `None`)

Returns: `ConnectLink` The link: its `url`, when it `expires_at`, and where it went when
you set `send_to`. It's also the operation that finishes when
someone connects: `link.wait()` returns the connected `Connection`.
The connection's own `connect_url` is now this link's.

Usage:

Make a link and show it in your product yourself:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
link = gmail.connect_link(redirect_url="https://app.example.com/settings/connections")
print(link.url, link.expires_at)
```

Or have NoClick email it. From code that isn't acting for a user,
`send_to` can be any email address:

```python
ops_slack = noclick.Connection.from_name("ops-slack")
link = ops_slack.connect_link(send_to="ops@example.com", reason="to post alerts in #ops")
print(link.delivered_via, link.undelivered)   # ['email'] []
ops_slack = link.wait()
```

### Connection.request

```python
connection.request(*, reason=None, send_to='user', redirect_url=None) -> ConnectLink
```

Ask the user (or `send_to`) to connect it: a new connect link, emailed. A
connection of your account's own has no user: send it to `"owner"` (your
account's owner) or an email.

Parameters:

- `reason` (`str | None`, default `None`)
- `send_to` (`Any`, default `'user'`)
- `redirect_url` (`str | None`, default `None`)

Returns: `ConnectLink` The link, already sent: `delivered_via` says where it went, and
`.wait()` on it returns the connected `Connection`.

Usage:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
if gmail.refresh().status == "disconnected":
    link = gmail.request(reason="Gmail stopped working. Reconnect it to keep your summaries coming.")
    print(link.delivered_via)   # ['email']
```

### Connection.wait

```python
connection.wait(timeout=None) -> Connection
```

Block until an account is connected (returns at once when it is). It
follows the connection, not one link: an account connected through any
of its links ends the wait, and a link that lapses after a fresh one was
made (`connect_link()` or `request()`, from anywhere) hands the wait
to the fresh one. Raises `noclick.OperationExpired` when the open link
lapses with no fresh one, or `noclick.OperationTimeout` after
`timeout` seconds.

Parameters:

- `timeout` (`float | None`, default `None`)

Returns: `Connection` This connection, `connected`. After a wait it's reloaded, so `account`
names the account when the provider says who it is.

Usage:

Wait in a background job, not while a web request is open:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
gmail.wait(timeout=3600)
print(gmail.account)   # ana@example.com
```

If the link lapses first, send a fresh one and keep waiting:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
try:
    gmail.wait()
except noclick.OperationExpired:
    gmail.request(reason="to send your weekly summaries")
    gmail.wait()
```

### Connection.import_

```python
connection.import_(data, *, credential_type=None) -> Connection
```

Replace the connection's credential with one you hold (a rotated
key), validated and probed first. `credential_type`, when the
integration takes more than one, is one of its `credential_types`
(`Connection.integrations()`).

Parameters:

- `data` (`dict[str, Any]`, required)
- `credential_type` (`str | None`, default `None`)

Returns: `Connection` This connection, holding the new key, with the probe's `verification`.
The key it replaced is deleted.

Usage:

Rotate a key:

```python
crm = noclick.Connection.from_name("crm", user="user_42")
crm.import_({"api_key": "..."})
print(crm.status, crm.verification)
```

Or bring your own key for a service whose operations need no account: a connection
named after it runs its refs (`"exa.search"`) on your key instead of NoClick's:

```python
exa = noclick.Connection.from_name("exa", integration="exa", create_if_missing=True)
exa.import_({"api_key": "..."})
print(exa.verification)
```

### Connection.run

```python
connection.run(operation, arguments=None, *, approval_id=None) -> Any
```

Run one of the integration's operations in this account. An operation
that needs no account (`needs_account` False in `operations()`) runs
on NoClick's key while the connection is pending, and needs no connection
at all through `noclick.run`; any other raises
`noclick.NeedsConnection` until it's connected and `noclick.CredentialDisconnected`
once revoked (both carry `connect_url`). A connection holding your own
key runs every operation on it. Policy may raise
`noclick.PolicyDenied` or `noclick.ApprovalRequired` (retry with its
`approval_id=` once `.operation.wait()` is `True`). When the service
refuses the call, it raises `noclick.UpstreamError` in the service's own
words, with its HTTP status in `upstream_status`.

Parameters:

- `operation` (`str`, required)
- `arguments` (`dict[str, Any] | None`, default `None`)
- `approval_id` (`str | None`, default `None`)

Returns: `Any` The operation's data, as plain data (what the service answered).

Usage:

Run an operation in the user's account:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
gmail.run("send_email_message", {
    "to": ["ana@example.com"],
    "subject": "Your weekly summary",
    "body": "Three invoices were paid this week.",
})
```

A pending connection runs the operations that need no account at once, on NoClick's key:

```python
exa = noclick.Connection.from_name("exa", integration="exa", create_if_missing=True)
results = exa.run("search", {"query": "invoice automation for small businesses"})
```

If nothing is connected yet, send the user the link and retry once they've connected:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
args = {"to": ["ana@example.com"], "subject": "Your weekly summary", "body": "..."}
try:
    gmail.run("send_email_message", args)
except noclick.NeedsConnection as err:
    notify_user(err.connect_url)
    gmail.wait()
    gmail.run("send_email_message", args)
```

When your policy holds the call for a person's approval, wait for it and
repeat the identical call with the approval's id:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
args = {"to": ["ana@example.com"], "subject": "Your weekly summary", "body": "..."}
try:
    gmail.run("send_email_message", args)
except noclick.ApprovalRequired as pending:
    if pending.operation.wait():
        gmail.run("send_email_message", args, approval_id=pending.approval_id)
```

### Connection.lookup

```python
connection.lookup(
    field, arguments=None, *, search=None, page_token=None
) -> LookupOptions
```

List the allowed values of an ID-like field (channels, repos, sheets) in this account.

Parameters:

- `field` (`str`, required)
- `arguments` (`dict[str, Any] | None`, default `None`)
- `search` (`str | None`, default `None`)
- `page_token` (`str | None`, default `None`)

Returns: `LookupOptions` One page of options, each with a `value` to pass and a `label` to show;
`next_page_token` is set when there are more.

Usage:

Fill a picker from the user's own Slack:

```python
slack = noclick.Connection.from_name("slack", user="user_42")
for option in slack.lookup("channel", search="gen"):
    print(option.value, option.label)
```

A lookup that depends on another argument (a sheet inside a spreadsheet)
takes it in `arguments`; pass `next_page_token` back as `page_token` for more:

```python
sheets = noclick.Connection.from_name("sheets", user="user_42")
spreadsheet = {"spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"}
tabs = sheets.lookup("sheet_name", spreadsheet)
if tabs.next_page_token:
    more = sheets.lookup("sheet_name", spreadsheet, page_token=tabs.next_page_token)
```

### Connection.usage

```python
connection.usage(model=None, *, fresh=False) -> PlanUsage
```

How much of a Claude or ChatGPT plan is used.

Args:
model: Only the windows that can stop this model (`"claude-opus-5-5"`): a per-model window of
another model is left out. None: every window.
fresh: Ask the provider when the last reading is a few minutes old (2 for ChatGPT, 5 for Claude);
else the last reading NoClick kept, whether a provider's or what a harness reported after a turn.

Parameters:

- `model` (`str | None`, default `None`)
- `fresh` (`bool`, default `False`)

Returns: `PlanUsage` Its `state` (`ok`, `near` from 80% used, `used_up`, `unknown`), its `windows`, the one that
stops it first (`tightest`), when a used-up plan runs again (`available_at`) and what to do meanwhile
(`next_steps`). Raises `InvalidRequest` for a connection that isn't a plan.

Usage:

```python
plan = noclick.Connection.from_id("credential:3f2a...")
used = plan.usage(model="claude-opus-5-5", fresh=True)
print(used.state, used.tightest.label, used.tightest.left)   # near  5-hour  0.09
```

### Connection.verify

```python
connection.verify() -> Verification | None
```

Re-check the account against the provider. Each check asks the provider, so an
account makes at most 20 a minute (`noclick.RateLimited` past them).

Returns: `Verification | None` The provider's verdict, also kept as `verification`: `reachable` is
`True` when it accepted the account, `False` when it refused it, and
`None` when NoClick can't tell; `message` says what was found, and
`samples`, `noun`, `total`, `account_label` and `error` what
the provider showed or said.

Usage:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
check = gmail.verify()
print(check.reachable, check.message)   # True  Signed in as ana@example.com.
```

### Connection.require_approval

```python
connection.require_approval(*operations) -> Connection
```

From now on its owner approves each call of these operations, wherever
it runs: your code, agents, and the app's workflows. `"*"` means every
operation. It only ever adds to `approval_operations` (`lift_approval`
lifts). On one shared with your account, `noclick.PermissionDenied`.

Parameters:

- `operations` (`str`)

Returns: `Connection` The connection, with its `approval_operations`.

Usage:

```python
gmail = noclick.Connection.from_name("gmail")
gmail.require_approval("send_email_message", "delete_message")
print(gmail.approval_operations)   # ['delete_message', 'send_email_message']
```

### Connection.lift_approval

```python
connection.lift_approval(*operations) -> list[PolicyChange]
```

Let calls of these operations run without its owner's OK again: each named as
`approval_operations` names it, or none to lift every one (`"*"` lifts the rule for
every operation, leaving any named on their own). Signed in as your account's owner it
applies at once, and so it does from your agent (NoClick's assistant, or any agent of yours)
on a turn your own message started, recorded as yours. One a model makes on its own (a turn
no message of yours started, a connected app, a key used through MCP) waits for your approval.
From a key it needs one naming the `approvals:policy` scope (a key with every scope, `*`,
holds it only when it's named too) and `credentials:use`, and it waits a 10-minute undo
window, in which `noclick.ApprovalPolicy.undo(change.id)` takes it back; the owner is told.
Requiring approval for one of them again meanwhile takes it back too.

Parameters:

- `operations` (`str`)

Returns: `list[PolicyChange]` ```python
The change it made: ``pending`` while it waits, ``effective_at`` when it takes effect.
The connection's ``approval_operations`` read as they stand.
```

Raises:
noclick.PermissionDenied: a key without `approvals:policy`, a call acting for one of
your users, an app's code, or one shared with your account.
noclick.InvalidRequest: an operation it asks no approval for.
noclick.Conflict: it asks no approval at all, or a lift of the same operation already waits.

Usage:

```python
gmail = noclick.Connection.from_name("gmail")
[change] = gmail.lift_approval("send_email_message")
print(change.pending, change.effective_at)   # True 2026-11-22 09:10:00+00:00
```

### Connection.rename

```python
connection.rename(name) -> Connection
```

Rename an account connected in the app (`origin` `app`): the name your
account and the app see, which nothing finds it by. Its owner renames it, or someone
it's shared with to edit (`noclick.PermissionDenied` otherwise). A named
connection's name is how code finds it, so it isn't renamed (`noclick.InvalidRequest`).

Parameters:

- `name` (`str`, required)

Returns: `Connection` The connection, with its new `name`.

Usage:

```python
inbox = noclick.Connection.get("credential:...")
inbox.rename("Sales inbox")
print(inbox.name)   # Sales inbox
```

### Connection.mark_test_account

```python
connection.mark_test_account(test_account=True) -> Connection
```

Mark it as a test account (or, with `False`, not one). An app's preview only reads
through a connection; through a test account it writes as well, as production does. Only
the account that connected it marks it (`noclick.PermissionDenied` on one shared with
yours), and it must hold an account (`noclick.InvalidRequest` while pending).

Parameters:

- `test_account` (`bool`, default `True`)

Returns: `Connection` The connection, with `test_account` set.

Usage:

```python
slack = noclick.Connection.from_name("slack-sandbox")
slack.mark_test_account()
print(slack.test_account)   # True
```

### Connection.token

```python
connection.token() -> Token
```

Mint a fresh OAuth access token for calling the provider yourself. A model
provider's connection never hands out its key or plan token
(`noclick.PermissionDenied`).

Returns: `Token` The access token, its `token_type` and when it `expires_at`; never a
refresh token or an API key.

Usage:

```python
gmail = noclick.Connection.from_name("gmail", user="user_42")
token = gmail.token()
headers = {"Authorization": f"{token.token_type} {token.access_token}"}
```

### Connection.delete

```python
connection.delete() -> None
```

Delete the connection, revoking its account at the provider where possible.

Usage:

```python
noclick.Connection.from_name("gmail", user="user_42").delete()
```

## noclick.run

```python
noclick.run(ref, arguments=None, *, approval_id=None, user=..., client=None) -> Any
```

Run one operation by its ref, `"name.operation"`, as `tools=` names it. `name`
is a connection in the scope the call acts for (the user's, else the account's), else
an integration whose operation needs no account, which then runs on NoClick's key with
no connection at all. A connection named like the integration (`exa`, holding your
own key) wins, so the same ref then runs on your key. An account connected in the app
is `"credential:<id>.operation"`.

It raises like `connection.run`: `noclick.NeedsConnection` (or
`noclick.CredentialDisconnected`) with the `connect_url` when the connection has no
working account, `noclick.InvalidRequest` when the operation needs an account and no
connection has that name, `noclick.NotFound` when `name` is neither a connection nor
an integration, `noclick.PolicyDenied` or `noclick.ApprovalRequired` (retry with
its `approval_id=` once `.operation.wait()` is `True`), and `noclick.UpstreamError`
when the service refuses the call (its own words, its HTTP status in `upstream_status`).

Parameters:

- `ref` (`str`, required)
- `arguments` (`dict[str, Any] | None`, default `None`)
- `approval_id` (`str | None`, default `None`)
- `user` (`Any`, default: the current user): Who the call acts for. Defaults to the user set by `noclick.as_user` (none: the account itself).
- `client` (`Client | None`, default `None`): The client to send with; defaults to the module client built from `NOCLICK_API_KEY`.

Returns: `Any` The operation's data, as plain data (what the service answered).

Usage:

Search the web with nothing to create or connect, on NoClick's key:

```python
results = noclick.run("exa.search", {"query": "invoice automation for small businesses"})
```

A name that is a connection runs through it, here the user's own Gmail:

```python
with noclick.as_user("user_42"):
    noclick.run("gmail.send_email_message", {
        "to": ["ana@example.com"],
        "subject": "Your weekly summary",
        "body": "Three invoices were paid this week.",
    })
```

Bring your own key: a connection named `exa` holding it takes over the same ref:

```python
noclick.Connection.create("exa", credential_type="exa_api_key", data={"api_key": "..."})
results = noclick.run("exa.search", {"query": "invoice automation for small businesses"})
```

When your policy holds the call for a person's approval, wait for it and repeat the
identical call with the approval's id:

```python
args = {"to": ["ana@example.com"], "subject": "Your weekly summary", "body": "..."}
try:
    noclick.run("gmail.send_email_message", args, user="user_42")
except noclick.ApprovalRequired as pending:
    if pending.operation.wait():
        noclick.run("gmail.send_email_message", args, user="user_42", approval_id=pending.approval_id)
```

## noclick.ConnectionOperations

```python
class ConnectionOperations
```

Some of a connection's operations as tools (`connection.only(...)`), with
the arguments `bind(...)` fixed.

| Attribute | Type | Description |
| --- | --- | --- |
| `connection` | `Connection` |  |
| `operations` | `list[str]` |  |
| `bindings` | `dict[str, Any]` | The arguments NoClick fills on every call, out of the model's reach. |

### ConnectionOperations.bind

```python
connection_operations.bind(**arguments) -> ConnectionOperations
```

Fix arguments of these operations: a bound parameter leaves the tool's schema,
so the model never sees or sets it, and NoClick fills it on every call. A value may
name the user the call acts for: `{{user.id}}`, `{{user.email}}`,
`{{user.name}}` or `{{user.metadata.<key>}}`. A bound value always wins,
over what a model passes through in an operation's free-form parameters too; a
tool whose binding can't be filled (a user with no email, say) isn't offered that
turn. Policy judges the call's final arguments. Every operation listed must take
each bound parameter. Works wherever `tools` do: agents, toolkits and hosted MCP
servers. Sends nothing.

Parameters:

- `arguments` (`Any`)

Returns: `ConnectionOperations` A new ref with these arguments bound on top of any bound before.

Usage:

An assistant that can email only its own user, whatever a message it reads says:

```python
with noclick.as_user("user_42"):
    gmail = noclick.Connection.from_name("gmail", integration="gmail", create_if_missing=True)
    assistant = noclick.Agent.from_name(
        "assistant",
        create_if_missing=True,
        instructions="You summarize the user's inbox and email them the summary.",
        tools=[gmail.only("fetch_emails_from_inbox"), gmail.only("send_email_message").bind(to="{{user.email}}")],
    )
```

Pin a shared account connection to each user's own records:

```python
hubspot = noclick.Connection.from_name("hubspot")
crm = hubspot.only("search_contacts").bind(owner_id="{{user.metadata.hubspot_owner}}")
toolkit = noclick.Toolkit([crm, "search"])
```

## noclick.ConnectLink

```python
class ConnectLink(Operation)
```

A connect page URL that is also the operation tracking it.

| Attribute | Type | Description |
| --- | --- | --- |
| `url` | `str` |  |
| `expires_at` | `Any` |  |
| `connection` | `str | None` | The connection the link fills. |
| `delivered_via` | `list[str]` | Channels the link went out on when `send_to` was set (`["email"]`); empty otherwise. |
| `undelivered` | `list[dict[str, Any]]` | Channels that failed, each with a `reason`: send the link yourself. |

### ConnectLink.list

```python
noclick.ConnectLink.list(*, limit=None, **filters) -> list[Operation]
```

Connect-link operations (kind `credential.connect`), newest first; takes
`Operation.list`'s filters except `kind`. Rows are operations: the link's
URL is only in the response that created it (and on its pending connection).

Parameters:

- `limit` (`int | None`, default `None`): Return at most this many.
- `filters` (`Any`)

Returns: `list[Operation]` Every matching operation (or the first `limit`), fetched page by page;
`wait()` on one returns the connected `Connection`.

Usage:

```python
for op in noclick.ConnectLink.list(status="awaiting_human", user_filter=noclick.ALL_USERS):
    print(op.user_id, op.summary_text, op.created_at)   # ... Connect gmail ...
```

### ConnectLink.list_page

```python
noclick.ConnectLink.list_page(*, cursor=None, limit=None, **filters) -> Page
```

One page of connect-link operations; pass `next_cursor` back as `cursor`.

Parameters:

- `cursor` (`str | None`, default `None`): The `next_cursor` of the page before; omit it for the first page.
- `limit` (`int | None`, default `None`): Return at most this many.
- `filters` (`Any`)

Returns: `Page` A page whose `data` holds the operations and whose `next_cursor` is `None` on the last page.

Usage:

```python
page = noclick.ConnectLink.list_page(status="expired", limit=50)
while True:
    for op in page.data:
        print(op.summary_text, op.updated_at)
    if page.next_cursor is None:
        break
    page = noclick.ConnectLink.list_page(status="expired", limit=50, cursor=page.next_cursor)
```

### ConnectLink.summary

```python
noclick.ConnectLink.summary(**filters) -> OperationSummary
```

Count connect-link operations; takes `Operation.summary`'s filters except `kind`.

Parameters:

- `filters` (`Any`)

Returns: `OperationSummary` The `total` that match and a count for every status in `by_status`.

Usage:

How many of last week's links were used, and how many lapsed:

```python
from datetime import datetime, timedelta, timezone

week_ago = datetime.now(timezone.utc) - timedelta(days=7)
counts = noclick.ConnectLink.summary(created_after=week_ago, user_filter=noclick.ALL_USERS)
print(counts.total, counts.by_status["succeeded"], counts.by_status["expired"])
```

## noclick.Verification

```python
class Verification
```

Whether the provider accepted the credential (`reachable` None = cannot judge): things of the account's own
as the provider sees them (`samples`, which are `noun`, `total` of them when more), who it signs in as
(`account_label`), whether that proves the account (`proves` `account`) or only that the key was accepted
(`reachability`), and a refusal in the provider's own words (`error`).

| Attribute | Type | Description |
| --- | --- | --- |
| `reachable` | `bool | None` |  |
| `samples` | `list[Any]` |  |
| `message` | `str | None` |  |
| `hint` | `str | None` |  |
| `noun` | `str | None` |  |
| `total` | `int | None` |  |
| `account_label` | `str | None` |  |
| `proves` | `str | None` |  |
| `error` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ConnectionShared

```python
class ConnectionShared
```

How an account shared with yours reaches it: shared with your account's person (`with_` `you`) or with the
team workspace it's read in (`workspace`), and who shared it (`by_name`, `by_email`).

| Attribute | Type | Description |
| --- | --- | --- |
| `with_` | `str` |  |
| `by_name` | `str | None` |  |
| `by_email` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.ConnectionHealth

```python
class ConnectionHealth
```

A provider's live word on a linked session (a WhatsApp number's, a Discord install's): `healthy`, the
provider's own word for its state (`status`) and, when it isn't healthy, what to do (`hint`).

| Attribute | Type | Description |
| --- | --- | --- |
| `healthy` | `bool` |  |
| `status` | `str` |  |
| `hint` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.Token

```python
class Token
```

A short-lived OAuth access token (never a refresh token or API key).

| Attribute | Type | Description |
| --- | --- | --- |
| `access_token` | `str` |  |
| `token_type` | `str | None` |  |
| `expires_at` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.LookupOption

```python
class LookupOption
```

| Attribute | Type | Description |
| --- | --- | --- |
| `value` | `Any` |  |
| `label` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.LookupOptions

```python
class LookupOptions(list[LookupOption])
```

A page of options; pass `next_page_token` back as `page_token`.

| Attribute | Type | Description |
| --- | --- | --- |
| `next_page_token` | `str | None` |  |

## noclick.Plan

```python
class Plan
```

A Claude or ChatGPT plan's tier: `tier` as NoClick names it (`"max_20x"`, `"plus"`, `"free"`) and
`label` as its provider does (`"Ultra"`, `"Plus"`), both None until NoClick has read them; the harnesses it
runs (`runs`), and why it runs none (`refusal`: `"ChatGPT Free doesn't include Codex."`).

| Attribute | Type | Description |
| --- | --- | --- |
| `tier` | `str | None` |  |
| `label` | `str | None` |  |
| `runs` | `list[str]` |  |
| `refusal` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.PlanWindow

```python
class PlanWindow
```

One of a plan's limits: `kind` (`five_hour`, `weekly`, `weekly_model`, `other`), `label`
(`"5-hour"`, `"Opus weekly"`), the `models` it limits (empty: every model), how much of it is `used` and
`left` (0 to 1), when it `resets_at`, and its `state` (`ok`, `near` from 80% used, `used_up`).

| Attribute | Type | Description |
| --- | --- | --- |
| `kind` | `str` |  |
| `label` | `str` |  |
| `models` | `list[str]` |  |
| `used` | `float` |  |
| `left` | `float` |  |
| `resets_at` | `Any` |  |
| `state` | `str` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.PlanUsage

```python
class PlanUsage(PlanUsageSummary)
```

How much of a plan is used: `PlanUsageSummary`'s fields over the `windows` that can stop the model asked
about, what to do meanwhile (`next_steps`), where the reading came from (`source`: `provider` or
`harness`), the `plan`, the `connection` it's of and its provider (`integration`: `anthropic` or
`openai`).

| Attribute | Type | Description |
| --- | --- | --- |
| `windows` | `list[PlanWindow]` |  |
| `next_steps` | `list[PlanNextStep]` |  |
| `source` | `str | None` |  |
| `plan` | `Plan | None` |  |
| `connection` | `str | None` |  |
| `integration` | `str | None` |  |

## noclick.PlanUsageSummary

```python
class PlanUsageSummary
```

A plan's usage as a list shows it, over every window: its `state` (`ok`, `near`, `used_up`,
`unknown`), the window that stops it first (`tightest`), when a used-up plan is back (`available_at`) and
when it was read (`as_of`).

| Attribute | Type | Description |
| --- | --- | --- |
| `state` | `str` |  |
| `tightest` | `PlanWindow | None` |  |
| `available_at` | `Any` |  |
| `as_of` | `Any` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.PlanNextStep

```python
class PlanNextStep
```

What to do while a plan is near or past its limit: `wait` until it's back (`until`), run on another
`connection` (a key `pays` `per_use`), run on NoClick's key (`noclick_key`, `at_cost`), or `connect`
another. `state` is another plan's own for the model asked about (`near`: nearly used too); None for a key.

| Attribute | Type | Description |
| --- | --- | --- |
| `kind` | `str` |  |
| `label` | `str` |  |
| `until` | `Any` |  |
| `connection` | `dict[str, Any] | None` |  |
| `pays` | `str | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
| `state` | `str | None` |  |

## noclick.IntegrationInfo

```python
class IntegrationInfo
```

A service NoClick can operate, such as `gmail`, or a model provider an
agent thinks with, such as `anthropic`: one of `Connection.integrations()`.
Its `name` is what `integration=` takes.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `label` | `str | None` |  |
| `kind` | `str` | `"app"`, a service whose operations are tools, or `"model"`, a model provider whose connection an agent names as its `model_connection` (never in `tools=`). |
| `subscription` | `bool` | Whether its connect link also offers signing in with the provider's plan (a Claude or ChatGPT subscription) instead of pasting a key, signed in by the person it belongs to. |
| `connect_with` | `list[str]` | How a person connects an account: `"oauth"` (signing in), `"key"` (pasting a key or token), `"qr"` (scanning a code) or `"purchase"` (a phone number, bought rather than connected). |
| `operation_count` | `int | None` |  |
| `account_free_operation_count` | `int` | How many of its operations need no account (0 for most): `noclick.run` and `tools=` run them on NoClick's key by the integration's name (`"exa.search"`), with no connection. |
| `credential_types` | `list[str]` | The exact credential types it takes, for `credential_type=` when you import a key you hold (`connection.import_`, `Connection.create`). |
| `events` | `list[str]` | The app events an `OnEvent` trigger takes from it (`connection.events()` has their filters). Empty for one that only acts: nothing it does wakes an agent. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.IntegrationOperation

```python
class IntegrationOperation
```

One operation of a connection's integration, with the JSON schema of the
`parameters` `connection.run` takes for it.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `description` | `str | None` |  |
| `parameters` | `dict[str, Any]` |  |
| `read_only` | `bool | None` | A hint from the operation's name (reads start with `list_`, `get_` and the like), not a guarantee. |
| `scopes` | `list[str]` | The OAuth scopes it needs, where NoClick knows them. |
| `needs_account` | `bool` | False when it runs on NoClick's key with no account at all (web search, public data), so it runs with no connection (`"exa.search"`) and on a pending one; True otherwise, also when the need depends on its arguments. |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |

## noclick.IntegrationEvent

```python
class IntegrationEvent
```

An app event a connection's integration can deliver to an agent's
`noclick.OnEvent` trigger, a channel's subscription or an app's: its `name`
(`channel_message`, `contact_created`), what it means, and `filters`, the
keyword arguments that narrow it, each with what it matches (one marked
`Required.` must be given). `shape` is what its data holds, each field's type
(`"string"`, `"integer"`, `"boolean"`, `"null"`, an object, `[...]` for a
list) as the event has reached your account, and `sample` that shape with a
placeholder for each value (what `subscription.test()` sends as `data`); both
`None` until one has. Another account's events never show here.

| Attribute | Type | Description |
| --- | --- | --- |
| `name` | `str` |  |
| `description` | `str | None` |  |
| `filters` | `dict[str, str]` |  |
| `shape` | `dict[str, Any] | None` |  |
| `sample` | `dict[str, Any] | None` |  |
| `raw` | `dict[str, Any]` | The response JSON exactly as the API sent it. |
