Nava Muse connector API reference
Developer Preview
This page documents the Muse connector (/muse/v1/*): the API surface a Muse
shopping agent uses to check proposed purchases against a buyer's spending
policy in Nava and to report what it bought. The
machine-readable reference generated from the same contract is at
Nava Muse Connector API.
Advisory-only semantics
The connector never moves funds and is not in the payment path. Three properties follow from that and shape every endpoint:
- An assessment is never an authorization to buy. The connector answers
"does this basket fit the buyer's rules?" — the agent and its platform remain
responsible for the purchase itself. Assessments expire 10 minutes after
they are made (
expiresAt) and are stale after any basket change. - Everything is agent-reported and unverified. Baskets and purchase reports
contain whatever the agent says they contain. Statement rows carry
basis: "agent_reported"to make this explicit. - Nava stores summaries, not product identifiers. Assessment records keep
the reported merchant domain (or the display name when no valid domain is
supplied), currency, total, item count, and rule findings. Purchase records
keep the merchant domain when a valid
merchant_domainis reported (otherwise the merchant name), charged total, order reference, and each line item's name, quantity, unit price, and category. Product URLs and product IDs are never stored or returned: send them in the basket if you have them, but do not expect them back.
Base URL
The connector is served by the Nava Service under /muse/v1. The Nava UI
shows the complete connector URL for an agent (for example
https://<service>/muse/v1) on the agent's Muse connector card, which appears
once the agent's policy has Commerce enabled; add it as a custom connector in
Muse.
Public endpoints
Three routes need no authentication:
| Route | Returns |
|---|---|
GET /muse/v1 | Human-readable service description and endpoint listing. |
GET /muse/v1/openapi.json | The machine-readable contract. The spec on this site is vendored from the same builder, so the two cannot disagree. |
GET /muse/v1/soul | { "markdown": string } — the Soul section a buyer pastes into Muse so the agent knows to check purchases and report completed ones. The Nava UI's connect flow serves this to users. |
Authentication
Every other route requires a connector key: a purchase-scoped agent API
key issued from the Nava UI (scope purchase-assessments:create:own, shown in
the UI as Commerce access). Send it either way on each request:
Authorization: Bearer <connector-key>x-api-key: <connector-key>The secret is shown once at creation. Give it to Muse through its secure connection flow only — never in a chat message or the Soul file — and never send it in a URL or log it.
A missing or invalid key returns 401. A key that is not an agent key returns
403, and an agent key without Commerce access returns 403 with
error: "missing_scope" and the requiredScope it needs.
Rate limits
Reads (GET routes, including the public ones) allow 120 requests per minute;
POST /muse/v1/assessments and POST /muse/v1/purchases allow 60 per minute.
Requests over the limit return 429.
Policy versions and rule inputs
A buyer's Commerce policy uses one of two rule sets. GET /muse/v1/policy
returns the active document, and its schemaVersion says which applies.
| Policy | Rules | Basket inputs the rules need |
|---|---|---|
schemaVersion: 2 | Per-payment cap (USD), rolling spend cap per period (USD), merchant allowlist | currency of USD, a total, and merchant_domain when the allowlist is enabled |
schemaVersion: 1 | Per-basket budget (in the policy's currency), blocked categories, merchant allowlist | currency matching the budget, a total, merchant_domain when the allowlist is enabled, and a category on every item when categories are blocked |
A total means costs.total, or all four of costs.subtotal,
costs.discount, costs.shipping, and costs.tax (the total is then
subtotal − discount + shipping + tax). Line items alone never establish a
total. There is no currency conversion: a basket in another currency cannot
be checked against the caps. Merchant allowlists match only
{source: "domain", id: "walmart.com"} entries against the basket's
merchant_domain. Supply a bare hostname, not a URL. Domains are trimmed,
lowercased, and stripped of one leading www. before exact comparison. Other
subdomains are distinct: shop.walmart.com does not match walmart.com.
Paths, ports, wildcards, IP addresses, and malformed domains are invalid.
Missing or invalid domains produce needs_information; merchant names never
substitute for domains, including in mixed allowlists. An enabled empty
allowlist denies every merchant; a disabled allowlist is unrestricted.
The optional merchant field remains a display name. No domain is inferred
from it or from product URLs. Domains are agent-reported and unverified, just
like the rest of the basket. New name-based policy entries are rejected; no
existing names are automatically converted to domains. Money may be sent as
strings ("9.50") or numbers.
Rolling spend cap. For a version 2 policy, spend in the current period is every purchase reported in the window plus every basket that fit the policy in the window and has not been reported as bought. A fitting basket is presumed purchased until it is reported, so not reporting a purchase never frees up budget. Each purchase counts once: a reported purchase replaces its assessment in the total.
GET /muse/v1/policy
The buyer's current commerce rules with plain-language guidance strings, so
purchases can be planned within policy before anything is assessed. The
response has status, policy (policyId and version), document (the
policy itself), and guidance. Guidance covers the rules for the policy's
version — the per-payment and rolling caps for version 2, or the basket budget
and blocked categories for version 1 — plus merchant restrictions, and always
ends with the advisory reminder.
When the buyer has no Commerce policy, this route still returns 200, with
status: "needs_setup", document: null, and guidance telling the buyer to
set one in Nava.
POST /muse/v1/assessments
Check a proposed basket against the buyer's policy. Call it before checkout and again after every basket change. The basket is free-form — nothing is rejected for shape — but rules without their inputs cannot pass (see Policy versions and rule inputs).
The response contains assessmentId, guidance, and result. The result's
outcome drives agent behavior:
| Outcome | Meaning |
|---|---|
fits_policy | Proceeding is consistent with the buyer's policy. Still not an authorization. |
violates_policy | Stop and show the findings to the user. |
needs_information | Re-assess with the listed missingInputs before relying on the result. |
The connector evaluates baskets itself and returns only these three outcomes;
if an assessment cannot be produced, the request fails with an HTTP error
instead. The shared result format also defines unavailable, which the
connector does not return.
result.findings has one entry per rule, each with rule, status
(passed, violated, needs_information, or disabled), reason, and
inputPaths. result.missingInputs lists the rule, path, and reason for
each input still needed.
result.provisional is true when required inputs were missing or estimated —
never treat a provisional result as a pass. A 409 means the buyer has no
Commerce policy configured yet; they must set one in Nava first.
GET /muse/v1/assessments/:id
Retrieve a prior assessment with its findings and recordedAt, for explaining
an earlier verdict to the user. The id must be a UUID (400 otherwise);
an assessment that does not exist for this connector returns 404.
POST /muse/v1/purchases
Report an executed transaction immediately after checkout completes, with the
final charged total (including shipping and tax), currency, and the
assessment_id from the pre-purchase check. Include optional
merchant_domain the same way as on assessments: when it is a valid bare
hostname, the purchase record stores {source: "domain", id} after the usual
normalization; otherwise the merchant name is kept. Reporting never authorizes
or blocks anything; it records what happened so the buyer's purchase history
and spend tracking stay accurate.
Reports are idempotent per assessment: reporting the same assessment_id
twice returns the original record with alreadyRecorded: true instead of
creating a duplicate. A purchase reported without a prior assessment is
recorded with unchecked: true.
executed_at defaults to the report time. A value more than 24 hours before
the report is moved forward to 24 hours before it, and a future value is moved
back to the report time, so a purchase cannot be shifted out of a spending
period.
| Status | Cause |
|---|---|
400 incomplete_report | The charged total or currency is missing; missing lists which. |
400 invalid_assessment_id | assessment_id is present but is not a UUID. |
404 unknown_assessment | No assessment with that id exists for this connector. |
GET /muse/v1/purchases and GET /muse/v1/purchases/:id
Statement reads: the buyer's purchase history through this connector, newest
first, with per-currency totals — like a card statement. The list returns
purchases, count, totals, basis, and guidance. It supports limit
(default 50; values above 200 are treated as 200) and since (an ISO 8601
date-time; only purchases executed after it are returned). A limit below 1
or an unparseable since returns 400. Every row is agent-reported.
GET /muse/v1/purchases/:id returns one record. The id must be a UUID
(400 otherwise); an unknown purchase returns 404.