Skip to main content
1

Create a Website form key

In Marro, open Settings → Connections → API keys → New key → Website form. Copy the key.
2

Store the key on your website's server

Save it as an environment variable, for example MARRO_API_KEY. In WordPress, define it in wp-config.php.
3

Send each enquiry from your server

Your form posts to your own website’s server (a route handler, a server action or a PHP handler). The server sends the enquiry to Marro with the key, using the code below. name and phone are required.
4

Add your own fields

Send other details in fields, using the field keys shown in Settings → Leads → Lead fields or returned by List lead fields.
5

Test it

Submit your form once and check that the lead appears in Marro, with the enquiry on its timeline.
Never call the API from browser JavaScript. Anyone could read the key from the page.
Capture a lead: POST /api/v1/leads/capture For website and landing-page forms. Adds the enquiry as a new lead, or, when the organization already has a lead with this phone number or email (matched ignoring case), fills in that lead instead: only fields it has empty are filled, and values that differ from what your team entered are kept and listed on the lead’s timeline. The owner, stage and pipeline of an existing lead are never changed, and an archived lead is not changed at all (the enquiry is noted on its timeline). A new lead starts in the starting stage and gets an owner from the organization’s assignment rules. Every capture is recorded on the lead’s timeline, naming the API key that sent it. Server to server only: call it from your website’s server (a route handler, a server action, PHP), never from browser JavaScript, where the key would be visible to anyone. There is no CORS support on purpose. Retries are safe: send an Idempotency-Key header (or an externalId), and a repeat within 24 hours returns the first result without capturing again. Scope: leads.capture or leads.write.

Code

Request body

Headers

Responses