For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

API access

API access to your eesel AI agent: get a workspace token, then use it from your own code, a script or CI through the eesel CLI or eesel's MCP endpoint, with no browser sign-in.

API access lets your own code, a script or a CI job use your eesel agent without a browser sign-in. It works with one workspace token.

eesel doesn't have a separate REST API. Your code uses the same two ways in that AI assistants use:

  • The eesel CLI, with the token set as an environment variable. Easiest for scripts and CI.

  • eesel's MCP endpoint, called over plain HTTP. Easiest from your own backend code.

Both give you the same things: chat with your agent, check what's connected, connect integrations, manage automations, read files and decide approvals.

For hands-on setup, use the dashboard. For programmatic operation, use eesel CLI with existing workspace credentials or call the MCP endpoint. Both let your coding agent inspect connections, chat and manage supported automation settings. If you are starting from a terminal without eesel MCP connected, use the CLI and follow the coding-agent quickstart for the requested setup. If eesel MCP is already connected to the intended workspace, use it without adding another connection.

If you need connection details, npx @eesel/cli mcp token returns the actual mcp_url, agent_id and authorization headers. Use those outputs instead of asking someone to find IDs in the dashboard. Select the intended workspace and agent first. A new anonymous trial can start through eesel init; external account approvals and any required dashboard forms remain separate steps.

Get a token

From the dashboard

  1. Go to Settings > Developers and click Add API token.

  2. Name it after the script or tool that will use it, for example "Nightly import script", and click Create token.

  3. Copy the token. It's shown once, so put it in your secrets store before you close the popup.

A token from the dashboard lasts until someone revokes it. It acts with your access, and stops working if you stop being an editor of the workspace. Make one per script or tool, so you can revoke one without breaking the rest.

Your code also needs the agent id. It's in the agent's dashboard address: /platform/<agent id>/.

Only editors can add or revoke tokens. Everyone in the workspace can see the list. Workspaces under a HIPAA agreement can't make API tokens.

From the eesel CLI

Sign in once from a machine with a browser, then ask the CLI for the token:

mcp token prints three things your code needs:

  • mcp_url, the full MCP endpoint URL

  • token and headers, including the authorization header

  • agent_id, the id of the agent to use, and expires_at

Keep the token in your secrets store or .env file, never in your code. Anyone holding it can act in your workspace until it expires.

If you set up eesel with the CLI without signing in (an anonymous workspace), mcp token still works, but the token ends when that workspace does, after 7 days. Run eesel login for a signed-in workspace token, then check its claim result and selected workspace before continuing. A claim can leave the anonymous trial separate if the account already has a workspace.

For a token that doesn't expire, make one in Settings > Developers instead.

Revoke a token

In Settings > Developers, open the token's ... menu and choose Revoke token, then confirm. It stops working on its next request. A CLI token can't be revoked on its own. A signed-in CLI token expires after 30 days; an anonymous one ends with the trial.

Use it from a script or CI

Set three environment variables and the CLI runs without a sign-in:

Environment credentials work with commands such as status, chat, automations and widget. init and files upload use a stored browser login or anonymous session instead; init can create the anonymous session. agents create and the direct website or chat-bubble connect commands need a browser login. Follow each command's error hint. Setup and status results are JSON; chat returns a JSON receipt when piped. See The eesel CLI.

Use it from your own code

Send a POST to the MCP endpoint. This asks your agent a question:

The reply comes back as JSON. If your agent is still working on it, the reply includes a task_id. Send chat again with just that task_id to collect the answer, or with a task_id and a new message to continue the conversation.

To see everything you can call, send "method": "tools/list" instead. The tools are the same ones listed on Claude Code & MCP clients.

Let your code wake the agent instead

If your code only needs to hand the agent some data and let it act on its own, such as "a new order came in, check it", a webhook automation is simpler. It gives you a URL, and your code sends a plain HTTP POST with no API token.

Good to know

  • A token covers the whole workspace. The X-Eesel-Agent-Id header, or EESEL_AGENT_ID, picks which agent it acts as.

  • A CLI token carries your role from when you made it: a viewer's changes wait for an editor to approve them, and if your role changes, make a new one. A dashboard token always acts as an editor, and stops working if its maker stops being one.

  • To change the agent's instructions or memory, ask it in chat. There's no direct write for those, from the API or anywhere else.

  • When a CLI token expires, run eesel mcp token again and update your secret. Dashboard tokens don't expire.

FAQ

Does eesel have a REST API?

Not a separate one. Your code uses the eesel CLI with a token, or calls eesel's MCP endpoint over HTTP. Both reach the same features. See Use it from your own code.

How do I get an eesel API token?

Add one in Settings > Developers: it lasts until it's revoked. Or run npx @eesel/cli login, then npx @eesel/cli mcp token, for a token that lasts 30 days.

Can I use the eesel CLI in CI without a browser?

Yes. Set EESEL_API_URL, EESEL_API_TOKEN and EESEL_AGENT_ID as secrets in your CI, and the supported commands run without an interactive sign-in. Provisioning and file uploads need a stored login or anonymous session; see Use it from a script or CI.

Last updated