# Authentication Source: https://docs.ishlabs.io/api/authentication Mint a workspace API key, send it as a bearer token, and scope and rotate it. Every request to the ish API carries a bearer token in the `Authorization` header: ```bash theme={null} curl -sS "$API_URL/api/v1/sessions/$SESSION_ID" \ -H "Authorization: Bearer $TOKEN" ``` A request with no token, or an invalid one, returns a `401`. ## Mint a workspace key Create an API key in the product app under **Settings**, then **Developers**. Any member of the workspace can mint one. A key is a workspace-scoped machine principal: it acts on behalf of the workspace, and it only ever reaches the people and sessions that workspace owns. A key looks like `ish_sk_live_...`. **It is shown once, at creation.** Copy it then; the product app masks it afterward and cannot show it again. Store it in a secret manager or an environment variable, never in client-side code or source control. > [!WARNING] > > Treat a key like a password. If one leaks, revoke it (below) and mint a replacement. Anyone holding the key has the workspace access its scopes grant. ## Scopes A key carries any combination of seven scopes. Grant only what the integration needs. | Scope | Grants | | - | - | | `sessions:run` | Create sessions, submit turns, and close sessions (the mutating lane) | | `sessions:read` | Read a session, list sessions, and read a decision trace | | `environments:read` | Read the workspace's registered environments | | `environments:write` | Register, update, and delete environments | | `tasks:read` | Read the workspace's registered tasks | | `tasks:write` | Register, update, and delete tasks | | `people:read` | List and search the [people](/api/concepts/people) the workspace can run a session for | | `people:write` | Create, edit, archive and restore the workspace's own people, and run generation jobs | | `usage:read` | Read the workspace's session usage series, spend cap and rate-limit budgets | A new key is minted with `sessions:run`, `sessions:read`, and `tasks:read`. The task read is a default because a session can bind a registered task by id, so a key that runs sessions but cannot resolve the task it names would be a broken starting point. No `:write` scope is granted by default. Ask for `environments:write` or `tasks:write` when the integration manages a registry rather than just running against it. `people:read` is not granted by default either, and for a different reason: a person record carries demographics and a written background about someone the workspace modelled, so reading the pool is a decision the person minting the key should make deliberately. Ask for it when the integration picks its own participants rather than being handed a `person_id`. `usage:read` is not granted by default and nothing implies it. Usage answers how much the workspace has spent and how fast it may go, which is account information rather than simulation data, so it is a separate decision from running sessions. `people:write` does not imply `people:read`. They are granted independently, so a key that only feeds people in never gains the ability to read the pool back out. Ask for both when the integration manages a roster it also searches. A key without the scope an operation requires is refused with `403` and `detail.error_kind = "insufficient_scope"`, which names the `required_scope`. Reading a trace needs `sessions:read`; everything that drives a session needs `sessions:run`. ## Rotate a key There is no in-place rotation. To rotate, mint a new key, move your integration onto it, then revoke the old one from **Settings**, then **Developers**. Because a workspace can hold several live keys at once, you can overlap the two long enough to cut over with no downtime, then revoke the old key. Revoking a key takes effect immediately: the next request that presents it returns a `401`. ## User tokens for personal scripts An ish user access token also works on the same `Authorization: Bearer` header. It is fine for a quick personal script you run as yourself, but it is tied to your user session rather than the workspace, so it is not the right credential for a deployed integration. Use a workspace key for anything machine-to-machine. ## The values you need The API examples throughout these docs use a few placeholders. | Placeholder | What it is | Where it comes from | | - | - | - | | `API_URL` | Your ish API base | `https://api.ishlabs.io`, or the base URL from your onboarding | | `TOKEN` | Your workspace API key | Minted in **Settings**, then **Developers** | | `WORKSPACE_ID` | Your workspace id (a UUID) | The workspace the session runs under (the `workspace_id` path parameter) | | `PERSON_ID` | The person id (a UUID) | The [person](/concepts/people) you want to run (the `person_id` field) | The person must be [workspace-owned or a platform-library Person](/api/overview#which-people-you-can-run); anything else returns a `403`. ## Related > [card] [Quickstart](/api/quickstart) > > Put a key to work: create a session and run a turn. > [card] [Handling errors](/api/guides/session-loop#handling-errors) > > What `401`, `403`, and the rest mean, and how to recover. # Changelog Source: https://docs.ishlabs.io/api/changelog Every change to the ish API wire, newest first, with what each one asks you to change. Every change to the API's wire contract, newest first. Entries are append-only: an entry is never edited after the fact, so what you read here is what shipped on that date. `/api/v1` is in developer preview, so breaking revisions still land on the current version rather than opening a new one. See [versioning](/api/versioning) for the rules that apply, and read this page before each upgrade. ## 2026-10-08 (spec 1.11.0) Additive. A new error kind on an existing status code; no field changed. * **`POST /v1/sessions/{session_id}/turns` can answer `502` [`persona_refused`](/api/errors#persona_refused).** The model behind the person declined to answer the turn. That is a policy refusal, not the person's own "I can't". * **No turn is recorded, as with `decision_invalid`, but do not retry it as-is.** The same observation gets the same refusal. ## 2026-09-27 (spec 1.10.0) Additive. A new error kind on an existing status code; no field changed. * **`PATCH /v1/environments/{environment_id}` can answer `409` [`environment_holds_site_access`](/api/errors#environment_holds_site_access).** An environment that holds site access (a site's basic auth, session cookie, login, or public flag) refuses an edit to its `kind` or `config`, because repointing it would carry those credentials to whatever host it now names. * **Edit its hosts through site access instead.** A rename still succeeds. ## 2026-08-28 (spec 1.9.0) Additive. No existing operation changed. * **A public event log.** `GET /v1/workspaces/{workspace_id}/events` serves one entry per session ending, newest first, keyset-paged, and retained for 30 days. It sits under its own `events:read` scope, which nothing implies and the mint default does not include. * **Two types, `session.completed` and `session.failed`.** They split on who ended the run, not on whether the person succeeded. The precise status and `ended_reason` are in `data.object`. * **The envelope is the one webhook delivery will use**, so you can build against the poll now and switch to push later without changing your parser. * **An unknown value in `types` is refused** rather than matching nothing, so a typo cannot read as "no events". ## 2026-08-23 (spec 1.8.0) Additive. Response-only; no existing operation, status code, or field changed. * **The frozen person a session carries now reports their interests.** `interests` on `PersonSnapshot` (reachable as `person_snapshot` on a session read) carries the interest labels the person was generated with. Because a snapshot is frozen at open, it shows what they were into at the time, which is the version the run reflects. * **Nullable.** A person generated before interests were resolved carries none. ## 2026-08-14 (spec 1.7.0) Additive. A client that ignores the new array is unaffected. * **A turn's decision now reports what the person wrote down.** `noticed` on `TurnDecisionView` carries zero or more `{label, detail}` notes: things they picked up and expect to still know later (a price, a limit, a figure they worked out), which stay with them for the rest of the session. * **It holds one turn's writes, not the whole running set, and the label is the key.** A repeated label replaces the note stored under it, which is how someone corrects a thing they first misread. Most turns carry none. * **Read it to see what your environment left the person holding.** That is a different question from what they said in `comment`. ## 2026-08-05 (spec 1.6.1) Documentation only. No operation, schema shape, status code, or field changed. * **`DeclaredAction.name` now states the label-leak contract it was always held to.** A label names a visible affordance, never its hidden meaning, so `take_rusty_key` and chess notation like `nxe5_check` are violations. * **The API cannot validate this for you.** Whether a label leaks is only decidable against the frame, so a leaking label is accepted and the session's findings are silently wrong. See [environment authoring](/api/guides/environment-authoring). ## 2026-08-05 (spec 1.6.0) Additive. No existing operation changed. * **Delete a session's retained observation frames on request.** `DELETE /v1/sessions/{session_id}/observations` (`purgeSessionObservations`), under the existing `sessions:run` scope, erases the frames now instead of waiting for the retention window. * **Only the frames go.** The session, its turns, and its full decision trace survive. * **Idempotent, and it reports counts rather than a boolean.** `observations_deleted` counts frames removed; `delete_failures` counts frames whose stored object could not be removed yet. A non-zero `delete_failures` is an accepted request whose bytes are not all gone: their references are kept so a retry or the next expiry sweep collects them. ## 2026-08-02 (spec 1.5.0) Additive. No existing operation changed. * **Usage is readable from a key**, under a new `usage:read` scope that nothing implies and the mint default does not include. Three operations: the session usage series over time, the spend cap with credits drawn against it, and the rate-limit budgets as an on-demand read (answered from the counter without charging it). * **The series can be split per environment or per session status, and deliberately not per API key.** A key cannot enumerate its siblings; that split stays with a signed-in member in the app. * **Window percentiles are computed over the window, not averaged from the buckets**, because percentiles do not compose. A per-bucket `latency_p95_ms` is `null` below 20 turns rather than reported, since under that it sits within a hair of the slowest single turn. `turns` sits beside it so "not enough data" and "no data" stay distinguishable. * **A window too wide to represent is refused, not silently shortened.** Previously a long enough daily range returned a truncated series while still echoing the full date range back, so the totals beside it belonged to a shorter window. It now returns `422` naming the limit. * **Filler buckets carry zeros and `null` latency, never `0` ms.** The last bucket in a series is usually partial, so divide by elapsed time rather than by a whole day. ## 2026-08-02 (spec 1.4.0) Additive. No existing operation, status code or body changed. * **Every response now tells you what budget it just spent.** Requests made with an API key carry `x-ratelimit-limit`, `x-ratelimit-remaining` and `x-ratelimit-reset`, so you can pace off `remaining` instead of discovering the ceiling by tripping it. The `429` carries them too, beside `Retry-After`. * **`x-ratelimit-reset` is seconds from now, not a Unix timestamp.** It is measured when the response is written, so it decays across successive calls. Read it as a delay, never as a clock reading. * **The headers are optional and their absence is meaningful.** A request authenticated with a user access token carries none, because those are deliberately unlimited. A response refused before the limiter runs, such as a `401`, carries none either. Treat a missing header as "no budget was charged", not as zero remaining. * **One request can spend two budgets** (a session create spends both the per-request limit and the daily session quota). There is one set of header names, so the triple always describes whichever budget is closest to refusing you. * **A deployment that cannot count honestly says nothing.** If the rate-limit counters are not shared across servers, the headers are omitted rather than published with a number that describes one server instead of your actual budget. Enforcement is unaffected either way. ## 2026-08-01 (spec 1.3.0) Additive. Nothing existing changes shape, and no operation refuses anything it previously accepted. * **You can now manage your own people, not just read them.** Create, update, archive and restore, under a new `people:write` scope: `POST`, `PATCH` and `DELETE` on `/v1/workspaces/{workspace_id}/people`, plus `POST .../people/{person_id}/restore`. `people:write` does **not** imply `people:read`: the two are granted independently, so a key that only feeds people in never gains the ability to read the pool back out. * **Delete archives; it does not erase.** `DELETE` sets `archived_at` and the row stops appearing in listings unless you pass `?archived=true`. Restore brings it back. Sessions that already ran keep the person snapshot they froze at open, byte for byte, across both. Permanent erasure stays inside the ish app. * **The write contract is narrower than the read shape.** `product_id`, `type`, `visibility`, `custom_fields` and the simulation config are not writable through this API: a key cannot move a person between workspaces or change what kind of thing it is. Send a field explicitly as `null` to clear it; omit it to leave it alone. * **`external_id` for your own identifiers.** Workspace-unique, and looked up with `?external_id=` rather than in the path, so your id space never has to collide with ours. Create accepts `Idempotency-Key`. * **Generation is an API operation, and it is metered.** `POST .../people/generation-jobs` with `GET` polling and `POST .../cancel`. The job reports a live `counts` object as people land. Billing draws **2 credits per person that actually succeeds**, plus **1 more when avatars are generated**. The number you watched climb is the number you are charged for. Cancelling keeps whatever was already produced and you pay only for that. `Prefer: wait=n` (1-60s) holds the create open for a short job rather than making you poll. * **An unknown interest id is now a `422` instead of an empty page.** A `qualification`/`tag` filter naming an id outside the taxonomy used to expand to itself and match nothing, so a typo returned a clean, well-formed, empty result indistinguishable from a real audience of zero. It now names the offending id. ## 2026-07-28 (spec 1.2.0) Mostly additive. One existing operation changes what it refuses, and only for a `person_id` no integration should have been sending. **Fixed** * **A session can no longer be opened for a real person.** `POST /v1/workspaces/{workspace_id}/sessions` now answers `404` `person_not_found` when `person_id` names a real person who participates in ish under consent, rather than opening the session. This lane has always been documented as simulated people only, but the check tested ownership and library membership without testing which kind of person the record was, so some real-person records satisfied it. The answer is `404`, identical to an id that does not exist, rather than the `403` `person_out_of_scope` used for another workspace's person: that `403` confirms a person exists and says they are not yours, which is the wrong thing to say about a human being. If this changes an answer you were getting, the `person_id` was reaching a record it should never have reached. Every simulated person is unaffected, and [`GET .../people`](/api/reference/people/list-people) lists exactly what a session create accepts. **Additive** * **You can read the people you run sessions for.** Five new operations under a new `people:read` scope: `listPeople`, `searchPeople`, `getPerson`, `getPeopleCounts`, and `getPeopleSchema`, all under `/v1/workspaces/{workspace_id}/people`. Until now a `person_id` had to come out of the ish app and be pasted into your code; an integration can now find its own participants. See [people](/api/concepts/people). * **`people:read` is not in the mint default.** A person record carries demographics and a written background, so the scope is granted deliberately rather than by default. Existing keys gain nothing: scopes are fixed at mint, so mint a new key, or rotate, to pick it up. * **Ownership is an `owner` alias, not a visibility enum.** Every person carries `owner`: `self` for one your workspace owns, `platform` for one from the shared ish library. Both are runnable, and the two together are exactly what a session create accepts, which is why the unfiltered list returns the union. That equality holds in both directions as of the fix above: the two surfaces now apply the same rules, so a person the list omits is a person a session create refuses. `workspace_id` is present only on `self` rows. People that other workspaces have published are deliberately absent: they are discoverable in the app but not runnable through the API, and listing ids you cannot use would be worse than omitting them. * **Search takes the same rule tree the ish app builds.** `POST .../people/search` accepts a boolean tree of attribute filters, capped at 2 levels of nesting, 15 conditions per group, and 25 in total. Saved segments are not exposed as objects, because a segment is a rule: send its rule. See [search grammar](/api/guides/people-search) for the semantics and a worked example. * **`GET .../people/schema` publishes the attribute vocabulary.** Every attribute with its type, its allowed values, whether it is filterable and under which key, and a `writability` block. It is authoritative: a rule naming an attribute the schema does not publish is refused rather than quietly matching nothing. Cache it, since it is the same for every workspace. * **Two new error kinds, both `422`:** [`search_rule_invalid`](/api/errors#search_rule_invalid) and [`search_rule_too_complex`](/api/errors#search_rule_too_complex). They are the first handler-raised `422`s to carry an `error_kind`, so a `422` is no longer safe to treat as "malformed body" without reading the envelope. **What a person does not carry** Worth stating plainly if you are comparing against what the ish app shows. A person on this API carries identity, demographics, interests, and an accessibility profile. It carries no moderation history, no publishing attribution, no workspace-defined custom fields, and no files. `type` is always `ai`: real people who participate in ish under consent are not reachable with any key you can mint. ## 2026-07-28 (spec 1.1.0) A breaking pre-release revision that renames the intent noun. Everything below this entry shipped under spec `1.0.0`; from here on each entry names the `info.version` of the OpenAPI spec it shipped in, so you can correlate a spec diff with the entry that explains it. **Breaking** * **The intent primitive is a `task`, not an `assignment`.** `assignment` now names only the act of assigning a task to someone, which is not something the API exposes, so the word has left the public surface entirely. | Was | Now | | - | - | | `POST/GET /v1/workspaces/{workspace_id}/assignments` | `.../tasks` | | `GET/PATCH/DELETE /v1/assignments/{assignment_id}` | `/v1/tasks/{task_id}` | | `assignment: {goal}` or `assignment: {id}` on session create | `task: {instructions}` or `task: {id}` | | `assignment` object on a session read | `task`, with `instructions` in place of `goal` | | `goal` on the registry (create, update, read) | `instructions` | | `assignment_id` filter on `listSessions` | `task_id` | | `assignment_name_taken`, `assignment_archived`, `assignment_not_found`, `assignment_in_published_listing` | `task_name_taken`, `task_archived`, `task_not_found`, `task_in_published_listing` | * **`source_assignment_id` is gone from the task response.** It was a lineage pointer nothing ever wrote, so it served `null` on every row for every caller. Removed rather than kept as a permanent null, because a field you can never receive a value in is one you should not write a branch for. **Additive** * **API keys now reach the task registry.** All five task operations previously refused keys outright with a `403` `api_key_not_permitted` and could only be called with a user access token. They now take the same scope pair every other registry uses: `tasks:read` for list and read, `tasks:write` for register, update, and delete. An under-scoped key gets `403` `insufficient_scope` with `detail.required_scope`. * **`tasks:read` joins the mint default.** A newly minted key carries `sessions:run`, `sessions:read`, and `tasks:read`, so a key that runs sessions can also resolve a task it binds by id. **Keys minted before this date are not changed.** Scopes are fixed at mint, so an existing key gains nothing: mint a new key, or rotate, to pick up the default. No `:write` scope is granted by default. * **Session list rows carry `participant.type`.** It distinguishes a simulated participant from a real one. Present on `listSessions` rows; absent on older rows, which carry no type. **Changed wording, same behavior** * The `409` refused when you retire a task an active recruitment listing still references now says so in those terms. `detail.error_kind` stays `task_in_published_listing` and `detail.listing_id` still names the listing. * Task name uniqueness is described as per workspace, which is what it means for an API caller. The rule itself did not change. * `background` and `steps` on a task are documented as accepted and stored but not yet consumed by API sessions. They always behaved this way; only the description was unclear. * No documented operation returns `api_key_not_permitted` any more. The kind stays in the catalog because it still applies elsewhere in the product. **What to change in your client** 1. Repoint the four registry paths from `/assignments` to `/tasks`. 2. Rename the session-create `assignment` block to `task`, and `goal` to `instructions` inside it. A leftover `assignment` or a top-level `goal` is a `422` naming the stray key, never a silent partial accept. 3. Read `task` (with `task.instructions`) where you read `assignment` (with `assignment.goal`) on session responses. 4. Switch any `assignment_id` filter on `listSessions` to `task_id`, and branch on the four renamed `task_*` error kinds. 5. Drop `source_assignment_id` from your task model. ## 2026-07-28 A breaking pre-release revision. It renames the public actor noun, renames one environment field, moves the close endpoint, and widens what create and close return. If you integrated before this date, three edits are required. **Breaking** | Change | Was | Now | | - | - | - | | The actor field on create | `persona_id` | `person_id` | | The actor field on a session read | `persona_id` | `person_id`, and `participant.person_id` on a list row | | The environment descriptor's platform field | `{ "name": ..., "platform": ... }` | `{ "name": ..., "kind": ... }` | | Closing a session | `DELETE /v1/sessions/{session_id}` | `POST /v1/sessions/{session_id}/close` | The old `DELETE /v1/sessions/{session_id}` is gone rather than deprecated, and a request to it is a `405`. The new close takes no request body and requires the same `sessions:run` scope. **Additive** * **Create and close return the full session.** Both used to return a five-field stub (`id`, `status`, `decision_mode`, `turn_count`, `max_turns`). They now return the same 23-field object a read returns, including the frozen `assignment`, the frozen `environment` and its four `environment_*` pointers, `person_snapshot`, `accrued_credits`, `ended_reason`, `ended_at`, and the timestamps. Nothing was removed, so a client reading only the original five fields keeps working. * **`listSessions` gained two filters**: `environment_version_id` pins the list to sessions run against one declared environment version, and `search` matches a session id by prefix or the frozen goal case-insensitively. The existing `status`, `api_key_id`, `environment_id`, `assignment_id`, `created_from`, and `created_to` filters are unchanged. * **`Idempotency-Key` now covers every create.** It was accepted on create-session only; it is now accepted on create-environment, create-environment-version, and create-assignment on the same terms. A retry with the same key and body replays the existing row; the same key with a different body is a `409` `idempotency_conflict`. * **Observation retention is now a session and environment setting.** `observation_retention` (`none`, `30d`, `90d`, or `indefinite`) can be set on an environment as its default and overridden per session on create. It is served back on the session. An environment described inline with no override resolves to `none`. * **Turns can carry the frame back.** A turn in the trace now carries `observation_url`, a short-lived signed URL for the retained frame, plus `observation_width` and `observation_height`. `observation_url` is null when nothing was retained, which is what a `none` session always reports. Read the URL, do not store it. * **List rows carry `ended_at`.** `ended_at` moved onto the shared session base, so a `listSessions` row now serves it alongside `settled_at` without a second read. * **Every error kind is now documented and stable.** Responses across all four surfaces carry a machine-readable `detail.error_kind`, and the full catalog of 33 public kinds is published at [errors](/api/errors). Branch on the kind rather than the status: several kinds share a status and want different remedies. * **The registry list envelopes reserve pagination.** The environment, environment-version, and assignment lists now carry `has_more` and `next_cursor` alongside `items`. Both are inert today (`false` and `null`) because those lists return the whole collection, and they are present so pagination can land later without a wire break. Read them rather than assuming a single page. **What to change in your client** 1. Rename `persona_id` to `person_id` in your create body, and read `person_id` (or `participant.person_id` on list rows) where you read `persona_id`. 2. Rename `platform` to `kind` in any inline `environment` descriptor. 3. Change your close call from `DELETE /v1/sessions/{id}` to `POST /v1/sessions/{id}/close`. ## 2026-07-27 A breaking pre-release revision to how a session carries its intent. **Breaking** * Session create bodies carry the intent as a required `assignment` object with exactly one shape: `{"goal": ...}` describes it inline, or `{"id": ...}` binds a registered assignment and freezes its goal and revision onto the session. * A top-level `goal` field is rejected with a `422`. * Session reads return an `assignment` object in place of the flat `goal`. * `Idempotency-Key` values stored before this revision no longer replay. A retried old-shape body is a `422`, and reusing an old key with a new-shape body is a `409` `idempotency_conflict`. Mint fresh keys after migrating. # The decide-only loop Source: https://docs.ishlabs.io/api/concepts/decide-only-loop ish decides, you execute. Why the declared action set is the addressing scheme, and what that buys you. The ish API sells the decision, never the execution. Each turn, ish reads your frame and returns exactly one chosen action plus how the participant felt. Carrying that action out is your job, in your own environment. There is no locator, no coordinate resolution, no element matching, and no execution driver anywhere on our side. ## One turn A turn is a clean split of labor: 1. You send a [human-sensory observation](/api/concepts/observations) plus the set of actions declared available this turn. 2. ish returns one chosen action from that set, plus the participant's comment, sentiment, felt intensity, and status. 3. You execute the chosen action in your environment and report the result as the next turn's observation, or as an `error` block if it did not take effect. You rendered the frame, so you know how to capture it. You built the environment, so you know how to press its own buttons. The one thing left, deciding what a particular human would do, is what ish does. ## The declared action set is the addressing scheme ish addresses your world only through the labels you declare. There is no other handle. This is the inverse of a fixed-vocabulary approach, and it is the point. Computer-use APIs fix the vocabulary: the model chooses from a provider-defined action space (click at these coordinates, type, scroll). That works when the environment is a generic screen. ish inverts it: **you declare the action space, per turn, in your environment's own terms**, and ish never owns or resolves those actions. A remote's buttons, a game's moves, a form's fields: you name what is available this turn, and the participant picks from exactly that. The declaration can change every turn, because what is available changes as the participant moves. A menu opens and new actions appear; a modal closes and they disappear. You send the set that is true right now. ## Why decide-only The research app already ships a harness that both decides and executes, locating a target in a page and driving a click against it. That harness hit two structural walls: * **Canvas content has nothing to locate.** When an environment paints to a ``, a game, a WebGL scene, a custom-rendered app, there is no addressable element under the pixels for an execute step to grab. * **Headless rendering degrades perception** in exactly those environments, so even capturing the frame gets unreliable. The decide-only loop routes around both. Your environment renders its own frame and executes its own declared action, both of which it already does well. ish only has to decide, which it does from pixels. A participant proved this on a dense 3D scene: valid decisions over a declared action set, with grounded, in-the-moment commentary. ## What it buys you * **The hard walls become your cheap problem.** Rendering a frame and pressing your own button are things your environment already knows how to do. * **A clean, auditable trace.** Server-side session and turn rows give a replayable decision log (the observation reference, the declared set, the chosen action, latency, retries) without you re-sending state, and without ish holding execution liability for what you did with the decision. * **Your vocabulary stays yours.** Because ish never defines or resolves actions, the action space stays described in your terms, turn after turn. ## Related > [card] [Observations](/api/concepts/observations) > > What the participant is allowed to perceive, and why. > [card] [Sessions and turns](/api/concepts/sessions-and-turns) > > The server-side state this loop records. # Intent and resolution Source: https://docs.ishlabs.io/api/concepts/intent-and-resolution The default intent mode, how a resolver maps intent to your actions, and how no_match becomes a finding. Every session runs in one of two decision modes. **Intent** is the default and the path a real integration uses. **Direct** is an evaluation baseline. The create response echoes which mode you are in, and because you can omit the mode on create, that echo is how you discover it. Plan for intent. ## Intent mode In intent mode the participant forms a free-form **intent** from perception alone. They say what a human would try, in their own words ("turn the tv on", "find the checkout button"), carrying no knowledge of your action vocabulary. A separate **resolver** then maps that intent onto the actions you declared this turn. Splitting the two keeps the participant honest. They reason the way a person does, off what they see, and never off the list of buttons you happen to expose. The resolver, not the participant, does the mapping onto your controls. Resolution comes back three ways: * `matched`: the intent maps to a declared action. `action_name` and `arguments` are set; execute it. * `no_match`: the participant wanted something your environment does not offer. `action_name` is null, and `unmet_expectation` names the gap. This is usually the signal you are after. * `none_needed`: the participant concluded and named no control. `action_name` is null and `unmet_expectation` stays null. This is not a failed mapping; the participant is finishing or stepping away, and the session ends through its own status. > [!NOTE] > > `no_match` and `none_needed` both come back with a null `action_name`, but they mean different things. `no_match` is a participant who wanted something absent (a finding). `none_needed` is a participant who is done. Do not treat them alike. ## The finding channel Three fields on the decision carry the research signal in intent mode: * `intent`: what the participant wanted, in their words. * `resolution`: whether that intent mapped, and how. * `unmet_expectation`: on a `no_match`, what the environment did not afford. A stream of `no_match` results with their `unmet_expectation` text is the clearest read you get on where your environment falls short of what a person expects. A participant reaching for something you never built is the point of running one. ## The experiential payload is always the participant's Regardless of mode or resolution, four fields always come straight from the participant: `comment`, `sentiment`, `felt_intensity`, and `status`. They are present on a `matched` turn, a `no_match` turn, and a `none_needed` turn alike. They are the participant's in-the-moment experience, not a verdict on whether the task succeeded. Read [score outcomes](/api/guides/scoring-outcomes) before you trust them as a measure of success. ## Direct mode In direct mode the participant picks one of your declared actions themselves, so they see the action list. The intent fields (`intent`, `resolution`, `unmet_expectation`) are all null. Because the participant reads your action vocabulary directly, direct mode is an evaluation baseline, not the product path; the intent split is what makes the behavior a real prediction. ## Token accounting differs by mode The two modes count tokens differently, because intent mode runs two model calls (the participant's intent and the resolver's mapping): * **Intent:** the per-turn `input_tokens` is the combined total across both calls, and `output_tokens` is null by design. * **Direct:** you get the real per-call input and output split. ## Related > [card] [The decide-only loop](/api/concepts/decide-only-loop) > > You declare the actions; the resolver maps intent onto them. > [card] [Score outcomes](/api/guides/scoring-outcomes) > > Why the participant's words are perception, not a verdict. # Observations Source: https://docs.ishlabs.io/api/concepts/observations Why the participant perceives only human-sensory renders, and why action labels must not leak hidden state. Each turn you send an **observation**: what the participant perceives right now. The API restricts observations to human-sensory renders, the things a person sitting in front of your environment would take in through their eyes and ears. This restriction is the load-bearing choice that keeps the product honest. ## Human-sensory only An observation is a list of blocks, and only two kinds exist today: * `image`: a rendered frame, a screenshot of what the participant sees. Available now. * `error`: free text carrying execution feedback, "your last action did not take effect". That is itself something a person would perceive: a bump, a blocked door, an error toast. Audio is reserved for a later version as a rendered sense, not a transcript. Every future observation kind must clear the same bar: would a human perceive this. ## Why not structured state Feeding the participant structured state (a scene graph, game-state JSON, a chess FEN, a DOM or accessibility-tree dump) is the easier engineering path, and it is precisely the path ish does not take. ish answers one question: **how would this particular human behave here.** That answer is only valid if the participant perceives what a human perceives, with the same ambiguity, occlusion, and room to misread. A participant handed the true state is no longer simulating a human; they become a solver wearing a person's name, and their behavior stops predicting a real person's. So structured state is **rejected, not discouraged.** A block of `type: "state"`, a scene graph, a FEN string, or a DOM dump is a `422` at the boundary, refused loudly on the first turn so you learn the contract immediately instead of silently degrading the result. There is no `state` block to opt into. ## The label-leak rule There is a second way state can sneak in: through the **action labels** you declare. A label names what is *pressable*, never what it *means*. Consider two classic leaks: * The chess move `Nxe5+` as an action name smuggles in the piece (a knight), the captured square, and that the move gives check. A player reads none of that off a label; they read it off the board. * An adventure-game hotspot named `rusty key` tells the participant the object's identity and narrative role before they have even looked. Declare actions by visible affordance instead: a bare target and a generic verb (`move`, `click`, a from-and-to square pair). The participant reads the *meaning* off the pixels. Option names that are printed on the screen are fine in an enum, because they are already visible; what a control *does* must stay discoverable from the frame. The practical rules are in [author your environment](/api/guides/environment-authoring). ## What this asks of your environment Two consequences follow, and both move work to your side in exchange for a signal a state solver cannot produce: * **Your environment must render its experience.** Something that cannot produce a human-sensory frame, a pure backend state machine or a headless simulation with no view, is out of scope by definition. It is not a gap to paper over with a state feed. * **You own the render and the labels.** You capture the frame each turn and you declare actions by visible affordance. In return you get a human-behavior signal grounded in perception. ## Related > [card] [The decide-only loop](/api/concepts/decide-only-loop) > > ish decides from your frame; you execute in your environment. > [card] [Author your environment](/api/guides/environment-authoring) > > Write labels that do not leak, and frames that decode. # People Source: https://docs.ishlabs.io/api/concepts/people The pool of simulated people you can open a session for, and how ownership decides what you reach. Every session runs as one **person**. A person is a simulated individual with a background, demographics, and interests: enough for the model to answer as them rather than as a generic user. Before you can open a session you need a `person_id`, and this is the surface that gives you one. ## Two kinds of person The people you reach fall into exactly two sets, and every person object says which it belongs to through its `owner` field. | `owner` | Where it comes from | Can you run a session for it? | Can you edit it? | | - | - | - | - | | `self` | Your workspace built it, in the app or by generating people | Yes | In the app | | `platform` | The shared ish library, curated by ish | Yes | No | A `self` person also carries `workspace_id`. A `platform` person carries `null` there, because it belongs to no workspace rather than to yours. Together the two sets are the pool. Ask for `GET /v1/workspaces/{workspace_id}/people` with no `owner` filter and you get both, which is deliberate: **that union is exactly the set a session create accepts.** Anything this endpoint lists, you can open a session for, and anything it leaves out is refused there too. Both surfaces apply the same three rules: the person is yours or from the library, and is simulated rather than real. If you want one half of the pool, pass `owner=self` or `owner=platform`. > [!NOTE] > > The app also lets workspaces publish a person for other workspaces to discover. Those are **not** on this API. You could list them but not run them, and an endpoint that hands you ids you cannot use is worse than one that does not. ## What a person carries The identity the model is given, and nothing about how ish came to hold the record: * **`name`** and **`bio`**. The bio is free text and does most of the work; it is the bulk of what the model is told. * **Demographics**: `date_of_birth`, `gender`, `country`, `city`, `occupation` and its canonical `occupation_code`, `education_level`, `household`, `locale_type`, `income_level`, `employment_status`. The enumerated ones are open unions, so tolerate a value you do not recognize. * **`interests`**: IAB taxonomy node ids. * **`accessibility_profile`**: declared accessibility needs, as a nested object. Only non-default keys are present. * **`avatar_url`**, when one exists. Fetch [`GET /v1/workspaces/{workspace_id}/people/schema`](/api/reference/people/get-people-schema) for the machine-readable version: every attribute with its type, its allowed values, and whether you can filter on it. It is the same for every workspace and changes only when ish adds an attribute, so fetch it once and cache it. ### What a person does not carry Real people also participate in ish, under consent, and they are governed by an access rule no API key takes part in. **`type` is always `ai` on this API**, and no credential you can mint reaches a real person's record, their files, or anything they agreed to. For simulated people, the record holds moderation history, publishing attribution, and workspace-defined custom fields. None of it is on this API. If you are diffing against what the ish app shows you, that is the gap, and it is intentional. ## Finding the right person Four endpoints, in the order you usually want them: 1. [`GET .../people/counts`](/api/reference/people/get-people-counts) tells you how big the pool is, split by owner. Worth one call before you build a filter: it is the difference between "my rule is too narrow" and "this workspace has four people". 2. [`GET .../people`](/api/reference/people/list-people) lists the pool, newest first, keyset-paginated. It takes a `search` for a name substring, and nothing else. 3. [`POST .../people/search`](/api/reference/people/search-people) takes a rule tree over the attributes. See [search grammar](/api/guides/people-search) for the grammar and a worked example. 4. [`GET .../people/{person_id}`](/api/reference/people/get-person) re-reads one person you already have an id for. All of them need the `people:read` scope, which is **not** in the mint default. Ask for it explicitly when you mint or rotate a key. > [!NOTE] > > Every one of these names a workspace in the path, including the single-person read, where sessions, environments, and tasks are read at a flat `/v1/{noun}/{id}`. That is because the pool spans two owners: a library person belongs to no workspace of their own, so naming the workspace you are asking as is what lets the same library person be readable through any workspace you belong to. ## Pagination The list and the search share the session list's envelope: `items`, `has_more`, and an opaque `next_cursor`. Page forward by passing the previous `next_cursor` as `after` (a query parameter on the list, `pagination.after` in the search body) and stop when `has_more` is false. Never build your own cursor or reuse one across different filters. Rows are ordered newest first. Because paging is keyset rather than offset, people being added while you page will not make a row appear twice or vanish. ## Related * [Search grammar](/api/guides/people-search) * [Sessions and turns](/api/concepts/sessions-and-turns) * [Authentication](/api/authentication) # Sessions and turns Source: https://docs.ishlabs.io/api/concepts/sessions-and-turns The server-side session model, the decision trace, pacing, and how a session ends. A session is the unit of work in the ish API: one participant, one task, inside one environment, over a series of turns. State lives on the server as a session row plus one row per turn. You send only the per-turn delta and never re-transmit history. The session *is* the decision trace. ## The shape of a session A session moves through three phases: 1. **Create.** You name the person, the task, the environment, and a pacing contract. The server opens the session and returns the whole session object, including everything it froze at open. 2. **Turns.** Each turn you send what the participant perceives plus the actions available, and read back the participant's decision. The server records every turn. 3. **Close.** The participant ends it, you close it, or the server truncates it at a turn budget. `POST /v1/sessions/{id}/close` returns the final session. Because state is server-side, a turn carries only what changed: the new frame and the actions available now. You do not resend past turns. To replay the whole trace, read it back (below). ## Turn indexing Every turn carries a `turn_index`, and it must equal the session's current turn count. The first turn is `0`; each recorded turn increments it by one. The subtlety is what counts as recorded. **Every returned turn is recorded, including turns where nothing was executed.** A turn where the participant wanted something your environment does not offer, or concluded without acting, still increments the index. Do not infer the next index from "did I execute an action?" Drive it off the response's `turn_index`, plus one. Two cases move the index differently, and both are covered in [run the session loop](/api/guides/session-loop): * A rejected decision the model could not make validly records nothing, so you retry the **same** index. * A turn-index mismatch hands you back the index the server expected; resubmit with that. ## The decision trace Reading a session back returns its state plus a page of the recorded turns. Each turn in the trace carries the decision, which observation kinds it saw and the frame's dimensions, its latency, how many validation retries it took, the token counts, the frame age, and when it was created. Whether a turn also carries the frame itself depends on the session's `observation_retention`, resolved once at open and one of `none`, `30d`, `90d`, or `indefinite`. When a frame was retained, `observation_url` is a short-lived signed URL: read it, do not store it. It is null when nothing was retained, so a session opened with `none` answers "not retained" rather than leaving you guessing whether a frame expired. A registered environment supplies the default; a session can override it on create; an inline environment with no override lands on `none`. The trace is a **cursor page**. Pass `after_index` to get turns strictly after a given index and `limit` to size the page (the default is 50, the maximum 200). The response's `has_more` is true when more turns remain; page again with `after_index` set to the last index you received. ## Pacing Every session declares a **pacing contract**, and it is recorded on the session and carried on the trace, because the same decision means different things at different pacings: * `pause_on_decide`: your environment blocks until ish decides. Turn-based worlds. * `frame_on_demand`: your turn pulls a fresh frame. Most integrations. * `free_running`: the world advances regardless of ish's turn. Pacing is also what makes frame provenance readable. Each turn can report `frame_age_ms`, the time between capturing the frame and posting it. It is near zero for `pause_on_decide` and `frame_on_demand`, and meaningful only for `free_running`, where the world moved while the frame was in flight. ## Who ran it, frozen at open A session records the person it ran as `person_id`, and freezes that person's record onto the session as `person_snapshot` at create. The snapshot is why a trace you read months later still renders the participant who actually ran, even if the live person has since been edited or deleted. List rows carry the same identity in miniature as `participant`, an object of `person_id` and `name`. The session freezes its environment the same way: `environment` holds the `name` and `kind` it was opened with, and `environment_id`, `environment_revision`, `environment_version_id`, and `environment_version_label` record which registered environment, revision, and declared version it was pinned to. All four are null for a session that described its environment inline. ## How a session ends Ending a session is a first-class event, not a side effect, and three parties can cause it. The session status records which: | Status | Who ended it | | - | - | | `open` | Still running | | `completed` | The participant finished (`done`) | | `gave_up` | The participant quit (`gave_up`) | | `closed` | You closed it | | `max_turns` | The server truncated it at the turn budget | | `spend_cap_reached` | The workspace spend cap was reached mid-session; the turn that would exceed it is refused with a `402` | | `balance_exhausted` | The credits ran out mid-session, either the balance or the plan's allowance; `ended_reason` says which | A natural ending takes precedence over budget truncation, so a participant who finishes on the last allowed turn reports `completed`, never `max_turns`. Session status is an open union: tolerate a status you do not recognize rather than failing on it. `spend_cap_reached` is a case in point: it was added after the first statuses shipped, so a client that hard-coded the original set would have to tolerate it. See [billing and limits](/api/guides/session-loop#billing-and-limits). Two more fields on the session say when and why it ended. `ended_at` is stamped on the first terminal transition and never moves; it is null while the session is open. `ended_reason` is null for an ordinary ending and names the billing cause when there was one, which is how the two `balance_exhausted` cases stay distinguishable on a session you read back later. ## Related > [card] [The decide-only loop](/api/concepts/decide-only-loop) > > Why the session records decisions and never executes them. > [card] [Run the session loop](/api/guides/session-loop) > > The turn-by-turn contract this model drives. # Errors Source: https://docs.ishlabs.io/api/errors Every error kind the API returns, what each one means, and what to do about it. Every error carries a machine-readable `error_kind`. Branch on the kind, never on the status: several kinds share a status and want different remedies, and new kinds can be added within a status you already handle. ## The two envelopes Parse defensively. Two shapes exist and they differ. A **request-shape failure** (HTTP 422 from the validation layer) uses the `ValidationError` envelope, with an `errors` array of field locations so you can pinpoint the offending field: ```json theme={null} { "error": "Validation error", "error_code": "validation_error", "status": 422, "retryable": false, "detail": "Validation error", "errors": [ { "loc": ["body", "observation", 0, "type"], "msg": "...", "type": "..." } ] } ``` **Everything else** uses the `Error` envelope, where `detail` is either a string or a structured object carrying `error_kind`: ```json theme={null} { "detail": { "error_kind": "turn_index_mismatch", "expected_turn_index": 4 }, "request_id": "b1c2d3e4...", "docs_url": "https://docs.ishlabs.io/api/errors#turn_index_mismatch" } ``` Some kinds carry extra keys on `detail` alongside `error_kind`. Those are named per kind below. Whenever `detail` carries a registered `error_kind`, the body also carries `docs_url`: a direct link to that kind's entry on this page. ## Correlation Every response carries an `X-Request-Id` header, and error bodies echo it as `request_id`. Quote it in any support request or bug report. ## Open union `error_kind` is an open union. New kinds may be added inside a status you already handle, so treat an unrecognized kind as the generic case for its status rather than failing on it. ## 401 Unauthorized ### invalid\_api\_key The bearer token is missing, malformed, unknown, or revoked. One kind covers all four deliberately: distinguishing them would confirm which guesses are real keys. Check the `Authorization` header. If the key was revoked, mint a replacement in **Settings**, then **Developers**. ## 402 Payment Required All three refuse the turn without applying it, and the session becomes terminal. Branch on the kind, because the first two share a terminal status of `balance_exhausted`. ### credits\_exhausted No spendable credits are left. Top up. ### plan\_allowance\_exhausted The plan's allowance for this period is spent. It refreshes on the date in the message, or top up to continue now. ### spend\_cap\_reached The workspace's own per-period spend cap was reached. Raise the cap, or wait for the period to roll over. The session's terminal status is `spend_cap_reached`. ## 403 Forbidden ### insufficient\_scope The API key lacks the scope this operation requires. `detail.required_scope` names it. Mint a key with the scope, or ask for it if the key manages a registry rather than just running against it. The `:write` scopes on environments and tasks are never granted by default. ### api\_key\_not\_permitted This operation does not admit API keys at all, and no scope grants it. Call it with an ish user access token. ### person\_out\_of\_scope A session can only be opened for a person the workspace owns or one published in the platform library. HUMAN People, the records a real person owns, are out of scope by policy. Use an in-scope `person_id`. ## 404 Not Found Each of these means the same thing: the record was not found, or it is not reachable with this credential. The two are deliberately indistinguishable, so a wrong id and someone else's id look identical. Check the id, and check that your token's workspace owns it. ### workspace\_not\_found The `workspace_id` in the path. ### session\_not\_found The `session_id` in the path. ### person\_not\_found The `person_id` on a session create, or in the path on a person read. A person your workspace neither owns nor can reach in the platform library answers this rather than a `403`, so a guessed id cannot be used to test which ids are real. ### environment\_not\_found The `environment_id`, on a session create or an environment operation. ### environment\_version\_not\_found The `version_id`, or the `environment_version` label a session tried to pin. ### task\_not\_found The `task.id` a session tried to bind, or the `task_id` in the path. ## 409 Conflict ### idempotency\_conflict The `Idempotency-Key` was reused with a different request body. A key maps to exactly one create request. Use a fresh key, or resend the identical body to replay the original. ### session\_not\_open You posted a turn to a session that has already ended. The session is terminal; open a new one. ### turn\_index\_mismatch The `turn_index` you sent does not match the session's current turn. `detail.expected_turn_index` carries the index the server expected. Resubmit at that index. ### environment\_name\_taken An environment with this name already exists in the workspace. Names are unique per workspace, case-insensitive. With `get_or_create`, only a name held by a different `kind` conflicts. ### environment\_address\_taken Another environment in the workspace already claims this address. ### environment\_archived The environment resolves but is retired, so it cannot accept new sessions or new versions. Register a new environment, or describe one inline on the session. ### environment\_holds\_site\_access A PATCH to `/environments/{id}` would change `kind` or `config` on an environment that holds [site access](/concepts/site-access). That environment is a site, and its address and hosts decide which studies get its credentials, so they change only through site access (`/products/{product_id}/site-access`, named in the message). Change the site's hosts with `ish workspace site-access hosts` on the CLI or `site_access_set(method="hosts")` through MCP. A PATCH that changes neither field still goes through: a rename is allowed, and echoing back an unchanged `config` is not a change. ### environment\_version\_label\_taken The label collides with another live version of this environment. `detail.existing_version_id` carries the holder. ### environment\_version\_archived The version is archived. An archived version cannot be pinned by a new session, and cannot become the default, since it would refuse the very sessions the pointer sent it. ### environment\_version\_config\_frozen `config` and `example_actions` are frozen once any session references this version, so a PATCH that carries either is refused. Metadata stays editable for the life of the row. Send only the fields you actually changed: a PATCH that echoes an unchanged `config` back is refused the same way as one that edits it. ### environment\_version\_conflict A concurrent write to this version won the race. Re-read and retry. ### environment\_version\_default\_conflict A concurrent `set-default` won the race. Re-read the environment and retry. ### task\_name\_taken A task with this name already exists in the workspace family. Names are unique per family, case-insensitive. ### task\_archived The task resolves but is retired. Register a new task, or pass the instructions inline on the session. ### task\_in\_published\_listing A published listing references this task, so it cannot be retired. `detail.listing_id` names the listing. Unpublish or edit the listing first. ## 422 Unprocessable Entity Most 422s come from the request-validation layer and use the `ValidationError` envelope described above, with no `error_kind`. The two below are different: they are raised by the handler, carry the `Error` envelope, and name a kind. Both come from [people search](/api/guides/people-search), where the rule tree is something you author and we plan. ### search\_rule\_invalid The rule is malformed, or it names an attribute, source, or operator this API does not publish. `detail` names the offender: `source` and `key` for an unknown attribute, or the compiler's message for an operator that does not fit the attribute's type. Check the rule against [`GET .../people/schema`](/api/reference/people/get-people-schema), which is the authoritative vocabulary: an attribute is filterable only if the schema gives it a `filter` block, and only with the operators that block lists. ### search\_rule\_too\_complex The rule is well-formed but past a size cap: more than 2 levels of nested groups, more than 15 conditions in one group, or more than 25 in total. `detail` carries the offending count alongside the limit, so you do not have to bisect your own filter. Combining values with `in` costs one condition instead of one per value, and is usually the whole fix. ## 429 Too Many Requests Both are transient and both carry `Retry-After`. They reset on different clocks. ### rate\_limited A rate limit upstream of your request was exceeded. On this surface that is the API key's own request rate limit, which resets within the minute; the same kind is used elsewhere on the platform when an upstream provider limits us, which is why the remedy is expressed as "retry later" rather than "slow down". Honor `Retry-After`, also echoed as `detail.retry_after_seconds`. Not applied to user access tokens. ### session\_quota\_exceeded The API key's daily session-create quota is used up. It resets on a day boundary. Existing sessions are unaffected, so a loop already running keeps running; only new creates are refused. API keys only, not user tokens. ## 500 Internal Server Error None of these is a state to handle. Quote `request_id` and the kind in a bug report. ### session\_actor\_missing ### payer\_unresolved ### environment\_unresolved ## 502 Bad Gateway ### decision\_invalid The participant produced an invalid choice twice, and no turn was recorded. Retriable: resubmit the **same** `turn_index` with a fresh frame. ### persona\_refused The model behind the person declined to answer this turn, and no turn was recorded. Not retriable as-is: the same observation gets the same refusal, so change the observation (or end the session) instead of resubmitting it unchanged. ## Person context (app and CLI) These come from the workspace routes for reviewing a person's context. They are not part of the developer API. ### needs\_human\_approval 409. A person, not an assistant, has to confirm these actions: * approving context about a real person; * releasing a held pattern line; * accepting a real person's proposed bio; * changing a real person into another kind of person. The MCP server can't confirm them. `suggestions` holds the `ish` command to run in a terminal. ### version\_conflict 409. The episode or the patterns changed after you read them (`expected_version` is stale). Reload and retry. ### episode\_withdrawn 409. The episode is withdrawn. You can erase it, but not approve it. ### no\_pending\_bio\_proposal 409. No bio proposal is waiting to be accepted or dismissed. ### subject\_kind\_requires\_private 409. Only a private person can be marked as a real person. Unpublish them first. ### subject\_kind\_locked 409. A real person, or a person who is you, still has context that is not withdrawn, so what kind of person they are can't change. Withdraw or erase the context first. ## Related > [card] [Run the session loop](/api/guides/session-loop) > > Where each error lands in the loop, and how to recover without losing the turn. > [card] [Authentication](/api/authentication) > > Scopes, rotation, and what a key can reach. # Author your environment Source: https://docs.ishlabs.io/api/guides/environment-authoring Declare actions the participant can pick, write labels that do not leak, guide the resolver, and render frames that decode. An **environment** is your own product surface under test: the site, app, device, or world you are building. It is not a deploy target, a hosting environment, or a sandbox ish runs for you. You render it, you execute in it, and ish only decides what a person would do inside it. Your environment holds up two things each turn: the frame the participant perceives and the actions they may pick from. This guide covers how to declare actions, keep labels honest, guide the resolver in intent mode, and render frames that survive the wire. For the reasoning behind the rules, see [observations](/api/concepts/observations) and [the decide-only loop](/api/concepts/decide-only-loop). ## Declare actions Each turn you send `valid_actions`, the set available right now. The set can change every turn as the participant moves through your environment. A declared action has this shape: ```json theme={null} { "name": "press_button", "description": "Press a button on the remote.", "parameters": { }, "resolver_hint": "optional; intent mode only" } ``` * `name` matches `^[a-z][a-z0-9_]{0,63}$`: lowercase, starting with a letter, up to 64 characters. * `description` says what the control does, for the resolver. * `parameters` is a restricted JSON Schema subset (below), or `{}` for no parameters. * `resolver_hint` is an optional per-control note read only by the resolver in intent mode (below). ## The parameters subset `parameters` accepts a deliberately small subset of JSON Schema. Anything outside it is a `422`. * `{}`: no parameters; or * `{ "type": "object", "properties": { ... }, "required": [ ... ] }`, where each property is **either** * an **enum**: `{ "enum": ["a", "b", ...] }` (a non-empty list), or * a **free string**: `{ "type": "string" }` (an optional `"description"` is allowed). * No integers, numbers, booleans, nested objects, arrays, or other keywords. * Every name in `required` must exist in `properties`. ```json theme={null} { "type": "object", "properties": { "button": { "enum": ["power", "ch_up", "ch_down", "vol_up", "vol_down", "mute"] } }, "required": ["button"] } ``` Put human-readable option names in the enum. They are printed on the screen, so naming them is not a leak. ## Keep labels from leaking A label names what is *pressable*, never what it *means*. The participant reads meaning off the pixels, so a label that encodes hidden state hands them knowledge a person would not have. * Declare `move` with a direction, not `walk_to_treasure`. * Declare a from-and-to square pair, not the chess move `Nxe5+` (which leaks the piece, the capture, and the check). * Declare `click` on a visible target, not `rusty key` (which leaks an object's identity and role before the participant has looked). Your on-screen control hints also shape the participant's intents, because they read them literally. If your UI overlays "press the up arrow key", the participant will intend exactly that. Write control labels the way you want intents phrased. The reasoning is in [observations](/api/concepts/observations#the-label-leak-rule). ## Guide the resolver (intent mode) In intent mode a resolver maps the participant's intent onto your declared actions. Two layers let you steer it, and **neither is ever shown to the participant**: * `resolver_hint` is a **per-control** note on a single declared action (up to 1000 characters). Use it to disambiguate one control: "this toggles mute, not volume". * `resolver_guidance` is a **session-level, environment-wide** manual passed on create (up to 8000 characters). Use it for rules that span the whole environment: how your navigation works, what a gesture does, which controls are modal. They complement each other. Reach for a hint when one control is ambiguous, and for guidance when the whole environment needs a manual. ## The web adapter You can drive the API from any client. For web environments there is a small convention worth following, an object on `window.__ishEnv` that the loop reads each turn: ```js theme={null} meta() // -> { name, kind, pacing } matches your create-session environment and pacing declaredActions() // -> [ { name, description, parameters, resolver_hint? } ] reflects NOW; may change every turn execute(name, args) // -> Promise<{ ok, error }> performs the action; resolves after the page visually settles state() // -> { ...your ground truth... } OPTIONAL; for your own scoring only; NEVER sent to the participant ``` A failed `execute` (`{ ok: false, error }`) becomes the next turn's `error` block. There is no separate executed field. Native, desktop, and game integrations do not need this adapter; they run the same loop directly: observe, post, execute. > [!WARNING] > > `state()` is for your own scoring and must never reach the participant. Sending it as an observation defeats the whole point of running the participant. See [score outcomes](/api/guides/scoring-outcomes). ## WebGL and 3D environments Read this before you integrate anything that paints to a ``. **Headless browsers do not render WebGL reliably.** Three failure paths integrators have hit: * headless rendering returns a **blank** frame (a black image, tens of seconds per capture); * `canvas.toDataURL()` returns blank unless the context was created with `preserveDrawingBuffer: true`; * `page.screenshot()` **hangs** for tens of seconds and times out. Run a **headed browser on a real GPU** for any WebGL or 3D environment. For simple, non-heavy WebGL pages, `--use-angle=swiftshader` is a software-rendering fallback that lets a headless capture work, but it is not enough for dense scenes (a point cloud, a splat world); those need a real GPU. ## Frame size Real frames are far larger than a 1x1 placeholder. A frame about 1024 pixels wide is roughly 1 to 2 MB of base64, already close to the limit; a full 1080p frame exceeds it. * Keep frames around **1280x800**, as **PNG**. * The hard ceiling is a `413`. If you hit it, reduce the frame's **dimensions**, not its format. * The bytes are labeled `image/png`, so send PNG. Sending JPEG under that label can fail to decode. To shrink a frame, scale it down; do not switch format. ## Related > [card] [Observations](/api/concepts/observations) > > Why labels must not leak and state is refused. > [card] [Intent and resolution](/api/concepts/intent-and-resolution) > > How the resolver maps intent onto your actions. # Search people Source: https://docs.ishlabs.io/api/guides/people-search Build a rule tree over person attributes: the grammar, the boolean semantics, and the limits. `POST /v1/workspaces/{workspace_id}/people/search` finds people by their attributes. It searches the same pool [`GET .../people`](/api/reference/people/list-people) serves, and returns the same paginated envelope, so you can swap one for the other without changing how you read the response. ## Start from the schema [`GET .../people/schema`](/api/reference/people/get-people-schema) is the authoritative vocabulary. Every attribute it lists with a `filter` block is filterable; one without is not; one it does not list at all is refused. Copy `source` and `key` out of that block rather than guessing them, because they are not always the attribute's own name: ```json theme={null} { "name": "interests", "label": "Interests", "type": "string_list", "filter": { "source": "qualification", "key": "tag", "operators": ["eq", "in"] }, "writability": { "readable": true, "read_only": true } } ``` Filtering on interests means `"key": "tag"`, not `"key": "interests"`. ## The grammar A rule is a single node. A node is either a leaf or a group, never both. A **leaf** tests one attribute: ```json theme={null} { "field": { "source": "demographic", "key": "country" }, "operator": "eq", "value": "Sweden" } ``` A **group** combines nodes: ```json theme={null} { "op": "and", "conditions": [ ... ] } ``` `op` is `and`, `or`, or `not`. Groups nest, so a group can hold leaves, other groups, or a mix. ## Boolean semantics, exactly A group's `op` applies to its own `conditions` and to nothing else. * **`and`** matches a person satisfying **every** condition in that group. * **`or`** matches a person satisfying **at least one**. * **`not`** takes **exactly one** condition and matches people who do not satisfy it. A nested group is evaluated on its own first, and its result becomes one input to its parent's operator. There is no operator precedence to remember and nothing is ever combined implicitly: two conditions are joined by the `op` of the group holding them, and by nothing else. ## A worked example "Nurses in Sweden, plus teachers in Norway" is two `and` groups joined by an `or`: ```json theme={null} { "rule": { "op": "or", "conditions": [ { "op": "and", "conditions": [ { "field": { "source": "demographic", "key": "occupation" }, "operator": "eq", "value": "nurse" }, { "field": { "source": "demographic", "key": "country" }, "operator": "eq", "value": "Sweden" } ] }, { "op": "and", "conditions": [ { "field": { "source": "demographic", "key": "occupation" }, "operator": "eq", "value": "teacher" }, { "field": { "source": "demographic", "key": "country" }, "operator": "eq", "value": "Norway" } ] } ] }, "pagination": { "limit": 25 } } ``` > [!WARNING] > > The country is repeated inside both groups on purpose. `or` does not distribute over anything, so a country condition placed beside the two groups rather than inside them would be a third input to the `or` and would widen the result rather than narrow it. A Swedish teacher matches neither arm of the rule above. ## Operators Which operators are valid depends on the attribute's `type`, and the schema's `filter.operators` is the exact list per attribute. | Type | Operators | | - | - | | `string` | `eq`, `neq`, `in`, `not_in`, `contains`, `starts_with`, `is_null`, `is_not_null` | | `enum` | `eq`, `neq`, `in`, `not_in`, `is_null`, `is_not_null` | | `number` | `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `between`, `is_null`, `is_not_null` | | `string_list` (interests) | `eq`, `in` | `in` and `not_in` take an array. `between` takes a two-element array of bounds, both inclusive. String comparisons are case-insensitive. ### Testing whether an attribute is set `is_not_null` matches people who have a value for an attribute; `is_null` matches people who do not. Use these rather than comparing against an empty string. An attribute nobody filled in holds no value at all, and it satisfies no ordinary comparison, not even a negated one: `{"operator": "neq", "value": "nurse"}` does **not** match a person with no occupation on file. The same applies to `age`, which is computed from a date of birth. A person with no birth date matches no age filter in either direction. ### Rolling up interests Interests are a tree. Filtering on a parent node also matches everyone tagged at any node beneath it, so you do not have to enumerate a subtree to select a broad interest. ### Filtering into the accessibility profile The accessibility profile is a nested object, so its filter key is a dotted path, compared against a **string** value with `eq` or `neq`: ```json theme={null} { "field": { "source": "demographic", "key": "accessibility_profile.visual.uses_screen_reader" }, "operator": "eq", "value": "true" } ``` To select everyone with any declared need at all, filter on `accessibility_profile__has_any` instead. ## Limits A rule may: * nest groups at most **2** levels deep, * hold at most **15** conditions in any one group, * and **25** conditions in total. Past any of these the request is refused with `422` and `detail.error_kind` `search_rule_too_complex`, naming the offending count alongside the limit. The usual fix is `in`, which costs one condition instead of one per value: ```json theme={null} { "field": { "source": "demographic", "key": "country" }, "operator": "in", "value": ["Sweden", "Norway", "Denmark"] } ``` ## When a rule is refused Both refusals are a `422` carrying an `error_kind`, and they want different fixes. | Kind | Means | Fix | | - | - | - | | [`search_rule_too_complex`](/api/errors#search_rule_too_complex) | Past one of the caps above | Simplify; the detail names the count and the limit | | [`search_rule_invalid`](/api/errors#search_rule_invalid) | Malformed tree, or an attribute, source or operator this API does not publish | Check it against the schema; the detail names the offender | A malformed request **body** (rather than a bad rule) is the ordinary validation `422` with the field-level envelope instead. See [errors](/api/errors) for both shapes. ## Saved segments Segments live in the ish app and are not exposed on this API. A segment **is** a rule, so to use one, send its rule as the `rule` on this request. That is how the ish app applies them too. ## Related * [People](/api/concepts/people) * [Errors](/api/errors) # Score outcomes Source: https://docs.ishlabs.io/api/guides/scoring-outcomes The participant's words are perception, not a verdict. Judge task success from your own environment's state. The participant tells you how a moment felt: a `comment`, a `sentiment`, a `status`. That is their **perception**, not a judgment of whether the task actually succeeded. A participant can be confidently wrong, exactly as a real person can. If you score success off their words, you will record passes on failed tasks. ## The participant can be confidently wrong In a real run where a volume control had been secretly reversed, the participant declared "Volume 10 is perfect!" and finished with a `completed` status, while the frame plainly read **VOL 12**. Scoring off `session_status` and `sentiment` would have logged a clean pass on a broken control. This is not a defect in the participant; it is the point. The participant is the **experience layer**: did the interface feel confusing, where did they hesitate, what did they misread. A real person would have made the same mistake in front of the same reversed control. What the participant cannot be is the **verdict layer**, the source of truth on whether the task was met. ## Score from your own state Judge task outcomes from your environment's own state, the ground truth you already hold, and never from the participant's narration. 1. Keep a source of truth in your environment: the value the control was set to, the page the flow reached, the order that was placed. 2. After the run, assert against that state on your side. Did the volume reach the target? Did the checkout complete? 3. Use the participant's `comment`, `sentiment`, and `felt_intensity` for the experience read: where they hesitated, what confused them, where friction showed up. The two layers answer different questions. Your state answers "did it work". The participant answers "how did it feel to try". You want both, kept separate. ## Never feed your state to the participant If your web adapter exposes a `state()` method (see [author your environment](/api/guides/environment-authoring#the-web-adapter)), it is for your own scoring only. **Never send that state to the participant as an observation.** The participant perceives only rendered senses; handing them the true state turns them from a simulated human into a solver and destroys the very signal you are running them for. Keep `state()` on your side of the wire, and assert against it there. ## In intent mode, no\_match is its own signal A `no_match` resolution is not a failure to score against your state; it is a finding in its own right. The participant reached for something your environment does not offer, and `unmet_expectation` names the gap. Read those alongside your state assertions: your state tells you whether the task was met, and the `no_match` stream tells you where the participant expected an affordance that was not there. See [intent and resolution](/api/concepts/intent-and-resolution#the-finding-channel). ## Related > [card] [Intent and resolution](/api/concepts/intent-and-resolution) > > Where the finding signal comes from in intent mode. > [card] [Observations](/api/concepts/observations) > > Why the participant must never see your ground-truth state. # Run the session loop Source: https://docs.ishlabs.io/api/guides/session-loop The complete integration contract: turn ordering, errors as observations, retries, pagination, and idempotency. This is the complete contract for driving a session turn by turn. The [quickstart](/api/quickstart) runs one happy-path turn; this page covers the ordering rule that trips people up, how errors travel, how to index turns, and how to recover from each failure. If you follow one thing here, make it [the loop order](#the-loop-order). ## The loop order Each turn hands you a decision and a session status. Act on them **in this order**: 1. **If `action_name` is non-null, execute it first**, even if this turn is terminal. A non-null action is always yours to run. If executing fails, add an `error` block to your next turn. 2. **Then honor `session_status`.** If it is anything other than `open` (`completed`, `gave_up`, `closed`, `max_turns`, `spend_cap_reached`, `balance_exhausted`), stop, after executing any action from step 1. 3. **Otherwise (`open`), take the next turn.** If you executed an action, capture the new frame and submit at `turn_index + 1`. If `action_name` was null (an intent `no_match` or `none_needed`), execute nothing, the world is unchanged, and submit the next turn anyway. The outcome feeds back to the participant. > [!WARNING] > > A terminal turn can still carry your last action. The participant often bundles their final action with `done` in the **same** response: a non-null `action_name` and a terminal `session_status` together. Checking "is the session over?" first and skipping the action silently fails any task whose last step is an action. The TV never powers off; the order never places. `session_status` describes the participant's decision state, never your obligation to execute a returned action. The participant may also **split** the two: the action on a `continue` turn, then `done` with a null `action_name` on the next turn. Both bundled and split are valid, and the ordering above handles both. Execute a non-null action, then check the status. ## Errors are observations There is no separate "executed" field on a turn. When an action you executed fails, you report it as an `error` observation block on the **next** turn, alongside the image: ```json theme={null} { "turn_index": 3, "observation": [ { "type": "image", "data": "" }, { "type": "error", "data": "The power button did not respond." } ], "valid_actions": [ ... ] } ``` A failed execution is something a person would perceive, a dead button or a blocked door, so it travels through the same channel as everything else the participant senses. One turn carries **exactly one image block**; the optional `error` block is additional, never a second image. ## Turn indexing The `turn_index` on a turn must equal the session's current turn count. The first turn is `0`, and every recorded turn increments it by one. **Every returned turn is recorded, including `no_match` and `none_needed` turns.** Drive the next index off the response's `turn_index`, plus one, not off whether you executed anything. Two cases move differently: * A `502 decision_invalid` records **nothing**. Retry the **same** `turn_index` with a fresh frame. * A `502 persona_refused` records **nothing** either, but the same frame gets the same refusal: change the observation or end the session rather than resubmitting it unchanged. * A `409 turn_index_mismatch` hands you the index the server expected. Resubmit with `turn_index` set to that `expected_turn_index`. ## Reading the trace Read a session back to replay its decisions. The trace is a cursor page: pass `after_index` to get turns strictly after an index and `limit` to size the page (default 50, max 200). Page again with `after_index` set to the last index you received while `has_more` is true. ```bash theme={null} curl -sS "$API_URL/api/v1/sessions/$SESSION_ID?after_index=0&limit=50" \ -H "Authorization: Bearer $TOKEN" ``` The model behind the page is in [sessions and turns](/api/concepts/sessions-and-turns). ## Idempotency and replay The create call takes an optional `Idempotency-Key` header. The same key with the same body returns the existing session (`200`, not `201`); the same key with a different body is a `409` with `error_kind: idempotency_conflict`. Every create on the API takes the header on the same terms, so a retried registry write is as safe as a retried session: sessions, environments, environment versions, and tasks. Each create looks its key up in its own scope, the workspace for sessions, environments, and tasks, and the parent environment for a version, so the same string on two different creates never collides. Turns have a related safety net. An exact-duplicate replay of your **final** turn, the same `turn_index`, the same `observation`, the same `valid_actions`, returns the stored decision **even after the session has ended**. Replay is checked before the "is the session open?" guard, so a lost response to the last turn is always safe to retry. A *different* body at that index is a `turn_index_mismatch`. ## Handling errors These are the errors the session loop itself produces. Branch on `detail.error_kind`, not on the status. Every kind the API returns, including the registry ones this table leaves out, is in the [error reference](/api/errors). | Status | When | What to do | | - | - | - | | `401` `invalid_api_key` | Missing, malformed, unknown, or revoked API key, all one kind | Check the `Authorization` header. See [authentication](/api/authentication). | | `402` `credits_exhausted` / `plan_allowance_exhausted` / `spend_cap_reached` | The turn could not be paid for and was not applied | Terminal. The three kinds have three different remedies; see [billing and limits](#billing-and-limits). | | `403` `insufficient_scope` | The key lacks the scope this call needs; `detail.required_scope` names it | Use a key carrying that scope. | | `403` `person_out_of_scope` | The person is not workspace-owned or platform-library | Use an in-scope `person_id`. | | `404` | Workspace, session, person, environment, or task not found or unreachable by your token | Check the ids and that your token's workspace owns them. The kind names which one. | | `409` `turn_index_mismatch` | Wrong turn index | Resubmit with `turn_index` set to the `expected_turn_index` in the body. | | `409` `session_not_open` | You posted a turn after the session closed or terminated | The session is terminal; start a new one. | | `409` `idempotency_conflict` | Reused an `Idempotency-Key` with a different body | Use a fresh key, or send the identical body to replay. | | `413` | Request body too large (the base64 frame) | Reduce the frame's dimensions. See [frame size](/api/guides/environment-authoring#frame-size). | | `422` | Validation error (two envelope shapes, below) | Fix the payload. | | `429` `rate_limited` / `session_quota_exceeded` | The key's per-minute request rate, or its daily session-create quota | Transient. Honor `Retry-After`; the two reset on different clocks. | | `502` `decision_invalid` | The participant produced an invalid choice twice; no turn was recorded | Retriable: resubmit the **same** `turn_index` with a fresh frame. | | `502` `persona_refused` | The model behind the person declined to answer; no turn was recorded | Not retriable as-is: change the observation or end the session. | ### Two shapes of 422 Validation errors come back in two shapes, so parse defensively: * **A malformed request** (wrong types, a missing field, an invalid observation `type`, a bad enum value, `parameters` outside the allowed subset) returns a structured envelope with an `errors` array of field locations: ```json theme={null} { "error": "Validation error", "error_code": "validation_error", "status": 422, "retryable": false, "detail": "Validation error", "errors": [ { "loc": ["body", "observation", 0, "type"], "msg": "...", "type": "..." } ] } ``` * **A business-rule rejection** raised inside the endpoint (for example "exactly one image observation block is required", or a declared-action that is not enum-or-string) returns a plain `detail`: ```json theme={null} { "detail": "exactly one image observation block is required", "request_id": "..." } ``` ## Billing and limits Two limits can end or block a session for cost or capacity reasons, separate from the participant's own termination. **Running out of budget.** Each turn accrues credits against the organization's credit pool, and the charge settles when the session ends. A turn that cannot be paid for is refused with a `402` and is **not** applied; the session becomes terminal. Three refusals, three remedies. Branch on `detail.error_kind`, not on the status, because the first two share one status: | `error_kind` | Terminal status | What to do | | - | - | - | | `credits_exhausted` | `balance_exhausted` | No spendable credits left. Top up. | | `plan_allowance_exhausted` | `balance_exhausted` | The plan's allowance for this period is spent. It refreshes on the date in the message, or top up to continue now. | | `spend_cap_reached` | `spend_cap_reached` | The workspace's own per-period spend cap. Raise it, or wait for the period to roll over. | The session also records the reason as `ended_reason`, so a session you read back later still says which of the two `balance_exhausted` cases it was. Treat any terminal status as "stop the loop"; to continue, resolve the cause and open a new session. **Session-create quota (per key).** An API key has a cap on how many sessions it can open per day. A create that exceeds it returns a `429`. Unlike the spend cap, this is **transient**: back off and retry the create later. It applies to API keys only, not to user tokens. ## Open unions: tolerate unknown values `sentiment`, `session_status`, `resolution`, and the observation block `type` are **open unions**. New values may be added over time. Tolerate a value you do not recognize rather than hard-failing on it. `spend_cap_reached` is a live example: it joined `session_status` after the first statuses shipped. The 11 sentiments today are `Delighted`, `Excited`, `Confident`, `Satisfied`, `Relieved`, `Neutral`, `Confused`, `Uncertain`, `Anxious`, `Frustrated`, and `Disengaged`, and `felt_intensity` is one of `mild`, `moderate`, or `strong`. ## The reference loop The whole contract in one place, in any language: ```text theme={null} create session -> session_id ; turn_index = 0 ; pending_error = null loop: actions = observe_available_actions() # what a user could do right now frame = capture_frame_png_base64() # the current view obs = [ {type:"image", data:frame} ] + (pending_error ? [pending_error] : []) resp = POST /sessions/{id}/turns { turn_index, observation:obs, valid_actions:actions } on 409 turn_index_mismatch -> turn_index = err.expected_turn_index ; continue on 502 decision_invalid -> retry SAME turn_index with a fresh frame on 502 persona_refused -> do not resend as-is; change the frame or end d = resp.decision if d.action_name != null: # ALWAYS execute a non-null action FIRST, ok = execute(d.action_name, d.arguments) # even on a terminal turn (action + done can bundle) pending_error = ok ? null : {type:"error", data:""} else: pending_error = null # no_match / none_needed: nothing to execute if resp.session_status != "open": break # THEN stop: completed / gave_up / max_turns turn_index = resp.turn_index + 1 # every returned turn is recorded POST /sessions/{id}/close # when you are done; returns the final session ``` ## Related > [card] [Author your environment](/api/guides/environment-authoring) > > Declare actions, write labels, size frames. > [card] [Score outcomes](/api/guides/scoring-outcomes) > > Judge success from your state, not the participant's words. # The ish API Source: https://docs.ishlabs.io/api/overview Put a simulated person in the decision loop of your own environment and read how they react, turn by turn. The ish API is the entry point for human feedback on whatever you are building, in whichever format you can render it. Instead of handing ish a finished artifact and reading a reported journey afterward, you put a person directly inside your environment's decision loop as a participant and watch them react while they move. Each turn, you show the participant what a human would see and the set of actions available right now. They pick one action and tell you how they felt about the moment. You carry the action out in your own environment, capture the next view, and take the next turn. An **environment** here is your own product surface being tested: the site, app, device, or world you are building. It is not a deploy target, a hosting tier, or a sandbox we run for you. You render it and you execute in it; ish never touches it. > [!WARNING] > > **Breaking change, 2026-07-28.** The public noun is now `person`: `persona_id` is `person_id` on create, and session reads carry `person_id` (plus `participant.person_id` on list rows). An environment descriptor's `platform` field is now `kind`. Closing a session moved from `DELETE /v1/sessions/{id}` to `POST /v1/sessions/{id}/close`, and both create and close now return the full session body instead of a five-field stub. The [changelog](/api/changelog) has the complete entry and the one before it. ## The idea in five lines * A participant decides what to do inside your environment from what a human would **see**. * Each turn you send **one rendered frame** (what the participant perceives) plus **the actions available right now**. * ish replies with the **chosen action** and how the participant **felt**: a comment, a sentiment, an intensity. * **You execute** that action in your environment, capture the frame again, and send the next turn. * ish only **decides**; you **execute**. No locators, no automation on our side. See [the decide-only loop](/api/concepts/decide-only-loop). ## What makes this different from a study The [ish CLI](/cli/overview) and the [ish MCP server](/mcp/overview) drive the research app: a [study](/concepts/study) sends simulated people through a finished artifact and reports back a journey once each one is done. The API is a separate surface with a different shape. Here the participant is a live decision brain inside your environment, one turn at a time, and you own both the rendering and the execution. The two surfaces share their foundations. A [person](/concepts/people) is the same reusable simulated person, and a [workspace](/concepts/workspace) is the same tenant that owns your people and holds your credits. They do not share studies, iterations, or runs. You do not need a study to use the API. ## What the participant perceives The participant reads meaning off the pixels, the same way a person sitting in front of your screen would. You send human-sensory frames only: an image now, with audio reserved for later. Structured state (a scene graph, game-state JSON, a DOM dump) is refused at the boundary, because a participant handed the true state is a solver, not a simulated human. The rules and the reasoning live in [observations](/api/concepts/observations). ## Which people you can run A session runs one person, and the API admits two classes: * **Workspace-owned people**, the AI People your workspace created and owns. * **Platform-library people**, the owner-less AI People the platform curates for broad reuse. HUMAN People, the records a real person owns, are out of scope for the API by policy, not by accident: a record grounded in a specific human carries likeness and personal data that this surface deliberately does not touch. The create call refuses anything outside the two classes above with a `403`. For the person model itself, see [people and panels](/concepts/people). ## Two decision modes Every session runs in one of two modes, and the create response tells you which: * **Intent** is the default and the product path. The participant says what they *want*, and a resolver maps that onto one of your declared actions. Intent resolves three ways: `matched` (an action to run), `no_match` (the participant wanted something your environment does not offer, usually the signal you are after), and `none_needed` (the participant is done). * **Direct** is an evaluation baseline where the participant picks one of your declared actions itself. It sees the action list, so it is not the path a real integration uses. Both are covered in [intent and resolution](/api/concepts/intent-and-resolution). ## Authentication Every request carries a bearer token: a workspace API key you mint in **Settings**, then **Developers**. See [authentication](/api/authentication). ## Where to go next > [card] [Quickstart](/api/quickstart) > > Create a session, run one turn, and read the decision. > [card] [Run the session loop](/api/guides/session-loop) > > The complete integration contract: ordering, errors, retries, pagination. > [card] [The decide-only loop](/api/concepts/decide-only-loop) > > Why ish decides and you execute, and what that buys you. > [card] [Author your environment](/api/guides/environment-authoring) > > Declare actions, write labels that do not leak, render frames that decode. > [card] [Find a person](/api/concepts/people) > > Read and search the pool you can open a session for, and what each person carries. # Quickstart Source: https://docs.ishlabs.io/api/quickstart Create a session, run one turn of the loop, and read how the participant reacted. This walks one happy path: create a session, send the first turn, read the participant's decision, and close. By the end you will have run one full turn of the loop and seen the shape of every response. For the complete integration contract (ordering, retries, pagination, every error), follow [run the session loop](/api/guides/session-loop) next. > [!NOTE] > > You need a workspace, a person to run, and a workspace API key. See [authentication](/api/authentication) for how to mint one. The examples use `api.ishlabs.io` as a placeholder base; substitute the base URL from your onboarding if you have one. ## Step 1: set your placeholders Four values stand in for yours throughout. `WORKSPACE_ID` is the workspace the session runs under and `PERSON_ID` is the person to run. ```bash theme={null} export API_URL="https://api.ishlabs.io" # your ish API base export TOKEN="..." # your bearer token export WORKSPACE_ID="..." # the workspace the session runs under (UUID) export PERSON_ID="..." # the person to run (UUID) ``` ## Step 2: create a session A session is `create` then a series of turns, then `close`. State lives on the server; you drive the loop. Create one with the person, a task, the environment, and a pacing contract. A "session" here is one participant working toward one task in your environment, turn by turn. It is not a study session, and it has nothing to do with a browser session. The environment is your own product surface, the thing you are testing: a site, an app, a device, a world. It comes one of two ways and you supply **exactly one**: an inline `environment` descriptor, as below, or an `environment_id` naming an environment you registered once (which then supplies the default operating notes and action vocabulary for every session that uses it). Start inline; register one when you find yourself repeating it. The task works the same way: `task` is a required object with exactly one shape. `{"instructions": ...}` describes the intent inline; `{"id": ...}` binds a task you registered, freezing its instructions and revision onto the session so later edits to the registered task never change what this session ran against. ```bash theme={null} curl -sS -X POST "$API_URL/api/v1/workspaces/$WORKSPACE_ID/sessions" \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -H "Idempotency-Key: my-unique-key-001" -d @- < [!TIP] > > The optional `Idempotency-Key` header makes create retry-safe. The same key with the same body returns the existing session (`200`, not `201`); the same key with a different body is a `409`. ## Step 3: submit the first turn Each turn sends what the participant perceives (one image block) plus the actions available this turn. The `turn_index` must equal the session's current turn count, so the first turn is `0`. The `data` is the raw base64 of a real screenshot, with no `data:` prefix. Encode your own frame as shown below. Send a real frame: a blank or degenerate image (for example a 1x1 pixel) is rejected by the vision model. See [frame size](/api/guides/environment-authoring#frame-size) for dimensions. ```bash theme={null} IMG=$(base64 -i screenshot.png | tr -d '\n') curl -sS -X POST "$API_URL/api/v1/sessions/$SESSION_ID/turns" \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d @- < [!WARNING] > > A terminal turn can still carry your last action. The participant often bundles their final action with `done` in the same response. Checking "is the session over?" first and skipping the action silently fails any task whose last step is an action: the TV never powers off, the order never places. Always read `action_name` and execute it before you stop. Full detail in [run the session loop](/api/guides/session-loop#the-loop-order). ## Step 5: close the session When the participant is done or you are, close the session. Closing an already-closed session is a no-op `200`. ```bash theme={null} curl -sS -X POST "$API_URL/api/v1/sessions/$SESSION_ID/close" -H "Authorization: Bearer $TOKEN" ``` Close takes no body and returns the same full session object create returned, now in its final state, so the last thing you read is what was actually recorded. The fields that moved: ```json theme={null} { "status": "closed", "turn_count": 7, "accrued_credits": 7, "ended_reason": null, "ended_at": "2026-07-28T09:19:37.204Z", "updated_at": "2026-07-28T09:19:37.204Z" } ``` `status` says who ended it: `closed` when you did, `completed` or `gave_up` when the participant did, `max_turns` when the server truncated at the budget. `ended_reason` stays null on an ordinary ending and names a billing cause when there was one. That is the whole loop: create, then observe, decide, execute, repeat, then close. ## Where to go next > [card] [Run the session loop](/api/guides/session-loop) > > The complete contract: turn indexing, retries, bundled and split terminals, every error. > [card] [Author your environment](/api/guides/environment-authoring) > > Declare actions, write labels, render frames that decode. > [card] [Score outcomes](/api/guides/scoring-outcomes) > > Judge success from your own state, not the participant's words. > [card] [Sessions and turns](/api/concepts/sessions-and-turns) > > The session model, the trace, and pacing. # Create Environment Source: https://docs.ishlabs.io/api/reference/environments/create-environment /api/openapi.public.json post /api/v1/workspaces/{workspace_id}/environments Register an environment: a named target sessions can be opened against. Supports the standard `Idempotency-Key` header, which is the mechanism to reach for in CI: a retry with the same key and body replays the original environment (200 instead of 201), and the same key with a different body is a 409 `idempotency_conflict`. `get_or_create` is the older, coarser flag and remains supported. Note what it does NOT do: on a name match it returns the EXISTING row untouched and IGNORES every other field on this request, so a request whose config has drifted from the stored one succeeds while changing nothing. Use `Idempotency-Key` for retry safety and PATCH to reconcile config. # Create Environment Version Source: https://docs.ishlabs.io/api/reference/environments/create-environment-version /api/openapi.public.json post /api/v1/environments/{environment_id}/versions Author a declared variant of this environment. `version` is assigned server-side as max+1; the caller names the variant with `label`. The new version is NOT made default: a fresh variant must never silently redirect the traffic of callers who pin nothing. This is the CI operation of the lane (a deploy authors the variant it just built), so it takes the standard `Idempotency-Key` header: a retried pipeline step with the same key and body replays the original version (200 instead of 201) rather than minting `label-2`. The same key with a different body is a 409 `idempotency_conflict`. # Delete Environment Source: https://docs.ishlabs.io/api/reference/environments/delete-environment /api/openapi.public.json delete /api/v1/environments/{environment_id} Retire an environment. It stops appearing in the list but stays readable by id, and every session that ran in it keeps resolving, so a decision trace never points at a dangling reference. Its name and address are freed for reuse immediately. Idempotent. # Delete Environment Version Source: https://docs.ishlabs.io/api/reference/environments/delete-environment-version /api/openapi.public.json delete /api/v1/environment-versions/{version_id} Archive a variant. ARCHIVE, not hard delete, for the reason the parent archives: sessions stamped with this version must keep resolving, and a comparison read over historical runs must keep working. The row stays readable by id, appears in the list under `include_archived=true`, refuses new sessions, loses the default pointer if it held it, and frees its label for reuse. Idempotent: archiving an already-archived version is another 204. # Get Environment Source: https://docs.ishlabs.io/api/reference/environments/get-environment /api/openapi.public.json get /api/v1/environments/{environment_id} One registered environment. # Get Environment Version Source: https://docs.ishlabs.io/api/reference/environments/get-environment-version /api/openapi.public.json get /api/v1/environment-versions/{version_id} One declared variant. Archived versions stay individually readable. # List Environment Versions Source: https://docs.ishlabs.io/api/reference/environments/list-environment-versions /api/openapi.public.json get /api/v1/environments/{environment_id}/versions Every declared version of this environment, oldest first. An environment with no versions returns an empty list, which is the normal resting state: versions are never created automatically, so zero here means nobody has authored one. # List Environments Source: https://docs.ishlabs.io/api/reference/environments/list-environments /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/environments Every LIVE environment registered in this workspace, oldest first. Archived environments are excluded unless `include_archived=true`; they stay individually readable by id either way. API keys do not see console-owned kinds (`chatbot` environments, which the chat federation writes and the console renders as read-only mirrors). They are not developer-registerable, so listing them to an integrator would offer rows no key can act on. # Set Default Environment Version Source: https://docs.ishlabs.io/api/reference/environments/set-default-environment-version /api/openapi.public.json post /api/v1/environment-versions/{version_id}/set-default Point this environment's default at this variant. Sessions that name the environment WITHOUT pinning a version resolve here from now on. Sessions already opened are untouched: the version they ran against is stamped on the row and nothing re-resolves it. Idempotent, and the outgoing default is cleared in the same transaction. # Update Environment Source: https://docs.ishlabs.io/api/reference/environments/update-environment /api/openapi.public.json patch /api/v1/environments/{environment_id} Partially update an environment. Omitted fields are untouched. Sessions already opened here are unaffected: they carry a frozen snapshot of the name/kind, exactly so a rename cannot rewrite history. # Update Environment Version Source: https://docs.ishlabs.io/api/reference/environments/update-environment-version /api/openapi.public.json patch /api/v1/environment-versions/{version_id} Partially update a variant. Omitted fields are untouched. METADATA (`label`, `description`) is editable for the life of the row. `config` and `example_actions` are FROZEN once any session has run against this version: editing them then would retroactively relabel stored runs, so the answer is a new version. # API reference Source: https://docs.ishlabs.io/api/reference/introduction The sessions, environments, versions, and tasks endpoints: base URL, authentication, conventions, and all 21 operations. The reference pages in this section are generated from the API's OpenAPI specification. Each operation page lists its parameters, request body, responses, and an interactive request builder. This page is the orientation: the base URL, how requests authenticate, the response conventions, and every operation in lifecycle order. ## Base URL ``` https://api.ishlabs.io ``` Every path is versioned under `/api/v1`. Substitute the base URL from your onboarding if you have one. ## Authentication Every request carries a bearer token in the `Authorization` header: ``` Authorization: Bearer ``` The token is a workspace API key (prefix `ish_sk_live_`), minted in **Settings**, then **Developers**. Keys are minted with `sessions:run`, `sessions:read`, and `tasks:read`; ask for `tasks:write`, `environments:read`, or `environments:write` if the key manages a registry rather than just running against it. An ish user access token also works on the same header for personal scripts. See [authentication](/api/authentication). ## What "session" means here A **session** is one participant working toward one task in your environment, turn by turn. It is not the ish product's notion of a study session (a person sitting down with a study), and it is unrelated to a browser session. Sessions live under `/v1/sessions`. ## The operations Twenty-one operations across four surfaces, and this is all of them. **Sessions** is the loop: open a session for a person, submit turns, read the trace, list your sessions, close it. The other three are registries you write once and reference by id. **Environments** names a target instead of describing it inline on every session. **Environment versions** are the declared variants of one environment, so a session can pin the exact variant it ran against. **Tasks** names an intent a session can bind by id, freezing its instructions and revision onto the session. You need none of the registries to run a session. Describe the environment inline, pass the instructions inline, and the sessions surface alone is a complete integration. ### Sessions | Operation | Method and path | Purpose | | - | - | - | | Create session | `POST /api/v1/workspaces/{workspace_id}/sessions` | Open a decide-only session for a workspace-owned or platform-library person; returns the full session | | List sessions | `GET /api/v1/workspaces/{workspace_id}/sessions` | List the workspace's sessions, newest first, filtered and keyset-paged | | Submit turn | `POST /api/v1/sessions/{session_id}/turns` | Submit one observation plus the declared action set; get the participant's choice | | Get session | `GET /api/v1/sessions/{session_id}` | Read the session state plus a cursor page of the decision trace | | Close session | `POST /api/v1/sessions/{session_id}/close` | Close an open session and get the final session back (idempotent on an already-closed one) | ### Environments | Operation | Method and path | Purpose | | - | - | - | | Create environment | `POST /api/v1/workspaces/{workspace_id}/environments` | Register a named target sessions can be opened against | | List environments | `GET /api/v1/workspaces/{workspace_id}/environments` | Every live environment in the workspace, oldest first | | Get environment | `GET /api/v1/environments/{environment_id}` | Read one registered environment | | Update environment | `PATCH /api/v1/environments/{environment_id}` | Partially update an environment; omitted fields are untouched | | Delete environment | `DELETE /api/v1/environments/{environment_id}` | Retire an environment; sessions that ran against it keep their snapshot | ### Environment versions | Operation | Method and path | Purpose | | - | - | - | | Create version | `POST /api/v1/environments/{environment_id}/versions` | Author a declared variant of this environment | | List versions | `GET /api/v1/environments/{environment_id}/versions` | Every declared version of this environment, oldest first | | Get version | `GET /api/v1/environment-versions/{version_id}` | Read one variant; archived ones stay readable by id | | Update version | `PATCH /api/v1/environment-versions/{version_id}` | Partially update a variant; omitted fields are untouched | | Delete version | `DELETE /api/v1/environment-versions/{version_id}` | Archive a variant | | Set default version | `POST /api/v1/environment-versions/{version_id}/set-default` | Point the environment's default at this variant | ### Tasks | Operation | Method and path | Purpose | | - | - | - | | Create task | `POST /api/v1/workspaces/{workspace_id}/tasks` | Register a named intent a session can bind by id | | List tasks | `GET /api/v1/workspaces/{workspace_id}/tasks` | The workspace's registered tasks, oldest first | | Get task | `GET /api/v1/tasks/{task_id}` | Read one task; archived ones stay readable by id | | Update task | `PATCH /api/v1/tasks/{task_id}` | Partially update a task; any applied write bumps `revision` | | Delete task | `DELETE /api/v1/tasks/{task_id}` | Retire a task; sessions that bound it keep their frozen copy | Operations that create a thing in a workspace, or list what it owns, nest under `/workspaces/{workspace_id}/…`. The rest act on an existing record by its globally-unique id, so the path carries no workspace: the id already resolves it. Both address the same workspace and authorize the same way. ## Environments An **environment** is your own product surface under test: the site, app, device, or world you are building. It is not a deploy target, a hosting environment, or a sandbox ish runs for you. You render it and you execute in it. Every session names the environment it runs in, one of two ways, and you must supply **exactly one**: * `environment_id`, a registered environment. It supplies the default operating notes for the resolver and a default action vocabulary, and its name and kind are snapshotted onto the session. * `environment`, an ad-hoc descriptor (`{ name, kind }`) described inline on the session. An environment has a `kind` (`web`, `device`, `world` today; treat it as an open union) and a `config` validated per kind: `web` needs `config.url`, `device` needs `config.app_artifact`, and any kind may declare an `origins` allowlist. Identity is the `environment_id`, never the URL, so a target reached through a rotating tunnel host keeps the same environment across sessions. Renaming or deleting an environment never rewrites history: a session keeps the name and kind it was opened with, and its `environment_id` simply becomes null. The turn-by-turn contract that drives these (ordering, retries, indexing) is in [run the session loop](/api/guides/session-loop). ## Response conventions * **Correlation id.** Every response carries an `X-Request-Id` header. Error bodies echo it as `request_id`. Quote it in support requests. * **Two error envelopes.** A request-shape failure (HTTP 422) uses the `ValidationError` envelope, a field-level object with `error_code` and an `errors` array so you can pinpoint the offending field. Everything else (401, 403, 404, 409, 502, and handler-raised 422s) uses the `Error` envelope, a `{ detail, request_id }` object where `detail` may be a string or a structured object carrying a machine-readable `error_kind` such as `idempotency_conflict`, `turn_index_mismatch`, or `decision_invalid`. Every kind, with what it means and what to do, is in the [error reference](/api/errors); where each one lands in the loop is in [handling errors](/api/guides/session-loop#handling-errors). * **Open unions.** Several enum-typed and block-typed fields (`sentiment`, `session_status`, `resolution`, the observation block `type`) may gain new values over time. Tolerate a value you do not recognize rather than failing on it. * **Idempotency.** Every create accepts an `Idempotency-Key` header (sessions, environments, environment versions, tasks); a retry with the same key and body replays the thing already created. See the create operations and [run the session loop](/api/guides/session-loop#idempotency-and-replay). * **Pagination, two shapes.** Reading one session pages its **trace** by index: pass `after_index` and `limit` (default 50, max 200), and page again while `has_more` is true. Listing a workspace's **sessions** pages by opaque keyset instead: pass `after` and `limit` (default 25, max 100), then follow `next_cursor` while `has_more` is true, newest first. Never build a cursor yourself and never treat it as an offset. The environment, environment-version, and task lists return the whole collection under `items` and are unpaginated today; they carry `has_more: false` and `next_cursor: null` so pagination can land later without a wire break, so read those two fields rather than assuming one page forever. * **Versioned path.** Every path is versioned under `/api/v1`. What that promises, and what may change inside it, is in [versioning](/api/versioning). ## Before you integrate > [card] [Quickstart](/api/quickstart) > > Run one turn end to end against the live wire. > [card] [Run the session loop](/api/guides/session-loop) > > The full contract: ordering, retries, errors, pagination. > [card] [Observations](/api/concepts/observations) > > What a turn may send, and why state is refused. > [card] [Author your environment](/api/guides/environment-authoring) > > Declare actions and render frames that decode. # Get People Counts Source: https://docs.ishlabs.io/api/reference/people/get-people-counts /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/people/counts How many people this credential can reach, split by owner. Cheaper than paging the list to find out, and the number you want before building a filter: it tells you whether a rule that matches 3 people is a precise audience or a nearly-empty workspace. Exact counts, not estimates. Counts the same pool the list pages, archive state included: a count that disagreed with the list it introduces would be worse than no count. # Get People Schema Source: https://docs.ishlabs.io/api/reference/people/get-people-schema /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/people/schema Every attribute a person can carry: its type, its values, how to filter it. This is the authoritative vocabulary for the search endpoint. An attribute listed here with a `filter` block can be used in a rule; one without cannot, and one absent entirely is refused rather than silently matching nothing. Cache it. It is the same for every workspace and changes only when ish adds an attribute or an enum value, both of which are additive. Read `writability` rather than guessing from a version number. Most attributes are settable through the create and update endpoints; the ones that are not fall into three groups, and the block says which: derived from something you can set (`age`, `occupation_code`), owned by an operation rather than a field (`archived_at`), or provenance (`generation_job_id`). # Get Person Source: https://docs.ishlabs.io/api/reference/people/get-person /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/people/{person_id} Fetch one person by id. The read names a workspace because the pool does. Alongside the people your workspace owns, you can read the ones published in the shared ish library, and a library person belongs to no workspace of their own. Naming the workspace you are asking as is what lets the same library person be readable through any workspace you belong to, so this read is workspace-scoped where a session, an environment or a task is not. Reachability is the same rule the list uses, so a person this workspace can neither own nor run answers `404` with `error_kind` `person_not_found`, identical to an id that does not exist. That is deliberate: a distinguishable answer would let anyone test which ids are real. # List People Source: https://docs.ishlabs.io/api/reference/people/list-people /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/people List the people you can open a session for, newest first. Two kinds of person are reachable: the ones your workspace owns, and the ones published in the shared ish library. Both are usable in a session, and each row's `owner` says which it is. People that other workspaces have published are deliberately NOT listed: you could not open a session for them, and listing what you cannot use is worse than not listing it. Keyset-paginated: page forward with `after` set to the previous response's `next_cursor`, and stop when `has_more` is false. For anything beyond a name match, use the search endpoint. # Search People Source: https://docs.ishlabs.io/api/reference/people/search-people /api/openapi.public.json post /api/v1/workspaces/{workspace_id}/people/search Find people by their attributes, using a boolean rule tree. Searches the same pool the list endpoint serves (your workspace's people plus the platform library), and returns the same paginated envelope. ## The rule tree A rule is a single node. A node is either a **leaf** or a **group**, never both: - A **leaf** tests one attribute: `{"field": {"source": ..., "key": ...}, "operator": ..., "value": ...}`. Copy `source` and `key` from the attribute's `filter` block in `GET .../people/schema`; that endpoint is the authoritative vocabulary, and an attribute or operator it does not list is refused with a `422` rather than matching nothing. - A **group** combines nodes: `{"op": "and" | "or" | "not", "conditions": [...]}`. ## Boolean semantics, exactly A group's `op` applies to its OWN `conditions` and to nothing else. `and` matches a person satisfying **every** condition in that group; `or` matches a person satisfying **at least one**; `not` takes **exactly one** condition and matches people who do not satisfy it. Groups nest, so a group inside another group is evaluated on its own first and its result is then one input to the parent's operator. There is no precedence to remember and no implicit combination anywhere: two conditions are only ever joined by the `op` of the group holding them. ## A worked example "Nurses in Sweden, plus teachers in Norway" is two AND-groups joined by an OR. Note that the country is repeated in both groups: the outer `or` does not distribute over anything, so a condition placed outside the groups would not apply to either. ```json { "rule": { "op": "or", "conditions": [ {"op": "and", "conditions": [ {"field": {"source": "demographic", "key": "occupation"}, "operator": "eq", "value": "nurse"}, {"field": {"source": "demographic", "key": "country"}, "operator": "eq", "value": "Sweden"} ]}, {"op": "and", "conditions": [ {"field": {"source": "demographic", "key": "occupation"}, "operator": "eq", "value": "teacher"}, {"field": {"source": "demographic", "key": "country"}, "operator": "eq", "value": "Norway"} ]} ] }, "pagination": {"limit": 25} } ``` ## Testing whether an attribute is set `is_not_null` matches people who have a value for an attribute, and `is_null` matches people who do not. Reach for these rather than comparing against an empty string: an attribute nobody filled in holds no value at all, and it satisfies no ordinary comparison, not even a negated one. ## Limits, and how a rule is refused A rule may nest groups at most **2** levels deep, hold at most **15** conditions in any one group, and **25** in total. Both refusals are a `422` carrying an `error_kind`, and they have different fixes: - `search_rule_too_complex`: past one of those caps. The detail names the offending count and the limit. Combining values with `in` costs one condition instead of one per value, and is the usual fix. - `search_rule_invalid`: the tree is malformed, or it names an attribute, source or operator this API does not publish. The detail names the offender, and `GET .../people/schema` is the vocabulary it was checked against. A malformed request BODY (rather than a bad rule) is the ordinary validation `422` with the field-level envelope, which is why this operation's `422` documents either shape. ## Saved segments Segments live in the ish app and are not exposed here. A segment IS a rule, so the way to use one is to send its rule as the `rule` on this request: that is how the ish console itself applies them. # Close Session Source: https://docs.ishlabs.io/api/reference/sessions/close-session /api/openapi.public.json post /api/v1/sessions/{session_id}/close Close an open session and return it (idempotent on an already-closed one). A POST on a `/close` subresource rather than `DELETE /sessions/{id}`: closing is a state TRANSITION that settles the session's turns and leaves a readable record, not a removal. DELETE promised an erasure this route never performed, and it had no honest way to return the closed session's body. # Create Session Source: https://docs.ishlabs.io/api/reference/sessions/create-session /api/openapi.public.json post /api/v1/workspaces/{workspace_id}/sessions Open a session: one of your people, working toward one task, inside your environment. The TASK is required and is exactly one of two shapes: `{"instructions": "..."}` describes the intent inline, or `{"id": "..."}` binds a task you registered. A bound task's instructions are frozen onto the session, so later edits to the registry never change a run that already happened. An id that does not resolve is a 404; one that resolves but is retired is a 409. The ENVIRONMENT is also exactly one of two shapes: `environment_id` names one you registered, or `environment` describes an ad-hoc one inline. A registered environment's name, kind and configuration are snapshot onto the session for the same reason. Send an `Idempotency-Key` header to make retries safe: the same key with the same body replays the original session as a 200, and the same key with a different body is a 409. # Get Session Source: https://docs.ishlabs.io/api/reference/sessions/get-session /api/openapi.public.json get /api/v1/sessions/{session_id} The full session state + a cursor page of the decision trace. `after_index` returns turns strictly after that turn_index; `limit` (default 50, max 200) caps the page. `has_more` in the body signals whether to page again. # List Sessions Source: https://docs.ishlabs.io/api/reference/sessions/list-sessions /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/sessions List a workspace's sessions, newest first (keyset-paginated). Ordered `created_at DESC, id DESC`. Page forward with `after` set to the prior response's `next_cursor`; `has_more` signals another page. Each row is a summary (status, instructions, environment, person, turn counts, key attribution, accrued credits, timestamps). The per-turn decision trace lives on the detail GET. # Submit Turn Source: https://docs.ishlabs.io/api/reference/sessions/submit-turn /api/openapi.public.json post /api/v1/sessions/{session_id}/turns Submit one observation + declared action set; get the person's choice. # Create Task Source: https://docs.ishlabs.io/api/reference/tasks/create-task /api/openapi.public.json post /api/v1/workspaces/{workspace_id}/tasks Register a task: a named intent a session can bind by id. Registering is optional. Do it when runs have to stay comparable across a boundary the session itself cannot draw, such as the same task across two environments or across a month of builds. A one-off task belongs inline on the session. Send an `Idempotency-Key` header to make retries safe: the same key with the same body replays the original task as a 200, and the same key with a different body is a 409. `get_or_create` is the older, coarser flag and still works. Note what it does NOT do: on a name match it returns the existing task untouched and ignores every other field you sent, so a request whose instructions have drifted succeeds while changing nothing. Prefer `Idempotency-Key` for retries and PATCH to reconcile content. # Delete Task Source: https://docs.ishlabs.io/api/reference/tasks/delete-task /api/openapi.public.json delete /api/v1/tasks/{task_id} Retire a task. It stops appearing in the list but stays readable by id, sessions bound to it keep resolving, and its name is freed for reuse. Idempotent. Refused with a 409 while a published listing references it. # Get Task Source: https://docs.ishlabs.io/api/reference/tasks/get-task /api/openapi.public.json get /api/v1/tasks/{task_id} Fetch one task by id (archived rows stay readable). # List Tasks Source: https://docs.ishlabs.io/api/reference/tasks/list-tasks /api/openapi.public.json get /api/v1/workspaces/{workspace_id}/tasks List the workspace's registered tasks, oldest first. # Update Task Source: https://docs.ishlabs.io/api/reference/tasks/update-task /api/openapi.public.json patch /api/v1/tasks/{task_id} Partially update a task. Any applied write bumps `revision`. Sessions already opened against the old content are untouched: their instructions and revision are frozen on the session. # Versioning and deprecation Source: https://docs.ishlabs.io/api/versioning How the API is versioned, what counts as a breaking change, what can change without one, and how a deprecation would be announced. This page is the compatibility contract: what the version in the path promises, what may change underneath it, and what your client has to tolerate. The [changelog](/api/changelog) is the record of what actually changed. ## The version is in the path Every endpoint is versioned in the URL path: ``` https://api.ishlabs.io/api/v1/... ``` There is no version header and no date-pinned version. The path is the only version selector. A new major version would appear as a new path prefix (`/api/v2`), served alongside `/api/v1` for as long as the deprecation window below runs. ## What counts as a breaking change A breaking change is one that can make a correct client stop working. These only land in a new major version: * Removing or renaming a field, a parameter, an endpoint, or an error `error_kind`. * Changing a field's type, or making an optional request field required. * Changing the meaning of an existing value. * Removing an enum value that the API previously emitted. * Changing an HTTP method or path for an existing operation. ## What can change inside a version Additive changes land on the current version at any time, without notice. Your client must tolerate all of them: * New fields on a response body. * New optional request fields and new optional query parameters. * New values in an open union, including new `sentiment` values, new `session_status` values, new `resolution` values, new observation block `type` values, new `environment` kinds, and new `error_kind` values on an error. * New endpoints, and new operations on an existing resource. * New response headers. Two rules follow, and both are on your side of the wire: 1. **Ignore fields you do not recognize.** Never fail parsing because a response carried something new. Decode into a permissive shape rather than a closed struct that rejects unknown keys. 2. **Tolerate values you do not recognize.** Treat an unknown enum value as an unhandled case with a sane default, not as an error. A client that hard-codes today's seven session statuses breaks the day an eighth ships; one that treats any status other than `open` as terminal does not. The field descriptions in the [API reference](/api/reference/introduction) name every field that is an open union. ## While v1 is pre-release `/api/v1` is not frozen yet. The API is in developer preview, and breaking revisions still land on `/api/v1` rather than opening a `/api/v2`, because there is no public installed base to protect. The revision of 2026-07-28 is one: it renamed a request field and moved an endpoint. Every such revision is announced as an entry in the [changelog](/api/changelog), with the exact wire diff and what to change in your client. Read it before you upgrade. If you are integrating now, pin the changelog and check it before each deploy. Once v1 is declared stable, the rules above hold without the exception: breaking changes go to `/api/v2`, and `/api/v1` keeps working. ## Deprecation, when it applies No endpoint is deprecated today. When one is, it is announced three ways at once: * A `Deprecation` header on every response from the deprecated operation, carrying the date the deprecation was announced. * A `Sunset` header carrying the date the operation stops being served, as an HTTP date. * A `Link` header with `rel="deprecation"` pointing at the migration guide for that change. ```http theme={null} Deprecation: Wed, 12 Aug 2026 00:00:00 GMT Sunset: Wed, 11 Nov 2026 00:00:00 GMT Link: ; rel="deprecation" ``` A deprecated operation keeps working, unchanged, until its `Sunset` date. Log these headers rather than only reading release notes: they arrive in the responses your integration is already making, which is the one channel that cannot be missed. ## Related > [card] [Changelog](/api/changelog) > > Every wire change, newest first, with what to change in your client. > [card] [API reference](/api/reference/introduction) > > The operations, the response conventions, and which fields are open unions. # Aliases Source: https://docs.ishlabs.io/cli/aliases Short id aliases the ish CLI mints for every entity, the canonical prefix table, and how they resolve. The CLI mints a short alias for every entity it prints (`w-6ec`, `s-b2c`, `pt-a3f`). An alias is accepted anywhere a full UUID is expected, so you can copy one from any command's output and paste it into the next command. Resolution maps the alias back to the UUID before the request is sent. See [global flags](/cli/global-flags) for how `--workspace` and the other id-bearing flags accept aliases. ## Format An alias is a type prefix, a hyphen, and the first three hex characters of the entity's UUID with dashes removed. ``` w-6ec # workspace 6ecf2857-1d7a-4f9c-85da-c2ac6c5c5346 s-b2c # study b2c1f0a9-... pt-a3f # participant a3f... ``` Aliases are deterministic: the same UUID always produces the same alias, across commands and terminals. On a collision (two UUIDs sharing the same three-character prefix) the CLI extends the second alias by one hex character at a time until it is unique, so a few aliases run longer than three characters. ## Prefix table | Entity | Prefix | Example | Concept | | - | - | - | - | | Workspace | `w-` | `w-6ec` | [workspace](/concepts/workspace) | | Study | `s-` | `s-b2c` | [study](/concepts/study) | | Iteration | `i-` | `i-d4e` | [study](/concepts/study) | | Person | `p-` | `p-795` | [people](/concepts/people) | | Person source | `ps-` | `ps-1a2` | [people](/concepts/people) | | Participant | `pt-` | `pt-a3f` | [people](/concepts/people) | | Simulation config | `c-` | `c-0b4` | | | Job | `j-` | `j-c17` | | | Ask | `a-` | `a-6ec` | [run vs ask](/concepts/run-vs-ask) | | Ask round | `r-` | `r-2bd` | [run vs ask](/concepts/run-vs-ask) | | Chat endpoint | `ep-` | `ep-9f0` | | | Chat config | `cc-` | `cc-5e1` | | | Frame | `f-` | `f-7a8` | [frames](/concepts/frames) | > [!NOTE] > > `p-` is the Person (the persistent record). `pt-` is the participant (one run-scoped instance of a > person inside an iteration). They are different entities. See > [people](/concepts/people). ## Resolution order Every id-bearing argument runs through one resolver. It accepts two shapes: **1. Full UUID** A well-formed UUID passes through unchanged. **2. Known alias** An alias is looked up in `aliases.json` and replaced with its UUID. Anything else is a usage error. An alias whose prefix is recognized but whose entry is not in the store exits 4 (`not_found`) with the list command that would mint it, for example `ish workspace list` for a `w-` alias. A string that is neither a UUID nor a known alias shape exits 4 with guidance to run a list command first. See [exit codes](/cli/global-flags#exit-codes). ## Where aliases are stored Aliases persist to `aliases.json` under the config root, so they survive across commands and terminal sessions. The root is `~/.ish` by default and is overridable with the `ISH_HOME` environment variable. A fresh install, a deleted `aliases.json`, or a new `ISH_HOME` starts with an empty store. When that happens, run the entity's list command to repopulate it. ```bash theme={null} ish workspace list # mints w- aliases ish study list # mints s- aliases ish iteration list --study s-b2c # mints i- aliases ``` ## Working with aliases Read an alias straight out of one command and pass it to the next. ```bash theme={null} ish workspace list # prints w- aliases ish study list --workspace w-6ec # use one ish study run s-b2c # study run takes a positional alias ish study results s-b2c --participant pt-a3f ``` To pull a specific alias out of JSON output, target the field with `--get`. ```bash theme={null} ish study list --workspace w-6ec --get items.0.alias ``` > [!TIP] > > Aliases are for convenience at the terminal. In scripts that must survive a wiped > config or a different `ISH_HOME`, capture the full UUID with `--get id --verbose` and > pass that instead. For the full output contract, including how aliases appear in JSON and table modes, see [reactions and results](/concepts/reactions-and-results). # Authentication Source: https://docs.ishlabs.io/cli/auth How the ish CLI resolves a token, where credentials are stored, and the login, logout, and status commands. The CLI authenticates every API call with a bearer token. It resolves that token from one of five sources, in a fixed order, and persists browser-login credentials to a config file under `~/.ish`. ## Token resolution order Every command resolves a token before it calls the API. The first source that produces a token wins. | # | Source | How it is supplied | | - | - | - | | 1 | `--token ` | Global flag on any command. | | 2 | `--token-file ` | Global flag. The file is read and trimmed; an empty file is an error. Prefer this over `--token` so the token is not visible in shell history or the process list. | | 3 | `ISH_TOKEN` | Environment variable. | | 4 | Saved OAuth session | `access_token` plus `refresh_token` in `~/.ish/config.json`, written by `ish login`. A stale access token is refreshed automatically (see [token refresh](#token-refresh)). | | 5 | Legacy token | A single `token` value in `~/.ish/config.json`, pasted by hand on older setups. No refresh. | If none produce a token, the command fails with: ``` No auth token found. Run "ish login", set ISH_TOKEN, or pass --token / --token-file . ``` > [!NOTE] > > `--token` and `--token-file` are global flags, documented with the other globals on every generated command page. See [`ish session`](/cli/generated/session) and any command's global-flags table. ## Token refresh The saved OAuth session (source 4) holds an `access_token`, a `refresh_token`, and the `oauth_client_id` minted at login. When a command runs and the access token is expired or within five minutes of expiry, the CLI refreshes it against Supabase, saves the rotated pair back to `~/.ish/config.json`, and continues. The refresh token rotates on each use, so a session persists with regular use without a re-login. Refresh outcomes: * **Success.** The command proceeds with the new access token. * **Network failure during refresh.** The command fails with `Could not refresh session (network error). Check your connection or run "ish login".` Tokens are left intact. * **Permanent failure** (Supabase 4xx, such as `refresh_token_not_found` or `invalid_grant`). The dead `access_token`, `refresh_token`, and legacy `token` fields are cleared from the config so the next run does not retry the doomed refresh. The command fails with `Session expired. Run "ish login" to re-authenticate.` Add `--verbose` to append the raw Supabase response. A resolved token (sources 4 and 5) is verified against the API before use. If the API rejects it, the command fails with `Saved token is invalid. Run "ish login" to re-authenticate.` A dev or prod environment mismatch (a token minted by one Supabase project but presented to the other API) appends a hint explaining which side to change. > [!NOTE] > > Auth failures exit with code `3` and carry `error_code: "auth_failed"` in JSON output. Branch on either to re-prompt for login. A billing or quota wall arrives as HTTP 403 but exits `1`, not `3`, so a login retry loop never triggers on a credit cap. ## Commands ### `ish login` Open the browser, sign in, and save the resulting OAuth session to `~/.ish/config.json`. ```bash theme={null} ish login ``` `login` always runs the full browser flow and re-authenticates. There is no "already logged in" short-circuit; that check is `ish status`. A routine token refresh does not go through `login`. Each login mints a fresh OAuth client. ### `ish logout` Remove saved credentials and clear the active context. ```bash theme={null} ish logout ``` `logout` deletes `access_token`, `refresh_token`, the legacy `token`, and `oauth_client_id`, and it also clears the active [workspace](/concepts/workspace), [study](/concepts/study), ask, and chat-endpoint selections. Those selections are identity-scoped, so they are meaningless to the next account that signs in. ### `ish status` Show the active session: signed-in user, active workspace, study, ask, chat endpoint, installed skill, config home, and API URL. Aliased as `ish whoami`. ```bash theme={null} ish status ``` `status` is the first command to run when starting cold. It does not error when no token is present: it returns `user: null` with a hint instead of exiting, so it is safe to run pre-login. JSON output is safe to pipe. For the full command list and flags, see the generated reference: [`ish session`](/cli/generated/session). ## Config file Saved credentials and the active context live in a single JSON file. * **Path.** `~/.ish/config.json`. * **Permissions.** The CLI creates the `~/.ish` directory with mode `0700` and writes the config file with mode `0600`. Writes are atomic (temp file plus rename). * **A corrupted file is ignored.** The CLI treats an unparsable config as empty rather than failing. Fields the CLI reads and writes: **access\_token** `string` OAuth access token from the last `ish login`. Auto-refreshed when stale. **refresh\_token** `string` OAuth refresh token. Rotates on each refresh. **oauth\_client\_id** `string` OAuth client id minted at login. Required to refresh the OAuth session. **token** `string` Legacy single token pasted by hand. No refresh. Absent on OAuth setups. **workspace** `string` Active [workspace](/concepts/workspace) id, set by `ish workspace use`. **study** `string` Active [study](/concepts/study) id, set by `ish study use`. **ask** `string` Active ask id. **chat\_endpoint** `string` Active chatbot endpoint id, set by `ish chat endpoint use`. ## ISH\_HOME By default the CLI stores everything under `~/.ish`. Set `ISH_HOME` to relocate that root, the same way `gh` uses `GH_CONFIG_DIR` and `aws` uses `AWS_CONFIG_FILE`. When `ISH_HOME` is set, `config.json`, `aliases.json`, the downloaded binary, browsers, and simulation artifacts all live under it. ```bash theme={null} ISH_HOME=/path/to/state ish status ``` `ish status` prints the resolved home directory in its `home` field, so you can confirm which root is in effect. ## Environment variables **ISH\_TOKEN** `string` Auth token (token-resolution source 3). Overridden by `--token` and `--token-file`. **ISH\_HOME** `string` Override the `~/.ish` state root for config, aliases, and cached binaries. **ISH\_API\_URL** `string` Override the backend API base. Default `https://api.ishlabs.io`. **ISH\_APP\_URL** `string` Override the web app URL used in the browser login flow. Default `https://app.ishlabs.io`. **ISH\_SUPABASE\_URL** `string` Override the Supabase project URL used for login and token refresh. Set with `ISH_SUPABASE_ANON_KEY`. **ISH\_SUPABASE\_ANON\_KEY** `string` Override the Supabase publishable key paired with `ISH_SUPABASE_URL`. > [!NOTE] > > `NO_COLOR` is also honored: set it (or pass `--no-color`) to disable colored output. # Confirmations and caps Source: https://docs.ishlabs.io/cli/confirmations How the CLI gates credit-spending and destructive commands, the -y / ISH_ASSUME_YES opt-in, and the 20-participant dispatch cap. Two safety gates sit in front of certain `ish` commands: a confirmation gate (for credit-spending and destructive verbs) and a hard cap on how many participants one dispatch can carry. Both are client-side. This page is the complete reference for both. The gate logic lives in `confirmDestructive` and `assumeYes` (`ish-cli/src/lib/command-helpers.ts`); the cap is `PARTICIPANT_BATCH_CAP`. ## The confirmation gate A gated command asks for confirmation before it acts. There are two classes. | Class | What it protects | TTY prompt default | Example commands | | - | - | - | - | | `billable` | A credit draw (a dispatch) | `[Y/n]` (Enter proceeds) | `study run`, `study analyze`, `ask run` | | `destructive` | Data loss (a delete or revoke) | `[y/N]` (Enter aborts) | `study delete`, `person delete`, `study unshare` | Behavior depends on whether stdout is an interactive terminal. * **Interactive TTY.** The command prints a prompt and waits. Billable verbs also print a one-line credit estimate and a pointer to the credits reference above the prompt; they default to yes, because you already typed the billable command. Destructive verbs default to no. * **`--json` or any non-TTY** (piped stdout, CI, an agent). The command refuses rather than prompt or proceed silently. It exits 2 with a `ConfirmationRequired` error and a copy-pasteable `example` field showing the same command with `--yes` appended. See [Refusal in non-interactive contexts](#refusal-in-non-interactive-contexts). Credits draw from your usage allowance, not a per-call bill. The gate exists for human review, not to discourage spending. See [credits and limits](/concepts/credits-and-limits) for the cost model and [run vs ask](/concepts/run-vs-ask) for what each verb dispatches. ## Confirming a gated command Pass `-y` (or `--yes`) to skip the prompt. Both flags are identical. ```bash theme={null} ish study run --sample 5 --country SE -y ish study delete s-b2c --yes ish study delete s-b2c --json --yes # JSON consumers must be explicit ``` To opt in once for a whole session instead of repeating `-y`, set the `ISH_ASSUME_YES` environment variable. It mirrors `-y` exactly and applies to both billable and destructive gates. ```bash theme={null} export ISH_ASSUME_YES=1 ish study run --sample 5 # no -y needed ish ask run --new --sample 3 # still no -y needed ``` **-y, --yes** `flag` Skip the confirmation prompt for this one command. Required in `--json` or any non-TTY context for a gated command to proceed. **ISH\_ASSUME\_YES** `env` Truthy value (`1`, `true`, `yes`, or `on`, case-insensitive) pre-authorizes every gated command for the session. Mirrors `-y`. Session-scoped and never written to config, so it cannot silently pre-authorize a future run. > [!NOTE] > > `ISH_ASSUME_YES` is read from the environment on every command and is never > persisted. Unset it (or open a new shell) to restore the gate. ## Gated commands ### Billable (credit-spend) These dispatch simulations and draw credits, so each one is gated as `billable`. | Command | Gate prompt | | - | - | | [`study run`](/cli/generated/study-run) | Dispatch simulations (draws credits)? | | [`study analyze`](/cli/generated/study-extras) | Trigger analysis? The first analysis per study is free; each subsequent run draws 10 credits. | | [`ask run`](/cli/generated/ask) | Create and dispatch a new ask round? | | [`ask create`](/cli/generated/ask) (dispatching) | Create and dispatch this ask? | | [`ask dispatch`](/cli/generated/ask) | Dispatch this draft ask? | | [`ask add-round`](/cli/generated/ask) | Append and dispatch a new ask round? | | [`ask add-questions`](/cli/generated/ask) | Add questions and re-dispatch this round? | | [`ask retry`](/cli/generated/ask) | Re-dispatch the errored responses on this round? | > [!NOTE] > > `ish ask create --no-dispatch` is the one exempt billable path. It creates the ask > in draft and dispatches nothing, so it draws no credits and needs no confirmation. > Start the draft later with `ish ask dispatch `, which is gated. ### Destructive These delete or revoke and cannot be undone, so each is gated as `destructive`. | Command | What it removes | | - | - | | [`workspace delete`](/cli/generated/workspace) | A workspace | | [`study delete`](/cli/generated/study) | A study | | [`iteration delete`](/cli/generated/iteration) | An iteration | | [`person delete`](/cli/generated/person) | A person | | [`source delete`](/cli/generated/source) | A person source | | [`ask delete`](/cli/generated/ask) | An ask | | [`secret delete`](/cli/generated/secret) | A workspace secret | | [`chat endpoint delete`](/cli/generated/chat) | A chat endpoint | | [`chat config delete`](/cli/generated/chat) | A chat configuration | | [`config delete`](/cli/generated/config) | A saved config | | [`study unshare`](/cli/generated/study-extras) | A public share link (the URL stops working) | | [`mcp add`](/cli/generated/mcp) / [`mcp remove`](/cli/generated/mcp) | Edits to client MCP config files | ## Refusal in non-interactive contexts When a gated command runs under `--json` or any non-TTY and you have not passed `-y` or set `ISH_ASSUME_YES`, the CLI refuses. This is the agent and CI default. It is a usage error, not a fault, so it exits 2 with no "report a bug" nudge. See [exit codes](/cli/exit-codes) for the full table. | Field | Value | | - | - | | Exit code | `2` | | `error_code` | `validation_error` | | `error_kind` | `ConfirmationRequired` | | `example` | The same command with `--yes` appended (any `--token` / `--token-file` value redacted) | The refusal message differs by class. Billable verbs reframe around spending and point at `ISH_ASSUME_YES`; destructive verbs keep firmer fail-closed wording. ```json theme={null} { "error_code": "validation_error", "error_kind": "ConfirmationRequired", "example": "ish study run --sample 5 --country SE --yes" } ``` > [!TIP] > > An agent that hits this can read `example` and re-run it verbatim, or set > `ISH_ASSUME_YES=1` once at the start of the session to pre-authorize every gated > command. ## The 20-participant dispatch cap The backend caps each dispatch at **20 participants**. The CLI enforces this client-side so an over-cap selection fails with a clear message instead of an opaque backend `validation_error` after a wasted round-trip. `PARTICIPANT_BATCH_CAP` is `20`. It applies to the person-selection flags shared by [`study run`](/cli/generated/study-run) and [`ask`](/cli/generated/ask) commands. See [people](/concepts/people) for how selection works and what each flag matches. The cap fires in two places. * **`--sample N` over the cap.** Caught before any API call, since the value alone is over the limit. ```text theme={null} --sample 25 exceeds the per-dispatch participant cap of 20. Pass --sample 20 or fewer, or split the run into multiple dispatches. ``` * **`--all` or filter flags resolving to more than 20.** Caught after the pool is fetched, when the match count exceeds the cap. `--all` is only safe when the matching pool is 20 or fewer. ```text theme={null} Resolved 200 participants (no filter) but the backend caps each dispatch at 20. Pass `--sample 20` to randomly subsample the pool, narrow your filters, or run the dispatch multiple times against different slices. ``` Both refusals are usage errors and exit 2. To run a cohort larger than 20, split it into slices and dispatch each slice separately. `--sample 20` randomly subsamples a larger matching pool; narrower filters select a different slice each time. > [!NOTE] > > Explicit `--person ` selection is also subject to the backend cap. Passing > more than 20 IDs reaches the backend and returns its `validation_error`. Keep > explicit selections to 20 or fewer per dispatch. ## The MCP server The MCP server has no `-y` equivalent. Confirming a credit draw is the calling agent's job, not ish's: a dispatch tool runs when called. The advice in the server instructions is to check pool headroom with [`workspace_get`](/mcp/generated/tools-workspace) (`.credits`) before a large run, rather than gate each dispatch behind a prompt. See [tool conventions](/mcp/tool-conventions). The 20-participant cap is a backend constraint, so it applies to MCP dispatches too. The MCP [study tools](/mcp/generated/tools-study) and [ask tools](/mcp/generated/tools-ask) surface an over-cap selection as a backend validation error. # Environment variables Source: https://docs.ishlabs.io/cli/env-vars Every ISH_* environment variable the ish CLI reads, with defaults and precedence. The ish CLI reads configuration from environment variables. Every one is optional: unset, the CLI uses the default in each table. Most have an equivalent flag that takes precedence when both are set. > [!NOTE] > > Flags beat environment variables beat saved config. For the full token resolution order and the global flags themselves, see [auth](/cli/auth) and [global flags](/cli/global-flags). ## Auth **ISH\_TOKEN** `string` Auth token presented as `Authorization: Bearer`. Sits third in the resolution order: `--token` > `--token-file` > `ISH_TOKEN` > saved OAuth login (`~/.ish/config.json`) > legacy saved token. Use it for CI and other non-interactive runs. **ISH\_ASSUME\_YES** `string` Pre-authorize the confirmation gate for the whole session. Mirrors `--yes` exactly and applies to billable verbs (`study run`, `study analyze`, `ask run`, and the like) and destructive deletes. Truthy values: `1`, `true`, `yes`, `on`. Never persisted to config. Default: unset (gate active). ## Active context When a command needs a workspace, study, ask, or chat endpoint and you do not pass it, the CLI falls back to these env vars, then to the active context saved by `ish use`. The explicit flag or positional argument always wins. Each accepts an id or an alias (for example `w-`, `s-`). **ISH\_WORKSPACE** `string` Default [workspace](/concepts/workspace). Overridden by `--workspace` and by the saved active workspace order described above. See [study](/concepts/study) and [run vs ask](/concepts/run-vs-ask) for how context flows through commands. **ISH\_STUDY** `string` Default [study](/concepts/study). Overridden by `--study`. **ISH\_ASK** `string` Default ask. Overridden by the positional ask id. **ISH\_CHAT\_ENDPOINT** `string` Default chat endpoint id. Overridden by the positional id or `--endpoint`. ## Endpoints **ISH\_API\_URL** `string` (default: [https://api.ishlabs.io](https://api.ishlabs.io)) Backend API base URL. The internal `--api-url` flag takes precedence; `--dev` forces `http://localhost:8000` and overrides both. **ISH\_APP\_URL** `string` (default: [https://app.ishlabs.io](https://app.ishlabs.io)) Web app base URL used to compose the links the CLI prints (for example the `url` returned by `ish study run`). Set it for a staging or self-hosted UI. Under `--dev` the base is `http://localhost:3000`. ## Paths **ISH\_HOME** `string` (default: \~/.ish) Config directory root. Holds `config.json` (saved login, active context), `aliases.json`, downloaded binaries, and logs. Set it to relocate ish state, mirroring `GH_CONFIG_DIR` / `AWS_CONFIG_FILE`. ## Dev login overrides These point `ish login` at a non-production Supabase project. Set both together. Equivalent to `--dev`, which targets the built-in dev project. **ISH\_SUPABASE\_URL** `string` Supabase project URL used to mint the login session. Default: the production project. **ISH\_SUPABASE\_ANON\_KEY** `string` Supabase publishable (anon) key matching `ISH_SUPABASE_URL`. ## Output and observability **NO\_COLOR** `string` Disable colored output. Equivalent to `--no-color`. Honors the [NO\_COLOR convention](https://no-color.org). **FORCE\_COLOR** `string` Force colored output even when stdout is not a TTY. `0` or `false` disables; any other non-empty value enables. NO\_COLOR wins when both are set. **ISH\_CLI\_SENTRY\_DSN** `string` Opt in to Sentry error and trace reporting by setting a DSN. Unset, the CLI runs untraced. Default: unset. **ISH\_DEBUG\_OBS** `string` Print observability init failures to stderr. Diagnostic only. Default: unset (silent). ## Installer Read by the `install.sh` and `install.ps1` scripts, not by the `ish` binary itself. **ISH\_INSTALL\_DIR** `string` Install directory for the `ish` binary. Default: `$HOME/.ish/bin` (`%USERPROFILE%\.ish\bin` on Windows). **ISH\_VERSION** `string` PowerShell `install.ps1` only. Pin a specific version to install. Default: the latest release. On POSIX `install.sh`, pin a version with the `--version=` argument instead, for example `curl -fsSL https://ishlabs.io/install.sh | sh -s -- --version=1.2.3`. **ISH\_NO\_PATH** `string` Set to `1` (POSIX `install.sh` only) to skip editing your shell rc file. Use for ephemeral or sandbox installs. ## Internal Reserved for ish development and internal tooling. Not part of the supported surface; documented so you can recognize them. **ISH\_MCP\_URL** `string` (default: [https://mcp.ishlabs.io/mcp](https://mcp.ishlabs.io/mcp)) ish MCP server URL written by `ish mcp add`. Defaults to the hosted server; an internal override for pointing the CLI at a local or preview MCP server during ish development. **ISH\_INTERNAL** `string` Set to `1` to allow the internal-only `--sim-config` flag on `ish study run`. **ISH\_ADB** `string` Override the `adb` binary path for native Android local simulation. Also honors `ADB`. **ISH\_EMULATOR** `string` Override the Android `emulator` binary path. **ISH\_WDA\_PATH** `string` Override the iOS WebDriverAgent runner bundle path. **ISH\_WDA\_PORT** `string` (default: 8100) WebDriverAgent port for native iOS local simulation. # Exit codes and errors Source: https://docs.ishlabs.io/cli/exit-codes The ish CLI exit codes 0 to 5 and the structured error envelope agents and CI branch on. Every `ish` command exits with a semantic code. Branch on the code in CI and agent loops, and parse the JSON envelope (in `--json` mode) for the structured cause. The code answers "what class of failure", the envelope answers "what exactly, and what to do next". ## Exit codes | Code | Meaning | | - | - | | 0 | Success. | | 1 | General error (including billing 403: out of credits or usage limit). | | 2 | Usage or validation error (bad flags, missing arguments). | | 3 | Authentication failure (no or invalid token). | | 4 | Not found (the workspace, study, or other entity does not exist). | | 5 | Transient error, safe to retry. | In `--json` mode, errors carry a structured envelope: `error`, `error_code`, `retryable`, and often `suggestions`, `error_kind`, and an `example` invocation that fixes the call. The map is computed by `exitCodeFromError` in `command-helpers.ts`. A successful command exits 0; `-h, --help` and `-V, --version` also exit 0. ### How a failure resolves to a code The resolver checks the most specific signal first, so a tagged error always beats a status guess and a status guess always beats a message-regex sniff. **1. Billing walls (exit 1)** A `usage_limit_reached` or `insufficient_credits` error is checked before the status map. These arrive as HTTP 403 but are not auth failures, so they exit 1, not 3. An agent branching "exit 3 means re-login" would otherwise loop forever on a quota cap. **2. HTTP status (exit 3, 4, 2, 5)** For other API errors: 401 and 403 exit 3, 404 exits 4, 400 and 422 exit 2. A retryable status (408, 429, or any 5xx) exits 5. **3. Tagged error code (exit 2, 3, 4)** A CLI-thrown error carrying `error_code` is mapped directly: `usage_error` exits 2, `auth_failed` exits 3, `not_found` exits 4. **4. Retryability and error kind (exit 5, 2)** `wait_timeout` and any error pre-declaring `retryable: true` exit 5. A `TunnelInactive` or `BotAuthError` kind exits 5 (the cause is fixable, then retry); `ConfirmationRequired` or `BotShapeError` exit 2. **5. Network cause (exit 5)** DNS and connection failures (`ENOTFOUND`, `ECONNREFUSED`, `ECONNRESET`, `ETIMEDOUT`, `EAI_AGAIN`) are transient and exit 5. **6. Fallback (exit 1)** Anything unclassified exits 1. > [!WARNING] > > Out of credits exits 1, not 3. A 402 or a billing 403 is a quota cap, not an auth problem. > Re-running `ish login` will not fix it. Read `error_code` to tell `insufficient_credits` and > `usage_limit_reached` apart from a real auth failure. ## The error envelope In `--json` mode (or when stdout is piped, which auto-selects JSON), a failing command writes a single-line JSON object to **stderr** and the exit code to the process. Human mode prints `Error: ` followed by indented `→` suggestion lines instead. See [global flags](/cli/global-flags) for when JSON is auto-selected. ### Always present **error** `string` The human-readable message. For API errors, server-internal entity names are remapped to the user-facing vocabulary before printing. **error\_code** `string` The stable machine code to branch on. Prefer this over the message text, which can change. See the [error codes](#error-codes) table. **retryable** `boolean` Whether the same call may succeed if retried unchanged. `true` corresponds to exit 5. ### Often present These fields appear only when the failure carries them, so a consumer must treat each as optional. **status** `number` The HTTP status, present only on errors that came back from the API. **suggestions** `string[]` Recovery hints, for example "pass `--study` or run `ish study use`". Merged from the server response, the error instance, and the CLI's own code-to-hint mapping. **errors** `array` Field-level validation detail from a 422 response. Each entry carries `loc`, `msg`, `type`, and, where the field is an enum, `allowed_values`. **error\_kind** `string` A structured kind for failures that have one, such as `TunnelInactive`, `ConfirmationRequired`, `BotAuthError`, or `BotShapeError`. **example** `string` A corrected invocation that fixes the call, for example the same command with `--yes` appended when a destructive action needs confirmation in `--json` mode. **hint** `string` A one-line hint on a client-side validation error. **valid\_options** `string[]` The accepted values when a validation error rejected an enum-shaped input. **available\_values** `string[]` The set a filter argument could have matched (for example the frames a `--frame` value could resolve to). **progress** `object` How far a wait got before it timed out, on a `wait_timeout` error. **seeded\_but\_not\_dispatched\_ids** `string[]` Participants seeded before a dispatch failed. Resume with these rather than re-seeding, which would create duplicates. A matching `seeded_but_not_dispatched_aliases` rides alongside. **report** `string` A hint to report the failure, present only on genuine faults (not on usage errors). ### Billing fields On a `usage_limit_reached` error, the envelope also carries `tier`, `limit`, `current`, `max`, and `upgrade_url`. See [run vs ask](/concepts/run-vs-ask) for what draws credits. ## Error codes The `error_code` field is the stable contract. API errors map from the HTTP status; CLI-thrown errors set the code directly. | `error_code` | Source | Typical exit | | - | - | - | | `auth_failed` | API 401 | 3 | | `forbidden` | API 403 | 3 | | `insufficient_credits` | API 402, billing 403 | 1 | | `usage_limit_reached` | billing 403 | 1 | | `not_found` | API 404, CLI `not_found` | 4 | | `validation_error` | API 422, CLI validation | 2 | | `usage_error` | CLI usage | 2 | | `timeout` | API 408 | 5 | | `rate_limited` | API 429 | 5 | | `server_error` | API 5xx | 5 | | `network_error` | DNS / connection failure | 5 | | `wait_timeout` | `ish study run` wait timer | 5 | | `request_failed` | other API error | 1 | | `client_error` | untagged CLI error | 1 | | `unknown_error` | non-`Error` throw | 1 | ## Example A study id that does not exist returns exit 4 with this envelope on stderr: ```json theme={null} { "error": "Study not found: s-xxxx", "error_code": "not_found", "status": 404, "retryable": false } ``` Branch on the code in a script: ```bash theme={null} ish study results --study s-xxxx --json case $? in 0) echo "ok" ;; 3) echo "re-authenticate" ;; # auth_failed / forbidden 4) echo "wrong id, do not retry" ;; # not_found 5) echo "transient, retry" ;; # timeout / rate_limited / network *) echo "failed" ;; esac ``` > [!TIP] > > Branch on the exit code for control flow and read `error_code` for the precise cause. Both are > stable; the `error` message text is not. # ask Source: https://docs.ishlabs.io/cli/generated/ask Command reference: ish ask. ## `ish ask run` Run an ask - append a round to the active ask, or `--new` to create a fresh ask Usage: `ish ask run [id] [options]` ### Arguments **id** Ask alias or UUID to append to (defaults to active ask; ignored with --new) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--new** `boolean` Create a new ask instead of appending a round **--name \** `string` Ask name (with --new; auto-generated if omitted) **--description \** `string` Ask description (with --new only) **--workspace \** `string` Workspace ID (with --new only) **--prompt \** `string` Round prompt - what participants respond to Required. **--variant \** `string` Variant: text:"...", ./file.png, image:./file.png, ./file.png::label=B (repeatable) Default: \[]. **--variants \** `string` JSON manifest of variants (alternative to --variant) **--wants-pick** `boolean` Each participant picks a favourite variant (compatible with --wants-ratings; can be set together). **--wants-ratings** `boolean` Each participant rates every variant 1-5 (compatible with --wants-pick; can be set together). If neither is set, participants leave a free-form comment only. \*\*--questions \\\\*\* \`string\` Questions as inline JSON, @file, or a JSON file path: \[\{"question":"...","type":"text"|"slider"|"likert"|"single-choice"|"multiple-choice"|"number"}] **--language \** `string` 2-letter language code (with --new only) Default: "en". **--person \** `string` Person IDs/aliases (comma-separated or repeatable) Default: \[]. **--sample \** `string` Randomly sample N people from the matching pool (max 20 per dispatch - split into multiple slices for larger cohorts) **--all-simulatable** `boolean` Use every simulatable AI person matching the filters (with --new only) (capped at 20 per dispatch - split into multiple slices for larger cohorts) **--search \** `string` Substring match against person name **--bio \** `string` Substring match against person bio **--occupation \** `string` Substring match against person occupation (repeatable) Default: \[]. **--gender \** `string` Filter by gender (female, male, nonbinary; repeatable, OR semantics) Default: \[]. **--country \** `string` Filter by 2-letter country code (repeatable) Default: \[]. **--min-age \** `string` Minimum age (inclusive) **--max-age \** `string` Maximum age (inclusive) **--visibility \** `string` Filter by visibility: workspace (your workspace), shared (community-published), platform (admin-curated). Old values `private` / `public` are accepted and mapped to `workspace` / `platform`. **--subset-round \** `string` Drill-in subset (Pattern B) - append-round only. 1-indexed prior round to filter against. Pair with --subset-variant. **--subset-variant \** `string` Drill-in subset (Pattern B) - append-round only. Variant id (UUID) on the prior round whose pickers should inherit. Read from `aggregates.pick_buckets` or `variants[*].id` on the prior round's `ask results --json`. **--wait** `boolean` Wait until the round completes (or errors) **--timeout \** `string` Wait timeout in seconds (default 300) **-y, --yes** `boolean` Skip the credit-spend confirmation (required in --json / non-TTY to proceed) ## `ish ask list` List asks for a workspace Usage: `ish ask list [options]` ### Options **--workspace \** `string` Workspace ID **--archived** `boolean` Include archived asks alongside active ones (default: active only). ## `ish ask create` Create a new ask with a first round and dispatch to people Usage: `ish ask create [options]` ### Options **--workspace \** `string` Workspace ID **--name \** `string` Ask name Required. **--description \** `string` Ask description **--prompt \** `string` Round prompt - what participants respond to Required. **--variant \** `string` Variant: text:"...", ./file.png, image:./file.png, ./file.png::label=B (repeatable) Default: \[]. **--variants \** `string` JSON manifest of variants (alternative to --variant) **--wants-pick** `boolean` Each participant picks a favourite variant (compatible with --wants-ratings; can be set together). **--wants-ratings** `boolean` Each participant rates every variant 1-5 (compatible with --wants-pick; can be set together). If neither is set, participants leave a free-form comment only. \*\*--questions \\\\*\* \`string\` Questions as inline JSON, @file, or a JSON file path: \[\{"question":"...","type":"text"|"slider"|"likert"|"single-choice"|"multiple-choice"|"number"}] **--language \** `string` 2-letter language code Default: "en". **--person \** `string` Person IDs/aliases (comma-separated or repeatable) Default: \[]. **--sample \** `string` Randomly sample N people from the matching pool (max 20 per dispatch - split into multiple slices for larger cohorts) **--all-simulatable** `boolean` Use every simulatable AI person matching the filters (capped at 20 per dispatch - split into multiple slices for larger cohorts) **--search \** `string` Substring match against person name **--bio \** `string` Substring match against person bio **--occupation \** `string` Substring match against person occupation (repeatable) Default: \[]. **--gender \** `string` Filter by gender (female, male, nonbinary; repeatable, OR semantics) Default: \[]. **--country \** `string` Filter by 2-letter country code (repeatable) Default: \[]. **--min-age \** `string` Minimum age (inclusive) **--max-age \** `string` Maximum age (inclusive) **--visibility \** `string` Filter by visibility: workspace (your workspace), shared (community-published), platform (admin-curated). Old values `private` / `public` are accepted and mapped to `workspace` / `platform`. **--no-dispatch** `boolean` Create the ask in DRAFT status without billing or dispatching the round. Hand the draft id back to the user, then start it with `ish ask dispatch <id>`. People flags are still required because the participants are materialized at create time. Mutually exclusive with --wait (nothing to wait for). **--wait** `boolean` Wait until the first round completes (or errors) **--timeout \** `string` Wait timeout in seconds (default 300) **-y, --yes** `boolean` Skip the credit-spend confirmation (required in --json / non-TTY to proceed) ## `ish ask dispatch` Dispatch a draft ask - draws credits and starts the round Usage: `ish ask dispatch [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--wait** `boolean` Wait until the first round completes (or errors) **--timeout \** `string` Wait timeout in seconds (default 300) **-y, --yes** `boolean` Skip the credit-spend confirmation (required in --json / non-TTY to proceed) **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask get` Get full ask detail (accepts multiple IDs for batched lookup) Usage: `ish ask get [ids]... [options]` ### Arguments **ids** Ask alias(es)/UUID(s); defaults to active ask from `ish ask use` (optional, variadic) ### Options **--ask \** `string` Ask ID; alternative to a single positional argument **--round \** `string` Show only round N (1-indexed); single-ask only **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask results` Show aggregated results (picks, mean ratings, comments, summary) Usage: `ish ask results [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--round \** `string` Show only round N (1-indexed; default: all rounds) **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask wait` Poll until a round is completed (or errored) Usage: `ish ask wait [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--round \** `string` Round number to wait for (1-indexed; default: last round) **--timeout \** `string` Max seconds to wait (default 300) **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask add-round` Append a new round to an existing ask (max 5 per ask) Usage: `ish ask add-round [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--workspace \** `string` Workspace ID; accepted for consistency (workspace is inferred from the ask) **--prompt \** `string` Round prompt Required. **--variant \** `string` Variant flag (repeatable; same syntax as `ask create`) Default: \[]. **--variants \** `string` JSON manifest of variants **--wants-pick** `boolean` Each participant picks a favourite variant (compatible with --wants-ratings; can be set together). **--wants-ratings** `boolean` Each participant rates every variant 1-5 (compatible with --wants-pick; can be set together). If neither is set, participants leave a free-form comment only. \*\*--questions \\\\*\* \`string\` Questions as inline JSON, @file, or a JSON file path: \[\{"question":"...","type":"text"|"slider"|"likert"|"single-choice"|"multiple-choice"|"number"}] **--subset-round \** `string` Drill-in subset (Pattern B) - 1-indexed prior round to filter against. Pair with --subset-variant. The new round dispatches only to participants who picked --subset-variant on round N. **--subset-variant \** `string` Drill-in subset (Pattern B) - variant id (UUID) on the prior round whose pickers should inherit. Pair with --subset-round. Read from `aggregates.pick_buckets` or `variants[*].id` on the prior round. **--wait** `boolean` Wait until the new round completes **--timeout \** `string` Wait timeout in seconds (default 300) **-y, --yes** `boolean` Skip the credit-spend confirmation (required in --json / non-TTY to proceed) ## `ish ask add-questions` Append questionnaire questions to a round. Default: additive re-dispatch (prior picks/comments/ratings preserved; only the new questions are answered). Pass --redispatch-all to fully reset and re-run the round from scratch. Usage: `ish ask add-questions [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--round \** `string` Round number (1-indexed) or round id/alias Required. \*\*--questions \\\\*\* \`string\` Questions as inline JSON, @file, or a JSON file path: \[\{"question":"...","type":"text"|"slider"|"likert"|"single-choice"|"multiple-choice"|"number"}] Required. **--redispatch-all** `boolean` Clear prior phase-1 outputs (comment, pick, ratings) and re-run the entire round from scratch (legacy behavior); draws one credit per participant again. Default is additive - only the new questions are answered, and it draws nothing (a round carries at most 10 questions on the free path). **--wait** `boolean` Wait until the round completes (or errors) **--timeout \** `string` Wait timeout in seconds (default 300) **-y, --yes** `boolean` Skip the credit-spend confirmation (required in --json / non-TTY to proceed) **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask retry` Re-dispatch only the errored responses on a round (idempotent: zero-errored is a no-op). Usage: `ish ask retry [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--round \** `string` Round number (1-indexed) or round id/alias Required. **--wait** `boolean` Wait until the retried round completes (or errors) **--timeout \** `string` Wait timeout in seconds (default 300) **-y, --yes** `boolean` Skip the credit-spend confirmation (required in --json / non-TTY to proceed) **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask add-people` Add people to an existing ask (they become participants when the round runs; optionally backfill prior rounds) Usage: `ish ask add-people [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--workspace \** `string` Workspace ID; accepted for consistency (workspace is inferred from the ask) **--round \** `string` Round to add people to (required) Required. **--person \** `string` Person IDs/aliases (comma-separated or repeatable) Default: \[]. **--sample \** `string` Randomly sample N people from the matching pool (max 20 per dispatch - split into multiple slices for larger cohorts) **--all-simulatable** `boolean` Add every simulatable AI person matching the filters not already included (capped at 20 per dispatch - split into multiple slices for larger cohorts) **--search \** `string` Substring match against person name **--bio \** `string` Substring match against person bio **--occupation \** `string` Substring match against person occupation (repeatable) Default: \[]. **--gender \** `string` Filter by gender (female, male, nonbinary; repeatable, OR semantics) Default: \[]. **--country \** `string` Filter by 2-letter country code (repeatable) Default: \[]. **--min-age \** `string` Minimum age (inclusive) **--max-age \** `string` Maximum age (inclusive) **--visibility \** `string` Filter by visibility: workspace (your workspace), shared (community-published), platform (admin-curated). Old values `private` / `public` are accepted and mapped to `workspace` / `platform`. **--backfill** `boolean` Backfill prior rounds in order for new people ## `ish ask update` Update an ask's name or description Usage: `ish ask update [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--name \** `string` New name **--description \** `string` New description **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask archive` Archive an ask (hides it from default list) Usage: `ish ask archive [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask unarchive` Restore an archived ask Usage: `ish ask unarchive [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask delete` Delete an ask and all its rounds, responses, and participants Usage: `ish ask delete [id] [options]` ### Arguments **id** Ask alias or UUID (defaults to active ask) (optional) ### Options **--ask \** `string` Ask ID; alternative to positional argument **-y, --yes** `boolean` Skip confirmation prompt (required in --json or non-TTY contexts) **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## `ish ask use` Set the active ask (saved to \~/.ish/config.json) Usage: `ish ask use [id] [options]` ### Arguments **id** Ask alias or UUID (optional) ### Options **--clear** `boolean` Remove the active ask from config **--workspace \** `string` Workspace ID; accepted for consistency (inferred from alias / active context) ## Global flags Every command accepts the global flags. **-V, --version** `boolean` output the version number **-t, --token \** `string` Auth token (or set ISH\_TOKEN env var) **--token-file \** `string` Read auth token from a file (preferred over --token / ISH\_TOKEN) **--workspace \** `string` Default workspace ID; per-subcommand --workspace overrides **--json** `boolean` Output as JSON (auto-enabled when piped) **--get \** `string` Extract a single field from the JSON response and print only its value (implies --json internally; supports dotted paths e.g. person.name) **--human** `boolean` Force human-readable output even when stdout is piped (overrides JSON-when-piped auto-detection) **--fields \** `string` Comma-separated fields to include in JSON output (e.g. alias,name,status) **--list-fields** `boolean` Print the projectable field names for the response instead of the data, then exit (also: --fields ?) **--verbose** `boolean` Include full UUIDs and timestamps in JSON output **--no-color** `boolean` Disable colored output (also honored: NO\_COLOR env var) **-q, --quiet** `boolean` Suppress progress messages on stderr (no-op for read commands that emit none) # chat Source: https://docs.ishlabs.io/cli/generated/chat Command reference: ish chat. ## `ish chat endpoint` Manage saved chatbot endpoints Usage: `ish chat endpoint` ## `ish chat endpoint list` List chatbot endpoints in the current workspace Usage: `ish chat endpoint list [options]` ### Options **--workspace \** `string` Workspace ID ## `ish chat endpoint get` Get a chatbot endpoint by id (or the active endpoint) Usage: `ish chat endpoint get [id] [options]` ### Arguments **id** Endpoint alias or UUID; defaults to the active endpoint (optional) ### Options **--endpoint \** `string` Endpoint alias or UUID (alternative to positional) ## `ish chat endpoint create` Create a chatbot endpoint from a hand-written ChatbotEndpointConfig JSON (advanced - use `chat endpoint init` to infer the config from a curl sample, JSON, or template). Usage: `ish chat endpoint create [options]` ### Options **--endpoint-config \** `string` Path to JSON file (or "-" for stdin) Required. **--name \** `string` Override the name from the config file **--workspace \** `string` Workspace ID **--tunnel-backed** `boolean` Mark this endpoint as tunnel-backed (overrides envelope/config) **--no-tunnel-backed** `boolean` Force tunnel-backed off (overrides envelope/config) ## `ish chat endpoint update` Update a chatbot endpoint (full replace via --endpoint-config, or per-field shorthand) Usage: `ish chat endpoint update [id] [options]` ### Arguments **id** Endpoint alias or UUID; defaults to the active endpoint (optional) ### Options **--endpoint \** `string` Endpoint alias or UUID (alternative to positional) **--endpoint-config \** `string` Replace config from JSON file (or "-" for stdin) **--name \** `string` Rename the endpoint **--url \** `string` Replace outgoing.url **--method \** `string` Replace outgoing.method (POST | PUT) **--mode \** `string` Replace outgoing.mode (stateful | stateless) **--tunnel-backed** `boolean` Set isTunnelBacked=true **--no-tunnel-backed** `boolean` Set isTunnelBacked=false ## `ish chat endpoint delete` Delete a chatbot endpoint Usage: `ish chat endpoint delete [id] [options]` ### Arguments **id** Endpoint alias or UUID; defaults to the active endpoint (optional) ### Options **--endpoint \** `string` Endpoint alias or UUID (alternative to positional) **-y, --yes** `boolean` Skip confirmation prompt (required in --json or non-TTY contexts) ## `ish chat endpoint use` Set the active chat endpoint (saved to \~/.ish/config.json) Usage: `ish chat endpoint use [id] [options]` ### Arguments **id** Endpoint alias or UUID (optional) ### Options **--clear** `boolean` Remove the active chat endpoint from config ## `ish chat endpoint init` Author an endpoint from a curl/JSON sample via test-and-map, or from a known-good template (recommended for most users - use `chat endpoint create` only when you already have a hand-written ChatbotEndpointConfig). Usage: `ish chat endpoint init [options]` ### Options **--from-curl \** `string` Path to a curl example file (or "-" for stdin) **--from-json \** `string` Path to a JSON request/response sample (or "-" for stdin) **--template \** `string` Start from a known-good template (one of: openai, anthropic, voiceflow, dialogflow-cx, botframework) **--name \** `string` Save the inferred config under this display name **--no-save** `boolean` Infer the shape without persisting it **--workspace \** `string` Workspace ID **--tunnel-backed** `boolean` Force isTunnelBacked=true (overrides localhost auto-detect) **--no-tunnel-backed** `boolean` Force isTunnelBacked=false (overrides localhost auto-detect) ## `ish chat endpoint test` Send one message to a saved endpoint and return the bot's reply Usage: `ish chat endpoint test [endpoint-id] [options]` ### Arguments **endpoint-id** Endpoint alias or UUID; defaults to the active endpoint (optional) ### Options **--endpoint \** `string` Endpoint alias or UUID (alternative to positional) **-m, --message \** `string` Message to send Default: "Hello". **--conversation-id \** `string` Thread state across multiple invocations (stateful endpoints) \*\*--participant \\\\*\* \`string\` Participant identity JSON (\{name, locale, ...}) exposed via \{\{participant.\*}} **--include-request** `boolean` Include the dispatched POST body in the output **--workspace \** `string` Workspace ID ## `ish chat endpoint map` Map a chatbot contract from documentation (and optionally a saved endpoint draft) via /chat/test-and-map Usage: `ish chat endpoint map [options]` ### Options **--docs \** `string` Path to documentation file (curl, JSON, OpenAPI snippet, freeform). Use "-" for stdin **--endpoint \** `string` Saved endpoint alias or UUID - its config seeds the draft endpoint. Optional. **--workspace \** `string` Workspace ID ## `ish chat config` Manage chatbot configurations (agent shape: model, prompt, tools, sub-agents) Usage: `ish chat config` ## `ish chat config list` List configurations under a chatbot endpoint Usage: `ish chat config list [options]` ### Options **--endpoint \** `string` Endpoint alias or UUID (defaults to active endpoint) ## `ish chat config set` Create or update a chatbot configuration (composite upsert) Usage: `ish chat config set [options]` ### Options **--name \** `string` Configuration name (unique per endpoint) Required. **--endpoint \** `string` Endpoint alias or UUID (defaults to active endpoint; create only) **--config \** `string` Configuration alias or UUID - switches to update mode **--version-label \