Chapter 14Beta

Build a workflow around Stand.

Read account data, maintain configuration, or bring Stand into an existing process. Start with one useful result and the permissions needed to produce it.

Stand Guidebook

Chapter 14 of 14

Field guide

What to learn in this chapter

This walkthrough uses the CLI as an authenticated HTTP client so you can learn the API without handling raw credentials. It covers a conversation review first, then the rules for making changes.

Need an exact capability definition, plan requirement, or limitation? Browse the Feature Reference.

Choose a direction

01

Match the connection to the job.

The Public API lets your tools work on your Stand account. It is available on all plans, with the same role, ownership and plan checks as the underlying features. A permission does not add a paid capability or another person’s access.

Use the public OpenAPI document to find the operation, required scope, input and response. The current contract contains 109 operations across 19 business scopes. Paths include /v1; the production server origin is https://api.stand.chat. Only published operations are available to external clients.

Contract

Download OpenAPI.

Use the supported operations and schemas when planning a client or generating request types.

Open the contract

HTTP reference

Look up an endpoint.

Search by operation, method, path or permission.

Browse endpoints

Outbound APIs

Give a Stand-in a tool.

Follow this separate workflow when Stand should call your system.

Connect backend systems

Visitor interface

Build a custom chat UI.

Use the supported visitor protocol for your own chat experience.

Build a visitor interface
Your goalManage Stand or analyze its conversations
UseThe Public API and Stand CLI, acting with the signed-in person’s permissions.
Your goalLet a Stand-in call your company’s API
UseBusiness OpenAPI integrations. Stand calls the selected external operations during a conversation.
Your goalBuild your own website chat interface
UseThe visitor API and WebSocket protocol, using session-scoped visitor tokens. Never put management credentials in website code.

Account access

02

Sign in with the supported client.

The supported public OAuth client is stand-cli. Use Node.js 22 or newer on macOS, Linux or WSL, install the official package, and request only the scopes needed for the task. This conversation review needs profile:read and sessions:read, with no write permission. An explicit --scopes list replaces the previous selection.

Keep the command running while you complete signup or sign-in and consent in the browser. Wait for the CLI’s credential-storage result after the browser says Stand CLI authorized. A new account must also complete its initial profile and organization in the dashboard; the API cannot do that onboarding.

The CLI stores credentials privately and renews five-minute access tokens within the 30-day capped offline-session policy. Expiry or revocation can require another human login. A scheduled process uses that person’s authorization; this release does not provide custom-client registration, personal access tokens or an independent service account.

CLI setup

Configure a profile or finish browser onboarding.

The CLI guide covers device approval, credential stores, environment selection and setup readiness.

Set up the CLI

Install, authorize a read, and verify the identity

npm install --global @standchat/cli
stand --version
stand auth login --scopes "profile:read sessions:read"
stand auth status --check
stand whoami

Compare the returned user with the intended account before reading customer data. Use a named profile for another environment; an npm tag does not choose the API target.

Start small

03

Read one page with an explicit selection.

Inspect listArchivedSessions before making the request. Use scope=myself for your own accessible conversations; organization-wide history requires the current organization owner. An owner’s archived access does not grant access to a teammate’s live conversation.

Replace both timestamps with the period you intend to review. They filter close time, require a timezone, and use an exclusive upper bound. Keep all filters the same when moving between pages. The site filter matches literal text within a saved page URL, not an exact hostname; inspect those URLs if your analysis needs a single domain.

Use the generic client for a published GET operation

stand schema listArchivedSessions
stand api GET /v1/sessions/archived \
  --query-param scope=myself \
  --query-param closedFrom=2026-10-01T00:00:00Z \
  --query-param closedTo=2026-11-01T00:00:00Z \
  --query-param page=0 --query-param size=20 \
  --query-param sortBy=closedAt --query-param sortDir=desc

Examples use readable terminal output. Add --json when a script or agent will parse the result; read diagnostics from stderr and data from stdout.

Response fieldsessions
What it establishesThe summaries on this page. Read retained transcripts before quoting a visitor.
Response fieldpage and totalPages
What it establishesThe zero-based page and the current total. One page may be only a sample.
Response fieldtotalElements
What it establishesThe number of matching accessible conversations observed by this query.
Response fieldisOwner
What it establishesContext for organization-wide history, not permission to skip server checks.

Know the coverage

04

Use an export for a whole-period review.

History pages contain 1–100 records and use offset pagination. Bound page count, elapsed time and bytes, and report whether more results remain. Concurrent changes can move page boundaries, so a page traversal is not a frozen snapshot. A sessions get read is also bounded to at most 500 messages.

The export endpoint freezes the matching conversation set and streams one JSON document. The CLI checks the whole response, failedSessionIds and exportedElements before publishing a new private file, and refuses to overwrite an existing file. An interrupted or invalid stream is not a completed export, even after HTTP 200.

Download only the conversations authorized for the task and keep the file outside your repository. A copy sent to another service has its own access and retention lifecycle. Record the account scope, dates, filters and count with any analysis; verify claims and quotations against the included conversation IDs.

Export the same selection to a new private file

stand history export --scope myself \
  --closed-from 2026-10-01T00:00:00Z \
  --closed-to 2026-11-01T00:00:00Z \
  --output /absolute/path/review-october.json

Replace the dates and destination. The default timeout is 600 seconds and the default byte cap is 100 MiB. Operation and resource limits still apply; do not publish an incomplete report.

A useful analysis brief

Ask for evidence, not an unsupported trend.

Question
Which support questions recur within this exact selection?
Evidence
Include conversation IDs and checked quotations for each theme.
Coverage
State the period, filters, count, omissions and whether this is a sample.
Next step
Propose approved knowledge changes; do not apply them without authorization.

Make a deliberate change

05

Read the existing configuration before writing.

Save the resource ID from the successful response. Names are not unique, and an inaccessible or missing resource is not permission to create a replacement. Read the operation schema, preserve the intended settings, and inspect the saved result.

There is no conditional revision check or general Idempotency-Key guarantee. Coordinate shared edits and stop when another writer may have changed the configuration.

Inspect the request before editing an existing Stand-in

stand standins get STANDIN_ID
stand schema updateStandin

Prepare a complete reviewed body from that read before using stand standins update STANDIN_ID --body-file standin.json. Request standins:write as well as standins:read for the approved change.

OperationupdateSite
What to preserveSimple supplied settings such as name change individually. behaviorConfig replaces all its rules and switches. Avoid legacy embedOptions: it rebuilds behavior and resets advanced permissions, even when empty.
OperationupdateRepProfile
What to preserveOnly after browser onboarding: retain firstName, lastName, title, organization, avatarUrl, greeting and greetingEnabled. Omitted nullable fields clear; renaming the organization additionally needs org:write and ownership.
OperationupdateStandin
What to preserveSend the complete writable configuration, not an avatar-only or prompt-only patch. Preserve intended values and use the returned standinProfileId, which can change when a history-preserving version is created.
OperationKnowledge or integration attachments
What to preserveRead and send the complete intended ID list. An omitted entry is removed; an empty list detaches everything.
OperationSite or organization instructions
What to preserveRead the saved text and replace it with the complete reviewed instruction.

Image uploads

06

Distinguish staging an image from applying it.

Image uploads use multipart/form-data with a required file part. The CLI supplies the boundary and media type from a regular local file. Inspect the specific operation schema for accepted formats and limits before upload; do not send a base64 string or JSON filename in place of the file.

Your avatar and personal pin use profile:write; your Stand-in images use standins:write; organization pin images use org:write and require the owner. Request the corresponding read permissions to inspect existing settings. Write scopes do not include reads.

CLI example

Replace an existing Stand-in avatar.

Use the direct upload when you only want to change that image.

Follow the upload steps

Stage your avatar without replacing profile settings

stand auth login --scopes "profile:read profile:write"
stand profile get
stand schema uploadRepAvatar
stand api POST /v1/reps/profile/avatar \
  --form-file file=/absolute/path/approved-portrait.png
stand schema updateRepProfile

After upload, prepare the complete profile body and set avatarUrl to filename. Review it before stand profile update --body-file profile-avatar.json, then read the profile again. Do not send an avatar-only body.

Target and routeRepresentative avatar: POST /v1/reps/profile/avatar
Apply the resultStages an image. Put the returned filename into avatarUrl in a complete updateRepProfile request. Use the response avatarUrl only to preview it.
Target and routeNew Stand-in avatar: POST /v1/reps/me/standins/avatar-upload
Apply the resultStages an image. Put filename into avatarUrl when creating the Stand-in.
Target and routeExisting Stand-in avatar: POST /v1/reps/me/standins/{id}/avatar
Apply the resultApplies immediately and keeps the same Stand-in ID; no follow-up settings save is needed.
Target and routePin icon or logo: personal /v1/lapel-pins/me, organization /v1/lapel-pins/{pinId}, or Stand-in /v1/reps/me/standins/{id}/lapel-pin, followed by /icon or /logo
Apply the resultApplies immediately and preserves other pin settings. A missing personal or Stand-in pin is created with pinType none; uploading an image alone does not turn it on.

Recovery

07

Treat an uncertain write as unfinished work.

The CLI retries some transient GET failures within a bound, but never automatically replays writes. After a timeout, lost response, cancellation after dispatch or server error, read the affected resource and reconcile its ID and content before deciding whether a retry is safe.

Use the API error code and status together. Invalid or interrupted responses can fail validation even when a status was received. Broader scopes cannot supply ownership, restore a disabled membership, add a paid capability or accept browser consent.

Message workflow

Keep a reply recoverable.

The named send command checks identity and returns reconciliation IDs after uncertain dispatch.

Read reply and recovery steps
Result401 or expired authorization
Next stepCheck the selected profile and issuer, then sign in again when required.
Result403 INSUFFICIENT_SCOPE
Next stepRead requiredScope, request the complete needed permission set and obtain human consent. Other access denials need the appropriate account or resource owner.
Result404 NOT_FOUND
Next stepCheck the published method and path, environment and resource ID. Hidden resources can also return not found.
ResultPlan, capacity or rate limit
Next stepInspect capabilities, usage and any retry delay. Adjust the task or stop; an unchanged retry does not add entitlement.
ResultPartial export or invalid response
Next stepKeep the result incomplete and preserve sanitized diagnostics. Do not publish a successful report.
ResultUncertain message reply
Next stepPreserve the saved clientMessageId and body, and inspect the conversation before any separately approved retry.

Try the guide on one real page.