Internal app routes

Internal app route matrix

Authenticated and internal /api/* routes that power the Purveyors product surface, grouped by capability and stability.

This page distinguishes the stable external v1 contracts, beta catalog endpoints, legacy aliases, internal app APIs, Console control-plane routes, and admin-only surfaces.

Most /api/* routes are not public compatibility promises. Document them accurately, but keep external integrations pointed at /v1/catalog, /v1/catalog/{id}/similar when matching access is available, /v1/price-index for aggregate market data, or @purveyors/cli whenever possible.

Public v1 and legacy route families

RouteMethodsAuthStabilityNotes
/v1GETAnonymous, session, or API keyNamespace descriptorAdvertises the v1 namespace and stable catalog and price-index resources.
/v1/catalogGETAnonymous, session, or API keyStable external contractCanonical catalog resource for normalized listing reads, proof summaries, plan caps, and API-key rate-limit headers.
/v1/catalog/{id}/similarGETMember session or API key with API Origin or Enterprise plus catalog:readBeta external contractCatalog similarity candidates with target, grouped canonical candidates vs similar recommendations, score dimensions, identity blocker reasons, price deltas, and cautious beta copy.
/v1/procurement/briefsGET, POSTMember session or API key with API Origin or Enterprise plus catalog:readStable external procurement seedCreates and lists user-owned saved sourcing criteria. /v1/procurement/briefs/{id} gets one brief, and /v1/procurement/briefs/{id}/matches runs deterministic catalog matches.
/v1/price-indexGETAPI key with Parchment Intelligence accessStable external aggregate contractReads aggregate price_index_snapshots only. No raw supplier rows, CSV, alerts, watchlists, or webhooks.
/api/catalog-apiGETAPI key onlyDeprecated legacy aliasAPI-key-only alias to /v1/catalog. Always public-only. Sunset: Dec 31 2026.

Catalog and discovery app routes

RouteMethodsAuthStabilityNotes
/api/catalogGETAnonymous, session, or API keyInternal compatibility adapterDelegates to the canonical catalog resource but can return legacy shapes and adds X-Purveyors-Canonical-Resource: /v1/catalog.
/api/catalog/filtersGETAnonymous or sessionInternal UI helperReturns stocked-only filter metadata. Privileged sessions can opt into wholesale-aware values.
/api/catalog-apiGETAPI key onlyDeprecatedLegacy API-key-only alias to /v1/catalog. Always public-only. Sunset: Dec 31 2026.

Inventory and sales routes

RouteMethodsAuthStabilityNotes
/api/beansGET POST PUT DELETEGET: session or share token; writes: sessionInternal product routeGET without a valid session returns an empty data array rather than a 401. share=<token> scopes reads to a shared bean or the owner's full inventory.
/api/sharePOSTSessionInternal product routeCreates /beans?share=... links for one inventory item or all items.
/api/update-stocked-statusPOST PUTSessionInternal helperPOST recalculates one inventory item by coffee_id. PUT bulk-recomputes the caller's entire inventory.
/api/profitGET POST PUT DELETESessionInternal product routeGET returns both sales and computed profit data. Writes enforce ownership on the underlying sales or inventory rows.

Roast and analysis routes

RouteMethodsAuthStabilityNotes
/api/roast-profilesGET POST PUT DELETESessionInternal product routeCRUD for roast profiles. POST supports single and batch creation. DELETE accepts id or batch name.
/api/artisan-importPOSTSessionInternal product routeAccepts multipart form-data with file plus roastId. Supported formats: .alog, .alog.json, .json.
/api/roast-chart-dataGETSessionInternal analysis helperRequires roastId query param. Returns sampled telemetry and metadata, not raw unbounded sensor streams.
/api/roast-chart-settingsGETSessionInternal UI helperRequires roastId query param. Reads saved chart ranges for a roast profile.
/api/clear-roastDELETESession + ownershipInternal maintenance helperRequires roast_id query param. Clears imported Artisan data and resets related fields.
/api/ai/classify-roastPOSTSession + member roleInternal AI helperMatches Artisan metadata to inventory candidates. Returns { match } and can emit 429 if the model provider rate-limits.

Chat and workspace routes

RouteMethodsAuthStabilityNotes
/api/chatPOSTMember sessionInternal product routeStreams AI chat responses with workspace context and tool execution.
/api/chat/execute-actionPOSTMember sessionInternal product routeExecutes a constrained set of proposal-card actions: add_bean_to_inventory, update_bean, create_roast_session, update_roast_notes, and record_sale.
/api/workspacesGET POSTMember sessionInternal product routeLists or creates workspaces. New workspaces default to title "New Workspace" and type "general" when omitted.
/api/workspaces/[id]GET PUT DELETEMember session + ownershipInternal product routeGET returns workspace details plus up to 50 messages and updates last_accessed_at.
/api/workspaces/[id]/messagesPOST DELETEMember session + ownershipInternal product routePOST accepts one message or an array and persists parts plus canvas mutations.
/api/workspaces/[id]/canvasPOST PUTMember session + ownershipInternal product routePersists canvas_state; POST exists for sendBeacon compatibility.
/api/workspaces/[id]/summarizePOSTMember session + ownershipInternal product routeCompacts recent conversation history into context_summary using the model backend. Returns skipped: true when there are fewer than four saved messages.

Workspace routes are product internals, not agent APIs

These endpoints exist to support the Purveyors chat product. For external automation, prefer the public catalog API or the CLI instead of coupling to chat workspace payloads.

Console and docs-adjacent routes

Outside the JSON route layer, /api/docs and /api-dashboard/docs are legacy docs entry points that 307 redirect to /docs/api/overview.

Treat /docs as the canonical information architecture, /api as the product page, and /api-dashboard as the authenticated Console surface.

RouteMethodsAuthStabilityNotes
/api-dashboard/keys/generatePOSTSessionConsole control-plane routeCreates one API key for the authenticated user and returns the plaintext apiKey only at creation time.
/api-dashboard/keys/deactivatePOSTSession + key ownershipConsole control-plane routeDeactivates an owned API key by keyId without exposing the secret again.

Metadata, auth handoff, and crawler routes

These routes are public or browser-reachable support surfaces. They improve agent onboarding, search discovery, feed subscriptions, OAuth reliability, or browser tooling compatibility, but they are not public data APIs.

RouteMethodsAuthStabilityNotes
/llms.txtGETAnonymousAgent discoverability metadataPlain-text overview for agents with links to public pages, docs, API contracts, blog posts, and supported workflows.
/sitemap.xmlGETAnonymousCrawler metadataXML sitemap covering public pages, published blog posts, and the docs navigation generated from DOCS_NAV.
/blog/feed.xmlGETAnonymousRSS feedRSS 2.0 feed for published blog posts. It is content syndication, not a catalog or analytics API.
/auth/callbackGETOAuth codeAuth handoff routeExchanges a Supabase auth code for a session, sanitizes next to an internal path, and redirects to the target or /auth/auth-code-error.
/auth/cli-callbackGETOAuth redirect targetCLI login helper pageBrowser page that lets remote and headless CLI flows copy the full callback URL back into purvey auth login.
/.well-known/appspecific/com.chrome.devtools.jsonGETAnonymousBrowser tooling compatibilityReturns an empty JSON object for Chrome DevTools app-specific probing. It has no product data contract.

Deprecated tool routes

RouteMethodsAuthStatusReplacement direction
/api/tools/coffee-catalogPOSTMember sessionDeprecatedPrefer direct CLI-library integration or /v1/catalog for external reads.
/api/tools/green-coffee-invPOSTMember sessionDeprecatedPrefer shared inventory modules and CLI flows.
/api/tools/roast-profilesPOSTMember sessionDeprecatedPrefer shared roast modules and CLI flows.
/api/tools/bean-tastingPOSTMember sessionDeprecatedPrefer shared tasting logic and CLI flows.
/api/tools/coffee-chunksPOSTMember sessionDeprecatedPrefer current retrieval modules instead of tool-route coupling.

Related links