ONE forms:save
← Receivers

forms:save

forms family

mcp

Create or update one of your group's signup forms (inline, popup, flyout, fullscreen, teaser): its words, fields, triggers, A/B copy, an optional coupon offer and an optional browser-notification offer. A form starts as draft; only a live form is served. An offer must name an active coupon in the group (offer_code_unknown); at most 100 forms per group (too_many).

Effect
ask
Awaits an outcome — the call returns the response below.
Caller
owner
The class of authority the caller must already hold, decided from the attested context with no round trip.
Cost
free
What one call costs, so you can budget before acting.
Reversible
yes
The effect can be undone by a later call.
Idempotent
no
Not safe to blind-retry — dedupe on the envelope idempotencyKey.

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/forms:save \
  -H "Authorization: Bearer $ONE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": { "name": "Spring popup", "type": "popup", "status": "draft", "config": { "heading": "10% off your first order", "triggers": { "delaySec": 5 } } }}'

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.

  • workspace string optional The group the form belongs to; default the group your sign-in acts for. Walked by the same authority check as every owner door.
  • id string optional The form to update. Omit to create one.
  • name string required The owner's name for the form; never shown to visitors.
  • type inline | popup | flyout | … required
  • status draft | live | paused optional Default draft.
  • list string | null optional The audience list a submit subscribes to.
  • config object optional heading, body, cta, placeholder, successHeading, successBody, fields {firstName, phone, whatsapp}, smsConsentText, triggers {delaySec, scrollPct, exitIntent, pageContains, showEveryDays, hideForKnown}, ab, variantB {heading, body, cta}, offer {code, text} | null, push. Unset keys take defaults; validated in full by the resolver.

Response

What comes back from the call.

  • ok boolean
  • form object
  • error string forbidden · no_db · bad_request · offer_code_unknown · too_many · not_found
  • detail string

Traffic

Every call to forms:save, 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 forms:save, 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

UI 1
  • one.ie/web/src/components/newsletter/forms/FormsPanel.tsx:64
API route 2
  • one.ie/web/src/lib/receiver-index.generated.ts:228
  • one.ie/web/src/lib/resolvers/forms.ts:55
CLI 3
  • packages/cli/src/forms.ts:65
  • packages/cli/src/lib/receivers-index.generated.ts:230
  • packages/cli/src/lib/receivers.generated.ts:230
→

Answered by

forms:save one.ie/web/src/lib/resolvers/forms.ts:54 Dispatched through POST /api/ask/forms:save, after the envelope validates the payload.
JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace": {
      "description": "The group the form belongs to; default the group your sign-in acts for. Walked by the same authority check as every owner door.",
      "type": "string"
    },
    "id": {
      "description": "The form to update. Omit to create one.",
      "type": "string"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "The owner's name for the form; never shown to visitors."
    },
    "type": {
      "type": "string",
      "enum": [
        "inline",
        "popup",
        "flyout",
        "fullscreen",
        "teaser"
      ]
    },
    "status": {
      "description": "Default draft.",
      "type": "string",
      "enum": [
        "draft",
        "live",
        "paused"
      ]
    },
    "list": {
      "description": "The audience list a submit subscribes to.",
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        },
        {
          "type": "null"
        }
      ]
    },
    "config": {
      "description": "heading, body, cta, placeholder, successHeading, successBody, fields {firstName, phone, whatsapp}, smsConsentText, triggers {delaySec, scrollPct, exitIntent, pageContains, showEveryDays, hideForKnown}, ab, variantB {heading, body, cta}, offer {code, text} | null, push. Unset keys take defaults; validated in full by the resolver.",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "name",
    "type"
  ]
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "form": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "list": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "config": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {}
        },
        "createdAt": {
          "type": "number"
        },
        "updatedAt": {
          "type": "number"
        }
      },
      "required": [
        "id",
        "slug",
        "name",
        "type",
        "status",
        "list",
        "config",
        "createdAt",
        "updatedAt"
      ]
    },
    "error": {
      "description": "forbidden · no_db · bad_request · offer_code_unknown · too_many · not_found",
      "type": "string"
    },
    "detail": {
      "type": "string"
    }
  },
  "required": [
    "ok"
  ]
}