ONE preview:approve
← Receivers

preview:approve

preview family

The visitor approves their URL-funnel store from its preview link: resolves the run's review step so the products go on sale and the storefront opens in TEST mode (test cards only; crypto waits for a claimed owner's wallet). Real money stays behind claim + shop:go-live. Answers the store and product links; a second call moves nothing.

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
public
The class of authority the caller must already hold, decided from the attested context with no round trip.
Reversible
no
This cannot be undone. Dry-run it first where the contract allows.
Idempotent
yes
Safe to retry as-is.

Send it with your agent

One click hands your coding agent a prompt that registers the substrate, reads this contract, and makes the call. Launch opens the app; the others copy the prompt.

Claude Code
Codex
Cursor
Gemini CLI
Claude Desktop
ChatGPT
curl -X POST https://one.ie/api/ask/preview:approve \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "token": <string> }}'

The key is never in a link. npx -y @oneie/cli login writes it to ~/.config/oneie/key on your machine.

Request

Validated before dispatch — an invalid payload is refused with the fix, never half-applied.

  • token string required The preview token from /preview/<token> — the same capability that shows the draft

Response

What comes back from the call.

  • ok boolean
  • error string invalid_or_expired · already_claimed (approving is the owner's now) · invalid_workspace · store_is_live · not_found · not_a_url_store · not_ready · build_failed · resolve_failed
  • storeUrl string
  • productUrl string | null The product read from the visitor's site when there was one, else the first product
  • mode "test"
  • approved now | already

Traffic

Every call to preview:approve, counted where it is dispatched — over HTTP or in-process alike. Aggregate only — no actor, no payload, no workspace.

Counting…

Wiring

Every place in the open source that names preview:approve, and the file that answers it. Read from the tree at build time — a receiver is reached by NAME through one door, so there is no import edge to follow and a grep is the honest shape of the question. Structure, not volume — the count is in Traffic above.

Called from

API route 2
  • one.ie/web/src/lib/receiver-index.generated.ts:313
  • one.ie/web/src/lib/resolvers/site-funnel.ts:346
→

Answered by

preview:approve one.ie/web/src/lib/resolvers/movers-funnel.ts:498 Dispatched through POST /api/ask/preview:approve, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "The preview token from /preview/<token> — the same capability that shows the draft"
    }
  },
  "required": [
    "token"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "error": {
      "description": "invalid_or_expired · already_claimed (approving is the owner's now) · invalid_workspace · store_is_live · not_found · not_a_url_store · not_ready · build_failed · resolve_failed",
      "type": "string"
    },
    "storeUrl": {
      "type": "string"
    },
    "productUrl": {
      "description": "The product read from the visitor's site when there was one, else the first product",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "mode": {
      "type": "string",
      "const": "test"
    },
    "approved": {
      "type": "string",
      "enum": [
        "now",
        "already"
      ]
    }
  },
  "required": [
    "ok"
  ]
}