Skip to content

Setting up a company: blueprints, people and teams

Last updated November 5, 2026

On this page

This page takes you from an empty folder to a company of your own: the first admin and the setup wizard, departments from a blueprint or by hand, people and teams, how people sign in (email and password, optional two-step sign-in) and what API tokens are for, and the company's currency and time zone.

Examples use the demo's people where you can follow along in ok demo (Ada the admin, Maya the support lead, Alice the sales rep, Eli the engineer), and new names (Carol, Grace, Hugo) for people the demo does not have. What is not possible yet is listed at the end.

A few words used throughout:

Term Meaning
Actor Anyone in the company directory: a person, a team or an agent. Every actor has an id such as alice or team:sales.
App One part of the company's work, packaged: its records, agents, tools and pages. CRM and Support are apps. The command line and some messages call an app a pack. See Apps.
Seat A person a blueprint adds.
Delegation Permission for an agent to act for a person. See Delegations.
Event log The record of everything that happened in the company. See Events and audit.

Before you start#

You need the ok binary (see Quickstart with the demo company for building it). Two rules apply to everything below.

  • One state file is one company. ok init writes it to ./.orchkernel/state.db in the current folder. Pass --state <path> (or set OK_STATE) on every command to use another file.
  • One writer at a time. While the server runs, it alone writes the state file: a command that would change it, such as ok actor add-human, is refused with exit status 75 and "The server is running on ...". Use the web pages or the API then (see For developers), or stop the server first.

The demo company is for trying things. For a real company, start from ok init as below, never from the demo's state file.

Create the company and its first admin#

  1. In an empty folder, run:

    sh
    ok init --admin ada --email ada@acme.example --name "Ada Park"
    

    It prints one line on standard output, a setup link such as http://127.0.0.1:8080/welcome#t=okl_..., and on standard error "kernel ready; admin ada" and that the link is valid for 24 hours and works once. The folder now holds .orchkernel/state.db. Links point at OK_PUBLIC_URL when it is set (the https address people use), else at the address ok serve listens on by default.

  2. List who is in the company:

    sh
    ok --as ada user list
    

    You see Ada, active, with her address and "last sign-in never". ok --as ada actor list also shows the three built-in agents: architect, designer and schema-steward.

  3. Start the server and open the link:

    sh
    ok serve --bind 127.0.0.1:8080
    

    Open the setup link in a browser. Ada chooses a password (at least 12 characters, not a common one, not her address or name) and lands in the workspace signed in, on the first-run wizard.

    The server's start keeps the link ok init printed: its standard error says "No admin has a password yet" and "ada: open the link ok init (or ok user sign-in-link) printed, valid until ...". Lost the link, or it expired? ok --as ada user sign-in-link ada --print (server stopped) makes another and cancels the old one; the next start keeps that one too. An admin with no password and no live setup link gets a fresh one printed at every start (each start replacing the one the previous start printed).

Or start with no command at all. ok serve on an empty folder (or on a state file with no person in it) makes the company itself and prints a first-admin link on standard error:

text
No admin yet. Open this link to create the first admin: http://127.0.0.1:8080/welcome#t=okl_...  (valid 24 hours, until 2026-10-07 09:30 UTC, once; the next start replaces it)

The page asks for a name, an address (twice) and a password. Completing it creates the company's first admin, with an id made from the address (the part before @ in lower case, such as ada-park for Ada.Park@acme.example, with -2 added when it is taken), signs them in and opens the wizard. The link works once, for 24 hours; each start replaces it, and none is made once the company has a person. It is printed only to the server's own output and is never kept once used, cancelled or expired. A single server only: under tenancy, ok tenant create names the first admin instead.

Notes:

  • ok init works once per state file. Run it again and it is refused: "policy denied bootstrap: kernel already has humans; use onboard".
  • Without --email, ok init --admin root creates the admin with no address and prints "kernel ready; admin root". Give them one later with ok --as root user edit root --email root@acme.example, then make a setup link.
  • Commands that change the company need --as <id> (or OK_AS) to say who is acting. Without it the command uses your computer's user name and fails with "unknown actor ". Commands that only list, such as ok actor list, ok token list and ok blueprint list, run without it.
  • Commands that change the state file directly need the server stopped: while it runs they are refused with exit status 75 and "The server is running on ...". Commands that only read (lists, ok runs, ok brain query) work while it runs, from a snapshot. Commands with --server talk to a running server instead (see From the command line).

The first-run wizard#

A company made by this release (a first-admin link, ok init, or ok tenant create) opens on Get started for its admins: five steps, each with Continue and Skip, and from the second step on Back. Finish later leaves it and keeps your place; until it is finished, a banner above every page says "Finish setting up: 3 steps left" with Continue. Only human admins see it; everyone else lands on Threads.

Step What you do Done when
1. Your company The company's name (in emails and on the sign-in page), your own name, and, optionally, two-step sign-in (Set up now). The company has a name.
2. Connect a model Pick a provider, enter its key, Test, choose the models, the default and what each may see (Models). Skip leaves agents unable to run until a model is connected later from Models. A model answers (status ready).
3. Search by meaning A switch for the built-in model, on by default: it runs on this server, downloads once (about 91 MB) into models/ beside the state, then indexes in the background. Read-only when the server's configuration names the embedding models. Always.
4. Choose apps The bundled apps with what each does and its agents; Enable opens the usual enable sheet (bind its teams, or create them). Or install a blueprint. Always.
5. Invite people Invite people opens the invite form; without email set up, each invite is a link you copy. Set up email (optional) opens the email settings with the Resend preset. Always; Finish ends setup and lands on Threads.

Each step's own action is recorded as usual (the company, a model, an invite, an app, email), and so is each step's state (setup_step_changed), the finish (setup_finished, which marks pending steps skipped) and a restart (setup_reopened). A company from before this release never sees the wizard; an admin can start it from Setup with Run setup (Run setup again once it has been finished), which also brings back the steps that were skipped.

Installing a blueprint#

A blueprint is a whole company, or one department, written as data: which apps to install, which teams exist, which people (seats) sit in them, which agents act for whom, and any extra pages. Installing one does in one step what you could do by hand, through the same checked actions, so the event log reads the same either way.

OrchKernel ships one blueprint:

Blueprint Apps Teams People Agents acting for people
SaaS startup (saas-startup) CRM, Support, Product Sales, Support, Product, Engineering (Sales and Support get a 500.00 monthly budget, Product 300.00) none Sales Assistant for everyone in Sales; Support Agent for everyone in Support

It also brings the apps' agents: Sales Assistant, Support Agent, Triage, Product Agent and Analyst Agent.

From the Setup page#

Admins only. Open Setup in the sidebar.

  1. Under Blueprints, find SaaS startup. The row lists its apps and teams.
  2. Choose Install. It reads "Installing…" for a moment, then a note says "Installed crm, support, product" and the row shows Already set up.
  3. Open Directory. Under Teams you see Engineering, Product, Sales and Support; under Agents, the five agents above next to the three built-in ones.

On a company with no apps yet, the row and the note show app ids ("crm, support, product") instead of names; after the install the row reads "CRM, Support, Product". This is a bug and has been reported.

A blueprint whose apps are all installed always shows Already set up, so you cannot install it twice from the page. In the demo, Setup shows SaaS startup as already set up. Someone who is not an admin sees "Only admins set up the company." and no Install button.

From the command line#

With the server stopped:

sh
ok init --admin root --blueprint saas-startup     # a new company, set up in one step
ok --as root blueprint install saas-startup       # an existing company
ok blueprint list                                 # the bundled blueprints

Either install prints what it did:

text
installed blueprint saas-startup: 4 teams, 0 people, packs [crm, support, product], 0 delegations, 0 views

Installing again is safe: everything already there is skipped and listed as already present: team team:sales, already present: pack crm, and so on. A skipped team is left as it is, budget included.

"0 delegations" is expected: SaaS startup has no people, so its Sales and Support teams have no one for the assistants to act for yet. As soon as you add someone to Sales, the Sales Assistant starts acting for them (see Teams).

Only a human admin can install a blueprint. Anyone else is refused with "policy denied blueprint.install(saas-startup): only human admins install blueprints".

Writing your own blueprint#

ok blueprint install also takes a YAML file. Save this as acme.yaml; it sets up sales and support with three people:

yaml
id: acme
name: Acme
description: Sales and support for Acme.
packs: [crm, support]
teams:
  - { id: team:sales, name: Sales, lead: carol, budget: 50000 }
  - { id: team:support, name: Support }
people:
  - { id: carol, name: Carol Diaz, role: sales_lead, team: team:sales }
  - { id: alice, name: Alice Chen, role: sales_rep, team: team:sales, reports_to: carol }
  - { id: maya, name: Maya Patel, role: support_lead, team: team:support }
delegations:
  - { agent: sales-assistant, to: [team:sales], authority: act_as, max_risk: high, reason: works each rep's pipeline }
sh
ok --as root blueprint install acme.yaml
# installed blueprint acme: 2 teams, 3 people, packs [crm, support], 2 delegations, 0 views

The two delegations are the Sales Assistant acting for Carol and for Alice.

Field What it holds
id, name, description What the blueprint is called.
packs Bundled app ids to install, in order: crm, support, product, sales, marketing, support-ops, product-ops, tech, founder, context.
teams Each team's id (written team:<name>), name, optional lead (a person's id) and optional monthly budget in cents (50000 is 500.00).
people Each seat's id, name, role, and optional team, reports_to, email, expertise. A blueprint is the one place outside the API where you can give a person a display name.
delegations Which agent acts for which teams or people: agent, to (a list), authority (act_as or advise), max_risk (low, medium, high), reason. A team expands to the people in it when the blueprint is installed.
views Extra pages beyond what the apps ship.
inline_packs An app defined inside the blueprint. The Architect writes these; you rarely need one by hand.

The install refuses a blueprint that names an agent no app provides: a delegation to nobody-agent stops it with "unknown actor nobody-agent", and nothing is installed.

Describing the company to the Architect#

The Architect is a built-in agent that turns a sentence into a blueprint. It never installs anything itself: it files the blueprint as a change, and an admin promotes it. It calls a model to write the draft, so it needs one configured (see Models).

  1. On Setup, under Or describe it, write what you want: "We also have a finance team. Grace leads it and Hugo reports to her."
  2. Choose Ask the Architect. The page "New conversation with Architect" opens with your text in the message box. Choose Send.
  3. The Architect replies with the draft: "Drafted "": ... An admin promotes it from Governance to install." Nothing is installed yet. If the company already has everything you described, it says "Nothing to change" and files nothing.
  4. The blueprint waits under Governance › Changes; promote it as below.

Promoting a blueprint from Governance#

A blueprint proposed as a change (by the Architect, or through the API, see For developers) waits under Governance › Changes. To follow along in the demo, propose the Finance team blueprint through the API first (the POST /changes row in the API table), signed in as Ada.

  1. Open Governance and the Changes tab. Under Proposed you see "blueprint Finance team: 0 packs, 1 teams, 2 seats", the request it came from and "proposed by Ada Park". Choose content to see the blueprint itself.
  2. Choose Approve. A sheet "Approve this change" opens with an optional Note. Choose Approve again. A note says "Reviewed", the card reads "Ada Park approved: ", and its buttons are now Promote and Reject.
  3. Choose Promote. A note says "Promoted". The blueprint is installed at that moment: Grace Hall, Hugo Diaz and the Finance team are in the Directory and on People, and the change is listed under Promoted.

A blueprint that brings apps from the catalog is reviewed under the apps' rules; see Changing a skill or playbook and Apps.

People: invite, edit, deactivate, offboard#

People sign in with their email address and a password. They get in through a link: an invite for someone new, a setup link for someone who exists but has no password yet, a reset link for a forgotten password. A link works once, expires (an invite after 7 days by default, a setup link after 24 hours, a reset link after an hour), and making a new one of the same kind cancels the old one.

When email is set up (see Email), links are emailed. Without it, a link is shown once to the admin who made it, to send themselves: "Send this to Carol yourself. It works once and expires on Oct 12."

The people panel#

Admins open People. It lists everyone with their address, role, team and status (Active, Invited, Invite expired, Deactivated), whether two-step sign-in is on, and their last sign-in. An invite that expired unused stays listed for 30 days as Invite expired, with Resend and Copy new link in its drawer. A person's drawer has their details with Edit, their sign-in (send a setup or reset link, reset two-step, clear a lock), their sessions (End, End all), their API tokens (Revoke), and at the foot Deactivate or Reactivate and Offboard. Under their role, the drawer says whether they manage agents ("Manages agents for Sales · kept from team lead"), and for a lead offers "Make it a full grant?" or "Also let them manage agents for Sales?".

A Permissions tab (admins) lists who may make, change and assign agents besides admins, with Grant and Revoke: see Manage agents.

A Teams tab (admins) lists the company's teams with their lead and how many people are on each. Add a team asks for a name and an optional lead; its id is team: and the name in lower case with dashes ("Partner Success" is team:partner-success). Rename changes a team's name only: its id, lead, people and everything that names it stay. Two teams cannot share a name ("another team is called Revenue"). Who is on a team is set on each person, in their drawer or when they are invited.

A team lead opens People too and sees the members of the team they lead: name, address, role and status, nothing about sessions or tokens. They may invite into their team (an admin approves the invite before it is made), copy a new link for, resend or cancel the invites they made, and deactivate or reactivate a member who holds no admin role. Offboarding and every other change stay with admins.

The admin's approval reads in plain words: "Invite Carol Diaz (carol@acme.example) as support_agent to Support". Without email nothing is sent when it is approved: the approval card says "Email is not set up: once approved, copy Carol's link from People and send it", and the invite's row says "Not sent: copy a link from here". The lead or an admin presses Copy new link and sends it.

Inviting someone#

  1. In People, choose Invite people. Enter Email, Name, Role (sales_lead, support_agent: free text; admin and data_owner make someone an admin), Team, any Other teams they join as a member, and Reports to.
  2. Keep "Send the invite by email" checked (it is checked and enabled only when email works) and choose Invite. The panel says "Invite sent to carol@acme.example" and lists Carol as Invited. Without email, the sheet shows the link once with Copy.
  3. Carol opens the link, sets her password and lands in the workspace. Only then does she join the directory: until she accepts, she is no approver, and no app's agent acts for her. Once she joins team:sales, the Sales Assistant acts for her at once, as joining a team always does.

From the command line, with the server stopped:

sh
ok --as ada user invite carol@acme.example --name "Carol Diaz" --role sales_lead --team team:sales

Without email it prints the link alone on standard output. --print prints it even when email works. Resend (or POST /people/invites/:id/resend) makes a new link and kills the old one at once; Cancel invite cancels it.

An address belongs to one person, ignoring case and spaces: inviting or giving someone an address another person holds is refused with "Someone else already uses that email address."

People who were added before sign-in had passwords#

People added with ok actor add-human, a blueprint or before this release have no password. Their drawer offers Copy a sign-in link (and Email a sign-in link once email works): a setup link, chosen because they have no password; for someone who has one, the same buttons read reset link. If they have no address, give them one first with Edit (or ok user edit <id> --email ...), or leave it out and the setup page asks them for one. Their old sign-in tokens keep working on the API until they expire; the panel says "N old sign-in tokens" with Revoke all.

An admin who upgraded with only a token can use it once for their own link:

sh
curl -X POST "$OK_PUBLIC_URL/api/people/ada/sign-in-link" \
  -H "Authorization: Bearer $OK_TOKEN" -H "content-type: application/json" \
  -d '{"kind":"setup","send":false}'

A token makes a link only for someone who has no password yet; anything more needs a signed-in browser session.

Editing someone#

Edit in the drawer changes name, role, team, other teams, manager and address. Only the fields you change change. If another admin changed the person since you opened the drawer, the save is refused ("Someone changed Alice meanwhile. It was reloaded: make your change again.") rather than overwriting their change. Giving someone an admin role asks you to confirm your password first.

sh
ok --as ada user edit carol --role sales_director
ok --as ada user edit carol --also-team team:west --also-team team:east   # her other teams, in full

ok actor add-human on an id that exists is refused: "carol exists; use ok user edit". A person changes their own name from their profile, and their own address there too (a link goes to the new address; the old one is told).

Teams#

Teams are still added from the command line, a blueprint or the API:

sh
ok --as ada actor add-team team:ops --lead carol

The lead is the person in charge of the team's roster on the people panel, may pause the shared agents that work for the team, and at the upgrade kept what they could do over the team's agents as a grant of manage agents kept from team lead. Who sets up agents is otherwise a permission an admin gives to anyone: see Manage agents.

Deactivating and reactivating#

Deactivate (with a reason) turns someone's sign-in off without removing anything: their sessions end, their API tokens stop working (they are kept), and every agent acting for them is stopped at its next step ("actor alice is paused"). Nobody can deactivate themselves, and the company's last admin cannot be deactivated. Approvals waiting on them by role (a rule that asks "finance") move to the role's other holders, who find them in their Inbox, and a new one skips them; an approval a rule addressed to them by name waits for them. Reactivate turns it all back on, except the sessions: they sign in again. A switch released with Kill switches does not undo a deactivation; only Reactivate does.

sh
ok --as ada user deactivate alice --reason "on leave"
ok --as ada user reactivate alice

Offboarding#

Offboard removes someone for good. The confirmation lists what it ends, for instance "Ends 2 delegations, cancels 1 run and 1 task, withdraws 1 approval, ends 3 sessions, deletes 2 tokens". Offboarding revokes their delegations, cancels the work running for them and the approvals they asked for, deletes their sessions, API tokens and password, cancels the invites they made (listed so another admin can send them again), and frees their address so they can be invited back later. The last admin cannot be offboarded, and nobody offboards themselves.

sh
ok --as ada user offboard carol --reason "left the company"

ok actor offboard carol does the same.

When someone who is not an admin changes a person#

An invite, edit, deactivation or offboarding by someone who may not make it alone is held for an admin, as every actor change is: the answer is "approval required: " and an admin finds it in Inbox. A team lead's invite into their own team is such a case; their deactivation of a member is not (it happens at once, unless a company rule says otherwise).

Email#

Admins set email up in Governance, Sign-in (its Email section): Resend (an API key and a From address on a domain verified at Resend; port 465, or 587), or Other SMTP server. Send test email says where it stopped if it fails, in words: "Resend refused the sender: the domain of noreply@acme.example is not verified (550)". From the command line, with the server stopped:

sh
export RESEND_KEY=re_...
ok --as ada mail set --preset resend --from noreply@acme.example --password-env RESEND_KEY
ok --as ada mail test
ok --as ada mail show

The API key is stored sealed with OK_SECRETS_KEY (without the key, it is refused), is never shown again ("password: set"), and no command takes it as an argument. Leave Resend's open and click tracking off: click tracking rewrites links, so a reset link would pass through Resend. Mail can also come from the server's environment (OK_SMTP_HOST, OK_SMTP_PORT, OK_SMTP_SECURITY, OK_SMTP_USERNAME, OK_SMTP_PASSWORD, OK_SMTP_FROM, OK_SMTP_FROM_NAME), used when the company has no settings of its own. See Production hardening for the details.

Without email, Forgot password? is not offered on the sign-in page ("Ask an admin for a reset link") and the people panel says "Email is not set up: links are copied, not sent".

API tokens#

API tokens (orchk_...) are for scripts, the command line's --server mode, outside agents and CI. Nobody signs in to the workspace with one. Each person issues their own from their profile (API tokens, New token, after confirming their password), with a label, a lifetime of at most 90 days by default, and optional scopes. Admins see and revoke anyone's from the people panel, and issue tokens only for kernel agents and outside agents.

A token cannot issue a token, nor change a password, an address, two-step sign-in or sessions. So ok token issue --server no longer works: issue your own in the workspace, or, for a kernel agent, run ok --as ada token issue --for <agent> --scope changes --label <text> with the server stopped. Outside agents get theirs from the Directory or ok agent register, as before.

Walkthrough: a fresh company, a new person, their first sign-in#

Run this in an empty folder.

  1. Create the company with the SaaS startup apps and an admin with an address:

    sh
    ok init --admin ada --email ada@acme.example --name "Ada Park" --blueprint saas-startup
    

    Standard output is Ada's setup link; standard error says "kernel ready; admin ada" and "installed blueprint saas-startup: 4 teams, ...".

  2. Invite Carol as sales lead. Without email set up, the link is printed:

    sh
    ok --as ada user invite carol@acme.example --name "Carol Diaz" --role sales_lead --team team:sales
    
  3. Start the server: ok serve --bind 127.0.0.1:8080.

  4. Open Ada's link (the one ok init printed: the start keeps it), set her password: she lands on Get started, the first-run wizard. In a private window, open Carol's link and set her password: she lands on Threads, and ok log --limit 10 (it only reads, so it works beside the running server) shows a delegation_created line for the Sales Assistant acting for carol.

  5. From now on, invite people from People while the server runs.

The company currency#

Every amount in the workspace (budgets, spend, costs, money fields in records) is shown in one currency, USD until an admin changes it. The currency changes how amounts read, not the amounts kept: a budget of 50.00 stays 50.00 and reads €50.00 after a switch to EUR.

  1. As an admin, open Setup. Under Company, the Currency field shows the current code, with an example in the text underneath: "such as $1,250.00".
  2. Type a three-letter ISO 4217 code, such as EUR (lower case is turned to upper case as you type). Pick one of the suggested codes or type any other. Save currency stays grayed out until the code has three letters and differs from the current one.
  3. Choose Save currency. A note says "Amounts now show in EUR" and the example reads "such as €1,250.00".
  4. Check an amount elsewhere: in Directory, open the Support Agent. Its spent line now reads "€0.00 of €50.00".

The change is recorded in the event log as "company currency set to EUR (was USD)", by the admin who made it.

Other people signed in at the time do not always see the change at once. In the demo, Maya's open Directory panel went from "$0.00 of $50.00" to "€0.00 of €50.00" within two seconds when Ada switched to EUR, but stayed on € for more than 25 seconds when Ada then switched to INR, until a later change. Reloading the page always shows the current currency. This is a bug and has been reported.

A code that is not a currency (ABC) is refused: ""ABC" is not a currency code. Use one such as USD, EUR or INR." Someone who is not an admin sees the field on Setup grayed out, with no Save button. There is no command-line command for the currency.

The company time zone#

Repeats, app schedules and dates such as "last week" are read in one time zone, UTC until an admin sets the company's.

  1. As an admin, open Setup. Under Time zone the current zone shows with its abbreviation ("UTC").
  2. Choose Use Asia/Kolkata, your browser's when that is the zone you want, or Change, type or pick a zone from the list, such as Asia/Kolkata, and choose Use. The note reads "Times now read in Asia/Kolkata: repeats and app schedules run at its local times".

From then on an app's weekdays@07:00 trigger runs at 07:00 in Kolkata, every repeat without a zone of its own runs at its local time, the next time of each is computed again (a local time already run is never run twice), and agents are told today's date and time in that zone. Times show in the company's zone and, when yours differs, in yours beside it ("Mon 12 Oct, 09:00 IST (05:30 your time)"). The change is recorded as a company_time_zone_changed event. A name that is not a zone is refused: ""Mars/Base" is not a time zone. Pick one from the list, such as Asia/Kolkata." (the API answers 422 ""Mars/Base" is not a time zone (an IANA name such as Asia/Kolkata or Europe/London)").

Under it, Repeats holds the settings for asks that run on a schedule and the spending limits of asks to several agents; see Repeats.

A person's own time zone. Each person may set their own on their Profile, under Your time ("Empty uses the company's time zone"), and admins may set it in People. Team schedules run at each person's own time when they say so (Team schedules). The company's working days (Monday to Friday unless set otherwise), its holidays, and how many runs may go at once are set with PUT /api/company/scheduling.

Not possible yet#

  • An app's schedule in a person's own time zone: it runs in the company's. (A repeat may name a zone of its own, and a team schedule runs at each person's.)
  • Deleting a person or team. Offboarding deactivates for good.
  • Setting the currency from the command line.
  • More than one bundled blueprint.
  • Signing in with a company identity provider (single sign-on).

For developers#

API#

All under /api, with Authorization: Bearer <token> or a signed-in browser session (writes then carry the x-ok-csrf header).

Method and path Body Notes
GET /me { actor, admin, unread, currency }.
GET /company { currency, name, time_zone, copy_limits }: anyone signed in; an admin reads every setting.
PUT /company { currency?, name?, time_zone? } A human admin acting for no one. 403 denied otherwise; 422 invalid for a code ISO 4217 does not list, or a time zone that is not an IANA name the server knows.
GET /settings/asks, PUT /settings/asks Repeats and the limits of asks to several agents; see Repeats.
GET /actors Every directory entry.
POST /actors { actor } Adds a person or team. A person who exists is refused (409 person_exists); use PATCH /people/:id.
POST /teams { name, lead? } A human admin adds a team: 201 with it. 409 team_exists for an id taken, team_name_taken for another team's name; 422 invalid for an empty name or a lead who is not an active person.
PATCH /teams/:id { name } A human admin renames a team (1 to 80 characters); a note records the old and new names. 404 for no such team; 409 team_name_taken; 422 invalid.
POST /actors/:id/offboard Offboards (a person: as POST /people/:id/offboard).
GET /setup First-run setup: { state, steps: [{ id, state, by, at, summary }], next, can_edit, version } for a human admin, { state } for anyone else. state is in_progress, finished or legacy.
POST /setup/steps/:id { state: "done" | "skipped", version } A human admin. 422 step_not_ready (the company has no name; no model is ready), 409 version, setup_not_running.
POST /setup/finish { version } Pending steps become skipped.
POST /setup/reopen Runs setup again (also for a company from before setup).
POST /auth/link/complete { token, name, email, password } For a first-admin link: creates the first admin and signs them in; 410 link_cancelled once the company has a person.
GET /people ?status=&team=&q= The people panel's rows, invites included (status: "invited"). Admins and team leads.
POST /people/invites { email, name, role, team?, teams?, reports_to?, id?, send? } 201 { invite, link? } (the link once, when not emailed); 202 { approval }; 409 email_taken, already_invited; 422 invalid.
POST /people/invites/:id/resend { send } A new link; the old one dies.
DELETE /people/invites/:id Cancels it.
PATCH /people/:id { name?, role?, team?, teams?, reports_to?, email?, version } Only what is given. 409 version, last_admin, email_taken.
POST /people/:id/deactivate { reason } Admins; a lead for their team's members. 409 last_admin, self.
POST /people/:id/reactivate As above.
GET /people/:id/offboard-preview { delegations, runs, tasks, approvals, sessions, tokens, invites }.
POST /people/:id/offboard { reason } { cancelled_invites }.
POST /people/:id/sign-in-link { kind: "setup" | "reset", send } { link_id, kind, link?, mail_status, expires_at }. A session with a recent sign-in, or an admin's token for someone without a password.
DELETE /people/:id/two-step { reason } Session with a recent sign-in.
POST /people/:id/unlock Clears a lock.
GET /people/:id/sessions, DELETE /people/:id/sessions[/:sid] List or end.
GET /people/:id/tokens Token records, never a token.
POST /people/legacy-tokens/revoke { revoked }. Session with a recent sign-in.
GET, PUT /settings/sign-in { require_two_step?, session_days?, idle_hours?, max_token_days?, invite_days?, version } Changes: a session with a recent sign-in.
GET, PUT, DELETE /settings/mail; POST /settings/mail/test See Email.
POST /auth/link, POST /auth/link/complete { token, password?, email?, code? } The link pages: what the link is, then set the password and sign in.
POST /auth/forgot { email } Always 202.
GET /tokens, POST /tokens, DELETE /tokens/..., PATCH /tokens/id/:id As before; POST /tokens needs a signed-in session and issues for yourself only.

The Finance team blueprint used in Promoting a blueprint from Governance, proposed as Ada in the demo:

sh
curl -X POST http://127.0.0.1:8080/api/changes \
  -H "Authorization: Bearer <Ada's token>" -H "content-type: application/json" \
  -d '{"kind":"blueprint","rationale":"We also have a finance team. Grace leads it and Hugo reports to her.",
       "blueprint":{"id":"finance-team","name":"Finance team","description":"A finance team",
         "teams":[{"id":"team:finance","name":"Finance","lead":"grace"}],
         "people":[{"id":"grace","name":"Grace Hall","role":"finance_lead","team":"team:finance"},
                   {"id":"hugo","name":"Hugo Diaz","role":"accountant","team":"team:finance","reports_to":"grace"}]}}'

Use the address ok demo serve printed in place of 127.0.0.1:8080.

CLI#

sh
ok init --admin <id> [--email <address>] [--name <name>] [--blueprint <id or file>]
ok blueprint list
ok blueprint install <id or file>
ok actor list
ok actor add-team <team:id> [--lead <id>]
ok actor add-human <id> --role <role> [--team <team:id>] [--reports-to <id>]
ok user list [--status active|invited|deactivated]
ok user invite <email> --name <n> --role <r> [--team <t>] [--also-team <t>]... [--reports-to <id>] [--id <id>] [--print]
ok user edit <id> [--name] [--role] [--team] [--also-team]... [--reports-to] [--email]
ok user sign-in-link <id> [--print]
ok user reset-password <id> [--print]
ok user reset-two-step <id> --reason <text>
ok user unlock <id>
ok user deactivate <id> --reason <text>
ok user reactivate <id>
ok user offboard <id> [--reason <text>]
ok user sessions <id>
ok user sign-out <id>
ok mail show | set ... --password-env <VAR> | test [--to <address>] | clear
ok auth settings [--require-two-step off|admins|everyone] [--session-days n] [--idle-hours n] [--max-token-days n] [--invite-days n]
ok inbox
ok approve <approval id> [--reject] [--note <text>]
ok token issue --for <self or an agent> --label <text> [--ttl 30d] [--scope policy|changes|read]
ok token list
ok token revoke [<id>] [--id <token id>]
ok token scope <token id> --scope <scope>

Every command reads and writes the state file directly: stop the server first. ok user list, invite, edit, sign-in-link, deactivate, reactivate, offboard and sessions, and ok mail show and ok mail test, also take --server <url> (or OK_SERVER) with an admin's token in OK_TOKEN, and then follow the API's rules: what needs a signed-in session (a reset link, a two-step reset, settings changes) is refused with session_required. No command takes or prints a password; a link is printed alone on standard output, notes on standard error.