myb-p-web2lead-web2tablelisted
Install: claude install-skill AviMYB/mybusiness-plugins
# Web Form → CRM Integration (`web2lead` / `web2table`)
Generate code that POSTs an external HTML form to one of two MyBusiness CRM cloud functions:
| Endpoint | Creates | Use when |
|---|---|---|
| **`web2lead`** | A new row in `Accounts` only, with `IsAccount: false` (Lead) | The form captures a contact only — no sale, case, or other linked record |
| **`web2table`** | A row in any target table (Sales, Cases, Orders, custom tables…) **AND** an Account if the contact is new | The form needs to create a linked record (e.g., a sale, a case, a course enrollment) tied to a contact |
Both endpoints:
- POST JSON to `https://api.mbapps.co.il/functions/{appId}/{endpoint}`
- Require the header `X-Parse-Application-Id: {appId}`
- Handle duplicate-contact detection on the server side
- Are gated by a Config-table flag (403 if disabled) — `AcceptWebLeads` gates `web2lead`, **`AcceptWebToTable`** gates `web2table` (verified in the deployed code)
`web2sale`, `web2case`, etc. mentioned in customer requests are **not separate endpoints** — they are `web2table` with `table: "Sales"` / `"Cases"` / etc. Use `web2table` for all "create a record in X" requests.
## Pre-setup — the `AcceptWebLeads` / `AcceptWebToTable` Config rows (one-time, per customer)
Each endpoint reads its own row in the system `Config` table: `web2lead` requires an enabled `AcceptWebLeads` row; `web2table` requires an enabled **`AcceptWebToTable`** row (verified in the deployed code). If the relevant row is missing or