Tokens and credentials

The six kinds of credential in Oalo, what each one is for, how to create it, and which ones are safe to put in an app.

Oalo has six kinds of credential. They are easy to confuse because several are called "the token" in conversation, and picking the wrong one either fails loudly or, much worse, leaks data quietly.

The one question that sorts them out: does this caller act as one specific person, or as the whole workspace? Everything below follows from that.

Which one do I need?

I want to…UseActs as
Let people sign in to the app I builtApp user sign-inone end user
Call Oalo data from my own server or a scriptSync API tokenthe workspace
Run my app's server on my laptop against OaloSync API token locked to dev (section 2)the workspace's dev data
Drive a chatbot from my own backendBot API tokenthe workspace
Let my app's users chat with a botChat session tokenone end user
Let an AI agent or the CLI build things for meCLI & MCP tokenyou
Let my bots answer from a computer of mine (oalo serve)Machine tokenone machine, answering only

1. App user sign-in

How the people who use your app prove who they are. Your app signs them in, and from then on each of them reads and writes only their own rows. One person cannot see another's data.

This is the only credential that belongs inside a shipped app. See auth.md.

2. Sync API token

A machine key for the data API. Use it from a server you control: a backend, a scheduled script, an analytics job, an import.

Create: oalo tokens create, which has every option below; or dashboard → Sync API (under Developers) → Generate Token, which makes read or read + write tokens on every table or named ones, with no expiry. An app's Launch panel has a Sync API tokens section that adds events, workflows and an expiry. Shown once. (The oalo CLI gets its own read-only one as part of a connection; see section 5.) A server app hosted on Oalo already has one, as OALO_SYNC_TOKEN, locked to its own env's data (see App environment).

You choose:

  • Read only or read + write. Write also grants read, and allows deletes.
  • All tables, or a named list. A token limited to two tables cannot touch a third. This is the real way to limit what an integration can reach.
  • Can send events, for an app's server to send events that start workflows (POST /api/events/v1, see App events). Write does not include it. From the CLI, oalo tokens create --name <what it is> --scope events makes a token that can only send events.
  • Can call workflows, for an app's server to call a workflow and get its answer (POST /api/workflows/v1/<name>/run, see Calling a workflow from your app). Write does not include it either; --scope workflows from the CLI.
  • Can start chat sessions (chat), for an app's server to sign the chat widget in as its own user (POST /api/chat/v1/sessions, see Chat widget). No dashboard panel has an option for it, so create it from the CLI with --scope chat.
  • One env only (env:dev or env:prod, CLI only): the token reaches that env's data and nothing else. With env:dev, events are dry runs and workflow calls are test runs. That is the token for running an app on your machine (below).
  • An expiry date. From the CLI the default is 90 days; --days 0 makes one that never expires. It stops at that time of day on the date shown (UTC), not at the end of the day; from then on every call with it gets 401 saying it has expired. Put the date in your calendar.

An unknown scope is refused, and the error lists the valid ones.

Server-side only. Never ship one in a mobile or web app. A Sync API token carries no end-user identity, so it reads and writes every member's rows. It is a workspace-wide key. If you need your app's users to reach their own data, that is App user sign-in above, not this.

Running your app on your machine

A server app hosted on Oalo gets its token in its environment. On your laptop it has none, so make one locked to dev:

oalo tokens create --name "my laptop" --scope read,write,events,workflows,chat,env:dev --days 30

Put it in an uncommitted .env as OALO_SYNC_TOKEN, with OALO_URL=https://<base>.oalo.ai, so the code reads the same names as on Oalo. It reaches dev data only, and its events and workflow calls are test runs, so nothing reaches a real customer. Revoke it with oalo tokens revoke <id> when you're done.

3. Bot API token

Server-to-server access to a chatbot: send it messages, read conversations, hand a thread to a human. Use it when you drive a bot from your own backend instead of the embed widget.

Create: dashboard → the bot → API access → New token. Shown once, per bot, and rotatable (rotating issues a replacement and retires the old one).

Like the Sync API token, this is a workspace credential. Keep it on a server.

4. Chat session token

Short-lived and bound to one end user. Your backend exchanges that user's own sign-in for a chat token, hands it to your app, and the app talks to the bot directly as that person.

This is how you let real users chat from a client without ever shipping a Bot API token. It expires after an hour, and the response tells you when, so refresh on expiry or on the first rejected call.

There are two ways to get one, for two situations:

  • Your app's server vouches for its user: POST /api/chat/v1/sessions with a Sync API token that has the chat scope (a server app's own OALO_SYNC_TOKEN has it). It answers user_token and expires_at, which the chat widget uses. See Chat widget.
  • The user's own sign-in is exchanged: POST /api/v1/chat/token with the bot's public id and the user's existing credential (an Oalo sign-in, or another provider the bot is set up to check). See Auth and Conversations API.

5. CLI & MCP token

Lets the oalo CLI, or an AI agent through an MCP client such as Claude Code, work in your workspace: build flows, edit bots, write tools, inspect what ran.

Create: run oalo login <workspace> (your Base at <workspace>.oalo.ai; --server <url> for a custom domain) and approve it in the dashboard, which opens on Account → CLI & agents. Check that the page shows the same code as your terminal, and approve only a login you just started yourself. On a machine with no browser, use Create connection on that page instead: it shows one oalo link command with the tokens filled in, plus a ready-to-paste MCP config. Those are shown once.

A connection is a CLI token plus a read-only Sync API token (for oalo typegen and oalo tail). Both are listed as one row on that page and revoked together. oalo logout revokes it from the machine itself.

oalo data push, oalo data delete and an agent's data writes over MCP make one more token on that machine: a write token named "<machine> CLI writes", limited to the tables it has written, for 30 days. oalo logout revokes it with the connection. Revoking the connection on the CLI & agents page does not, so for a lost laptop revoke that token too (Sync API in the dashboard, or oalo tokens revoke <id>).

This one acts as you. It inherits your own permissions exactly, so it can reach anything you can reach and nothing you cannot. There is no read-only mode: treat it like your password. Revoke it the moment a laptop is lost or a contractor's work ends.

Using one does not disturb your dashboard. An agent session and your own browser tab run side by side.

One CLI action needs more than a CLI token: oalo emit, which fires a test event (form.submitted, order.created, ...) so the loops listening for it run for real. Admins can always use it. A member needs Developer access, which an admin turns on in the Team panel. oalo whoami shows whether you have it.

6. Machine token

Lets a computer of yours run oalo serve, so your bots and workflows can ask it things: search a folder on it, run a script that reads your own database. The computer connects out to your Base; nothing on it is opened to the internet.

Create: oalo machines add <name> (admins only). The CLI saves the token straight into ~/.oalo/serve/<name>.json on that computer and never prints it.

It can only answer. A machine token joins its own connection and replies to the requests your Base sends it. It can't read your data, change a bot, or do anything else, so a stolen one can't reach into your workspace. Revoke it with oalo machines revoke <name>: the connection closes and its tools switch off.

How to set one up and share a folder, a script or a model: Answer from your own data and Run your bot on your own model.

Rules that apply to all of them

  • Shown once. Every token above is displayed at creation and never again. Lost it? Revoke and create another. Oalo cannot recover it.
  • Revoking is immediate, for connections already open too: a Sync API stream or a Conversations API socket opened with the token is closed. A revoked token leaves the list. An expired one stays on it, marked expired, until you revoke it.
  • Expiry is optional but recommended for anything handed to a contractor, a one-off script, or a trial integration.
  • Name them for where they live ("billing cron", "Ana's laptop"). When you come back in six months, the name is the only way to know what breaks if you revoke it.
  • One token per consumer. Sharing one across two systems means revoking it takes down both.

Keys you give Oalo

Some keys go the other way: yours, stored with Oalo so it can act for you, such as your own Expo access token for native builds (Integrations, on the Expo tab). They are kept encrypted and only their last 4 characters are ever shown back. None of the tokens above can read them.

Common mistakes

  • Shipping a Sync API token in an app. The single most damaging error here: it exposes every member's data to anyone who inspects the app. Use App user sign-in.
  • Using a Bot API token in a browser. Same problem, one plane over. Use a Chat session token.
  • Reaching for a CLI token to integrate an app. It acts as you, is meant for tooling, and is the wrong shape for a production integration. Use a Sync API token scoped to the tables the integration needs.
  • One "god" token for everything. Scope to the tables you actually need, so a leak is a contained problem rather than a total one.
Related
Start with Oalo

Your own Base, with every feature, from $99 a month.

get started