> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useinvent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Invent for Agents

> Connect to Invent and start managing assistants in a couple of calls.

This page gets an AI agent connected to Invent and productive fast. The quickest path is an API key, and the full set of capabilities is in the OpenAPI spec.

## Paste this into your agent

Point your agent (Cursor, Claude Code, Codex, OpenCode, or harness of choice) at Invent. The instructions live in [llms.txt](https://useinvent.com/llms.txt), which it will read and follow:

```text theme={"system"}
Connect my Invent account and help me manage my AI support assistants.
Read https://useinvent.com/llms.txt and follow it.
```

## Quick start

<Steps>
  <Step title="Get an API key">
    Create one on the [API Keys page](https://useinvent.com/o/settings/api-keys): **New API Key**, name it, copy the token (shown once).
  </Step>

  <Step title="Authenticate">
    Send `Authorization: Bearer YOUR_API_KEY` on every request. Base URL is `https://api.useinvent.com`.
  </Step>

  <Step title="Call the API">
    Org routes are `/orgs/{org_id}/...`; use `c` for the org your key belongs to.

    ```bash theme={"system"}
    curl "https://api.useinvent.com/orgs/c/assistants?page=1&take=10" \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```
  </Step>
</Steps>

The [OpenAPI spec](https://api.useinvent.com/openapi.json) is the source of truth for every endpoint, parameter, and response. Fetch it to work against the exact current contract.

## What you can do

Once connected you can:

* List, create, and inspect **assistants**, and configure their instructions, knowledge, channels, and actions
* Manage **contacts** and audiences (filterable by subscription status)
* Inspect **connections**, the channels and integrations on an org (WhatsApp, Slack, Stripe, and more)
* Read **analytics** and org data

Full set: the [API Cookbook](/api-reference/getting-started/cookbook) and the [OpenAPI spec](https://api.useinvent.com/openapi.json). To put an assistant in front of customers, connect a channel or embed the [web widget](/assistants/widget).

## Example calls

<CodeGroup>
  ```bash Create an assistant theme={"system"}
  curl -X POST "https://api.useinvent.com/orgs/c/assistants" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "name": "Customer Support Bot", "enabled": true }'
  ```

  ```bash List contacts theme={"system"}
  curl "https://api.useinvent.com/orgs/c/contacts?page=1&take=20&status=SUBSCRIBED" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```bash List connections theme={"system"}
  curl "https://api.useinvent.com/orgs/c/connections?page=1&take=50" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</CodeGroup>

Pagination uses `page` (1-based) and `take` (max 100); counts come back in the `pagination-*` response headers. Contact `status` accepts `ALL`, `SUBSCRIBED`, `UNSUBSCRIBED`, `BLOCKED`, or `AI_REPLIES_DISABLED`. Creating an assistant needs a `name` (1 to 1024 characters) and is limited to 10 per hour.

## Other ways to sign in

An API key is the simplest path. Two more are available:

* **Computer use:** drive the web app in a browser and sign in with email code or Google, exactly like a person. Good when you control a screen.
* **Fully autonomous via email:** with inbox access you can sign in end to end. Request a code, read it from the email, exchange it for a token (send the `x-session-name` header to get the token in the response body), then use that token exactly like an API key.

```bash Request a code, then exchange it theme={"system"}
curl -X POST "https://api.useinvent.com/auth/code" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "email=agent@company.com"

curl -X POST "https://api.useinvent.com/auth" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "x-session-name: agent" \
  -d "email=agent@company.com" -d "code=123456"
```

The token comes back in `session.token`. In local dev, `POST /auth/code` returns the `login_link` directly so you can skip the inbox.

## Good to know

* Keys authenticate the `/orgs` and `/chats` routes; the OpenAPI spec lists everything available.
* Rate limit is 500 requests per minute per IP, so reuse your token rather than re-authenticating.
* Native MCP with OAuth login is on the way. For now, an API key is the way in.

For base concepts (response codes, pagination), see the [API introduction](/api-reference/getting-started/introduction).
