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.
An organization API key, created in Settings → Integrations → API keys. Keys start with mk_live_. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: objects.records.read (Read custom objects), objects.records.write (Create and update custom-object records), objects.records.delete (Delete custom-object records), leads.read (Read leads), leads.write (Create and update leads), leads.capture (Capture leads), crm.records.read (Read customers and opportunities), crm.records.write (Create and update customers and opportunities), reports.read (Read reports), money.read (Read products, quotes, invoices and payments), money.write (Create quotes and invoices and record payments), agent.tools (AI agent tools (MCP)).
Scopes
leads.capture
leads.write
Headers
Idempotency-Key
string
Optional. A unique value per submission, such as a UUID; remembered per API key. A retry with the same key within 24 hours returns the first result, with Idempotent-Replayed: true; the same key with a different body is refused.
Required string length: 1 - 200
Body
application/json
name
string
required
The person’s name.
Required string length: 1 - 200
phone
string
required
With the country code, e.g. +919812345678. Numbers without one are read as Indian. Used, with email, to find a lead the organization already has.
Required string length: 6 - 32
email
string
Also used to find an existing lead when the phone number does not match one.
Maximum string length: 254
source
string
The source’s name, e.g. "Website" (the default) or "Google Ads". It must be one of the organization’s active sources (matched ignoring case; list them with GET /api/v1/lead-sources). Any other name is recorded as "Website", so a website key cannot fill the organization’s source list.
Required string length: 1 - 60
pipelineId
integer
For a new lead, the pipeline it starts in (IDs from GET /api/v1/pipelines); it lands in that pipeline’s starting stage. Defaults to the organization’s default pipeline. Never moves an existing lead.
Required range: x <= 2147483647
notes
string
Free text shown on the lead’s timeline with this enquiry, such as the visitor’s message.
Maximum string length: 5000
fields
object
More details, by field key: the organization’s built-in and custom lead fields (GET /api/v1/lead-fields). Values are checked with the same rules as the CRM’s forms: dropdowns take one of their options (value or label), numbers, dates (YYYY-MM-DD) and yes/no fields are parsed. An unknown key is refused with the list of valid keys. On an existing lead only empty fields are filled.
Show child attributes
attribution
object
Where the enquiry came from. Shown on the lead’s timeline.
Show child attributes
externalId
string
Your own ID for this submission. A resend with the same externalId (per API key) within 24 hours returns the first result instead of capturing again.
Required string length: 1 - 200
Response
The organization already had this lead; it was found and any empty fields filled in. Location points at it.
lead
object
required
Show child attributes
⌘I
{"docsConfig":{"theme":"willow","$schema":"https://mintlify.com/docs.json","name":"Marro","description":"How to set up and use Marro, and connect to its API.","colors":{"primary":"#047857","light":"#34d399","dark":"#047857"},"logo":{"light":"https://mintcdn.com/marro/L_ff4QIYNuKFkgUx/logo/light.svg?fit=max\u0026auto=format\u0026n=L_ff4QIYNuKFkgUx\u0026q=85\u0026s=3b6108c447441cf9e27b14912873f0ac","dark":"https://mintcdn.com/marro/L_ff4QIYNuKFkgUx/logo/dark.svg?fit=max\u0026auto=format\u0026n=L_ff4QIYNuKFkgUx\u0026q=85\u0026s=1e2a582df4590b0c2af338ff6d625369","href":"https://marro.si"},"favicon":"https://mintcdn.com/marro/L_ff4QIYNuKFkgUx/favicon.svg?fit=max\u0026auto=format\u0026n=L_ff4QIYNuKFkgUx\u0026q=85\u0026s=a6d96cfda52d766e5a462d9d1fe64b99","api":{"playground":{"display":"interactive"},"examples":{"languages":["bash","javascript","php","python"]}},"appearance":{"default":"system"},"navbar":{"primary":{"type":"button","label":"Open Marro","href":"https://app.marro.si"}},"fonts":{"family":"Plus Jakarta Sans"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"marro","hasAudioNarration":false,"actualSubdomain":"marro","customDomains":["docs.marro.si"],"gitSource":{"type":"github","owner":"bharathvasireddy","repo":"marro-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b021102f1d57ff81b93602a","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API reference","count":68},{"language":"default","tag":"Guides","count":65},{"language":"default","tag":"Use Marro","count":50},{"language":"default","tag":"Custom objects","count":15},{"language":"default","tag":"Money","count":15},{"language":"default","tag":"Leads","count":11},{"language":"default","tag":"Customers","count":10},{"language":"default","tag":"Reference","count":10},{"language":"default","tag":"API","count":7},{"language":"default","tag":"Get started","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"api-reference/leads/capture-a-lead","slug":"/api-reference/leads/capture-a-lead","pageMetadata":{"title":"Capture a lead","description":"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.\n\nServer 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.\n\nRetries are safe: send an `Idempotency-Key` header (or an `externalId`), and a repeat within 24 hours returns the first result without capturing again.\n\nScope: `leads.capture` or `leads.write`.","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/leads/capture","href":"/api-reference/leads/capture-a-lead","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"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.\"\n }), \"\\n\", _jsx(_components.p, {\n children: \"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.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Retries are safe: send an \", _jsx(_components.code, {\n children: \"Idempotency-Key\"\n }), \" header (or an \", _jsx(_components.code, {\n children: \"externalId\"\n }), \"), and a repeat within 24 hours returns the first result without capturing again.\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Scope: \", _jsx(_components.code, {\n children: \"leads.capture\"\n }), \" or \", _jsx(_components.code, {\n children: \"leads.write\"\n }), \".\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Capture a lead","description":"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.\n\nServer 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.\n\nRetries are safe: send an `Idempotency-Key` header (or an `externalId`), and a repeat within 24 hours returns the first result without capturing again.\n\nScope: `leads.capture` or `leads.write`.","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/leads/capture","href":"/api-reference/leads/capture-a-lead","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"capture-lead","tags":["Leads"],"summary":"Capture a lead","description":"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.\n\nServer 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.\n\nRetries are safe: send an `Idempotency-Key` header (or an `externalId`), and a repeat within 24 hours returns the first result without capturing again.\n\nScope: `leads.capture` or `leads.write`.","security":["835ef047-672c-4b20-832d-2f81d3de68ee","26fd3e14-049e-48d9-9027-e2da45999755"],"parameters":["cb5febfa-407d-4440-802b-a212e94bcbe4"],"requestBody":"80d30959-f3ec-45ee-9f0e-7785206d9c7f","responses":{"200":"de9f29a2-ec34-4490-a077-037aaa7f6bd9","201":"606aa587-9b81-449e-98b5-1245be70329e","400":"9d8de752-959f-445d-a4e2-4aa7cd908926","401":"a7420610-a1b5-499b-9f76-1fa78752ddf1","403":"fddd3a16-572b-4862-a1b9-f836cb9660f2","409":"ac1306f7-1094-468a-a07c-42fb9b50a61e","422":"75916657-cd01-4467-9d77-cf5655c1e21a","429":"8fa424c3-71e6-41ec-8291-cf245ef38fed","500":"e01eb200-035f-47ba-8024-a0df57c981df","503":"ba7ad411-63f3-4bfc-b3bf-f3253e325c7f"},"x-codeSamples":[{"lang":"typescript","label":"Next.js","source":"// app/api/enquiry/route.ts on your website. It runs on the server, so the key stays secret.\n// Your form posts to /api/enquiry; this sends the enquiry on to the CRM.\nexport async function POST(request: Request) {\n const form = await request.json();\n // One ID per submission. Send the same one again if you retry, and the CRM captures it once.\n const submissionId = form.submissionId ?? crypto.randomUUID();\n\n const response = await fetch(\"https://app.marro.si/api/v1/leads/capture\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${process.env.CRM_API_KEY}`,\n \"Content-Type\": \"application/json\",\n \"Idempotency-Key\": submissionId,\n },\n body: JSON.stringify({\n name: form.name,\n phone: form.phone,\n email: form.email,\n source: \"Website\",\n fields: {\n \"city\": form.city,\n \"interest\": form.interest,\n },\n attribution: {\n pageUrl: form.pageUrl,\n referrer: form.referrer,\n formName: \"Contact form\",\n },\n }),\n signal: AbortSignal.timeout(10_000),\n });\n\n if (!response.ok) {\n // Keep the enquiry (a sheet, a database row, an email) and retry later with the same\n // submissionId, so no lead is lost while the CRM cannot be reached.\n console.error(\"CRM capture failed\", response.status, await response.text());\n }\n return Response.json({ ok: true });\n}"},{"lang":"php","label":"PHP / WordPress","source":"\u003c?php\n// In wp-config.php (never in a theme file anyone can read, never in JavaScript):\n// define('CRM_API_KEY', 'mk_live_...');\n\n$response = wp_remote_post('https://app.marro.si/api/v1/leads/capture', [\n 'timeout' => 10,\n 'headers' => [\n 'Authorization' => 'Bearer ' . CRM_API_KEY,\n 'Content-Type' => 'application/json',\n // One ID per submission; reuse it if you retry and the CRM captures it once.\n 'Idempotency-Key' => wp_generate_uuid4(),\n ],\n 'body' => wp_json_encode([\n 'name' => sanitize_text_field($_POST['name'] ?? ''),\n 'phone' => sanitize_text_field($_POST['phone'] ?? ''),\n 'email' => sanitize_email($_POST['email'] ?? ''),\n 'source' => 'Website',\n 'fields' => [\n 'city' => sanitize_text_field($_POST['city'] ?? ''),\n 'interest' => sanitize_text_field($_POST['interest'] ?? ''),\n ],\n 'attribution' => [\n 'pageUrl' => esc_url_raw(wp_get_referer() ?: ''),\n 'formName' => 'Contact form',\n ],\n ]),\n]);\n\nif (is_wp_error($response) || wp_remote_retrieve_response_code($response) >= 300) {\n // Keep the enquiry (for example, email it to yourself) so no lead is lost.\n error_log('CRM capture failed: ' . (is_wp_error($response) ? $response->get_error_message() : wp_remote_retrieve_body($response)));\n}"},{"lang":"bash","label":"cURL","source":"curl -X POST \"https://app.marro.si/api/v1/leads/capture\" \\\n -H \"Authorization: Bearer $CRM_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Idempotency-Key: $(uuidgen)\" \\\n -d '{\n \"name\": \"Priya Sharma\",\n \"phone\": \"+919812345678\",\n \"email\": \"priya@example.com\",\n \"source\": \"Website\",\n \"fields\": {\n \"city\": \"Hyderabad\",\n \"interest\": \"Premium plan\"\n },\n \"attribution\": {\n \"pageUrl\": \"https://www.example.com/contact\",\n \"formName\": \"Contact form\"\n }\n}'"}],"method":"post","type":"path","servers":["60848520-e473-4db4-a179-31ff5d813f42"],"path":"/api/v1/leads/capture","baseUrlOptions":["https://app.marro.si"],"title":"Capture a lead","codeSamples":[{"label":"Next.js","lang":"typescript","source":"// app/api/enquiry/route.ts on your website. It runs on the server, so the key stays secret.\n// Your form posts to /api/enquiry; this sends the enquiry on to the CRM.\nexport async function POST(request: Request) {\n const form = await request.json();\n // One ID per submission. Send the same one again if you retry, and the CRM captures it once.\n const submissionId = form.submissionId ?? crypto.randomUUID();\n\n const response = await fetch(\"https://app.marro.si/api/v1/leads/capture\", {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${process.env.CRM_API_KEY}`,\n \"Content-Type\": \"application/json\",\n \"Idempotency-Key\": submissionId,\n },\n body: JSON.stringify({\n name: form.name,\n phone: form.phone,\n email: form.email,\n source: \"Website\",\n fields: {\n \"city\": form.city,\n \"interest\": form.interest,\n },\n attribution: {\n pageUrl: form.pageUrl,\n referrer: form.referrer,\n formName: \"Contact form\",\n },\n }),\n signal: AbortSignal.timeout(10_000),\n });\n\n if (!response.ok) {\n // Keep the enquiry (a sheet, a database row, an email) and retry later with the same\n // submissionId, so no lead is lost while the CRM cannot be reached.\n console.error(\"CRM capture failed\", response.status, await response.text());\n }\n return Response.json({ ok: true });\n}"},{"label":"PHP / WordPress","lang":"php","source":"\u003c?php\n// In wp-config.php (never in a theme file anyone can read, never in JavaScript):\n// define('CRM_API_KEY', 'mk_live_...');\n\n$response = wp_remote_post('https://app.marro.si/api/v1/leads/capture', [\n 'timeout' => 10,\n 'headers' => [\n 'Authorization' => 'Bearer ' . CRM_API_KEY,\n 'Content-Type' => 'application/json',\n // One ID per submission; reuse it if you retry and the CRM captures it once.\n 'Idempotency-Key' => wp_generate_uuid4(),\n ],\n 'body' => wp_json_encode([\n 'name' => sanitize_text_field($_POST['name'] ?? ''),\n 'phone' => sanitize_text_field($_POST['phone'] ?? ''),\n 'email' => sanitize_email($_POST['email'] ?? ''),\n 'source' => 'Website',\n 'fields' => [\n 'city' => sanitize_text_field($_POST['city'] ?? ''),\n 'interest' => sanitize_text_field($_POST['interest'] ?? ''),\n ],\n 'attribution' => [\n 'pageUrl' => esc_url_raw(wp_get_referer() ?: ''),\n 'formName' => 'Contact form',\n ],\n ]),\n]);\n\nif (is_wp_error($response) || wp_remote_retrieve_response_code($response) >= 300) {\n // Keep the enquiry (for example, email it to yourself) so no lead is lost.\n error_log('CRM capture failed: ' . (is_wp_error($response) ? $response->get_error_message() : wp_remote_retrieve_body($response)));\n}"},{"label":"cURL","lang":"bash","source":"curl -X POST \"https://app.marro.si/api/v1/leads/capture\" \\\n -H \"Authorization: Bearer $CRM_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Idempotency-Key: $(uuidgen)\" \\\n -d '{\n \"name\": \"Priya Sharma\",\n \"phone\": \"+919812345678\",\n \"email\": \"priya@example.com\",\n \"source\": \"Website\",\n \"fields\": {\n \"city\": \"Hyderabad\",\n \"interest\": \"Premium plan\"\n },\n \"attribution\": {\n \"pageUrl\": \"https://www.example.com/contact\",\n \"formName\": \"Contact form\"\n }\n}'"}],"requestExampleLanguages":["bash","javascript","php","python"],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"cb5febfa-407d-4440-802b-a212e94bcbe4":{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. A unique value per submission, such as a UUID; remembered per API key. A retry with the same key within 24 hours returns the first result, with `Idempotent-Replayed: true`; the same key with a different body is refused.","schema":{"type":"string","minLength":1,"maxLength":200,"isRequired":false,"description":"Optional. A unique value per submission, such as a UUID; remembered per API key. A retry with the same key within 24 hours returns the first result, with `Idempotent-Replayed: true`; the same key with a different body is refused.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"The person’s name.","isRequired":true,"uniqueKey":"name","typeLabel":"string"},"phone":{"type":"string","minLength":6,"maxLength":32,"description":"With the country code, e.g. +919812345678. Numbers without one are read as Indian. Used, with email, to find a lead the organization already has.","isRequired":true,"uniqueKey":"phone","typeLabel":"string"},"email":{"description":"Also used to find an existing lead when the phone number does not match one.","type":"string","maxLength":254,"uniqueKey":"email","typeLabel":"string"},"source":{"description":"The source’s name, e.g. \"Website\" (the default) or \"Google Ads\". It must be one of the organization’s active sources (matched ignoring case; list them with GET /api/v1/lead-sources). Any other name is recorded as \"Website\", so a website key cannot fill the organization’s source list.","type":"string","minLength":1,"maxLength":60,"uniqueKey":"source","typeLabel":"string"},"pipelineId":{"description":"For a new lead, the pipeline it starts in (IDs from GET /api/v1/pipelines); it lands in that pipeline’s starting stage. Defaults to the organization’s default pipeline. Never moves an existing lead.","type":"integer","exclusiveMinimum":0,"maximum":2147483647,"uniqueKey":"pipelineId","typeLabel":"integer"},"notes":{"description":"Free text shown on the lead’s timeline with this enquiry, such as the visitor’s message.","type":"string","maxLength":5000,"uniqueKey":"notes","typeLabel":"string"},"fields":{"description":"More details, by field key: the organization’s built-in and custom lead fields (GET /api/v1/lead-fields). Values are checked with the same rules as the CRM’s forms: dropdowns take one of their options (value or label), numbers, dates (YYYY-MM-DD) and yes/no fields are parsed. An unknown key is refused with the list of valid keys. On an existing lead only empty fields are filled.","type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"oneOf":[{"type":"string","uniqueKey":"fields.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"fields.additionalProperties.oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"fields.additionalProperties.oneOf.2","typeLabel":"boolean"},{"type":"array","items":{"type":"string","uniqueKey":"fields.additionalProperties.oneOf.3.items.[INDEX]","typeLabel":"string"},"uniqueKey":"fields.additionalProperties.oneOf.3","typeLabel":"string[]"},{"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647,"uniqueKey":"fields.additionalProperties.oneOf.4.items.[INDEX]","typeLabel":"integer"},"maxItems":20,"uniqueKey":"fields.additionalProperties.oneOf.4","typeLabel":"integer[]"},{"type":"null","uniqueKey":"fields.additionalProperties.oneOf.5","typeLabel":"null"}],"uniqueKey":"fields.additionalProperties","typeLabel":"string | number | boolean | string[] | integer[] | null"},"uniqueKey":"fields","typeLabel":"object"},"attribution":{"type":"object","properties":{"pageUrl":{"description":"The full address of the page the form was on, with its query string.","type":"string","maxLength":2000,"uniqueKey":"attribution.pageUrl","typeLabel":"string"},"pageTitle":{"type":"string","maxLength":300,"uniqueKey":"attribution.pageTitle","typeLabel":"string"},"referrer":{"description":"The page the visitor came from (document.referrer).","type":"string","maxLength":2000,"uniqueKey":"attribution.referrer","typeLabel":"string"},"utmSource":{"type":"string","maxLength":200,"uniqueKey":"attribution.utmSource","typeLabel":"string"},"utmMedium":{"type":"string","maxLength":200,"uniqueKey":"attribution.utmMedium","typeLabel":"string"},"utmCampaign":{"type":"string","maxLength":200,"uniqueKey":"attribution.utmCampaign","typeLabel":"string"},"utmTerm":{"type":"string","maxLength":200,"uniqueKey":"attribution.utmTerm","typeLabel":"string"},"utmContent":{"type":"string","maxLength":200,"uniqueKey":"attribution.utmContent","typeLabel":"string"},"formName":{"description":"Which form or button on the site, e.g. \"Footer enquiry\".","type":"string","maxLength":200,"uniqueKey":"attribution.formName","typeLabel":"string"}},"additionalProperties":false,"description":"Where the enquiry came from. Shown on the lead’s timeline.","uniqueKey":"attribution","typeLabel":"object"},"externalId":{"description":"Your own ID for this submission. A resend with the same externalId (per API key) within 24 hours returns the first result instead of capturing again.","type":"string","minLength":1,"maxLength":200,"uniqueKey":"externalId","typeLabel":"string"}},"required":["name","phone"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"name":"Priya Sharma","phone":"+919812345678","email":"priya@example.com","source":"Website","notes":"Wants to know the fee structure for 2027.","fields":{"city":"Hyderabad","state":"Telangana","interest":"Premium plan","preferred_time":"evening"},"attribution":{"pageUrl":"https://www.example.com/pricing?utm_source=google\u0026utm_medium=cpc","pageTitle":"Pricing","referrer":"https://www.google.com/","utmSource":"google","utmMedium":"cpc","utmCampaign":"spring-2027","formName":"Footer enquiry"},"externalId":"web-48213"},"examples":{"Example":{"title":"Example","value":{"name":"Priya Sharma","phone":"+919812345678","email":"priya@example.com","source":"Website","notes":"Wants to know the fee structure for 2027.","fields":{"city":"Hyderabad","state":"Telangana","interest":"Premium plan","preferred_time":"evening"},"attribution":{"pageUrl":"https://www.example.com/pricing?utm_source=google\u0026utm_medium=cpc","pageTitle":"Pricing","referrer":"https://www.google.com/","utmSource":"google","utmMedium":"cpc","utmCampaign":"spring-2027","formName":"Footer enquiry"},"externalId":"web-48213"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"de9f29a2-ec34-4490-a077-037aaa7f6bd9":{"description":"The organization already had this lead; it was found and any empty fields filled in. `Location` points at it.","content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647,"description":"The lead’s ID, new or existing.","isRequired":true,"uniqueKey":"lead.id","typeLabel":"integer"},"created":{"type":"boolean","description":"True when a new lead was created.","isRequired":true,"uniqueKey":"lead.created","typeLabel":"boolean"},"updated":{"type":"boolean","description":"True when an existing lead was found and at least one empty field on it was filled.","isRequired":true,"uniqueKey":"lead.updated","typeLabel":"boolean"},"archived":{"description":"Present when the person matched an archived lead: nothing on it was changed, the enquiry was noted on its timeline, and there is no `Location`.","type":"boolean","const":true,"uniqueKey":"lead.archived","typeLabel":"boolean"}},"required":["id","created","updated"],"additionalProperties":false,"isRequired":true,"uniqueKey":"lead","typeLabel":"object"}},"required":["lead"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"lead":{"id":123,"created":true,"updated":true,"archived":true}}}},"exampleType":"generated"}},"exampleType":"generated"},"606aa587-9b81-449e-98b5-1245be70329e":{"description":"A new lead was created. `Location` points at it.","content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647,"description":"The lead’s ID, new or existing.","isRequired":true,"uniqueKey":"lead.id","typeLabel":"integer"},"created":{"type":"boolean","description":"True when a new lead was created.","isRequired":true,"uniqueKey":"lead.created","typeLabel":"boolean"},"updated":{"type":"boolean","description":"True when an existing lead was found and at least one empty field on it was filled.","isRequired":true,"uniqueKey":"lead.updated","typeLabel":"boolean"},"archived":{"description":"Present when the person matched an archived lead: nothing on it was changed, the enquiry was noted on its timeline, and there is no `Location`.","type":"boolean","const":true,"uniqueKey":"lead.archived","typeLabel":"boolean"}},"required":["id","created","updated"],"additionalProperties":false,"isRequired":true,"uniqueKey":"lead","typeLabel":"object"}},"required":["lead"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"example":{"lead":{"id":1842,"created":true,"updated":false}},"examples":{"Example":{"title":"Example","value":{"lead":{"id":1842,"created":true,"updated":false}}}},"exampleType":"examples"}},"exampleType":"examples"},"9d8de752-959f-445d-a4e2-4aa7cd908926":{"description":"INVALID_IDEMPOTENCY_KEY: The Idempotency-Key header is longer than 200 characters or not plain ASCII.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"a7420610-a1b5-499b-9f76-1fa78752ddf1":{"description":"UNAUTHORIZED: The key is missing, wrong, revoked or expired.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"fddd3a16-572b-4862-a1b9-f836cb9660f2":{"description":"FORBIDDEN: The key lacks the scope, or the organization’s plan does not include it.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"ac1306f7-1094-468a-a07c-42fb9b50a61e":{"description":"IDEMPOTENCY_IN_PROGRESS: A request with this Idempotency-Key is still being handled. Retry in a few seconds. Another request saved the same person at the same moment. Retry; it will find that lead.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"75916657-cd01-4467-9d77-cf5655c1e21a":{"description":"VALIDATION_FAILED: A value is missing or invalid, a key in `fields` is not one of the organization’s active fields (`details.validKeys` lists them), or a field the organization requires for a new lead is missing. This Idempotency-Key was used within 24 hours for a different body. `pipelineId` is not one of the organization’s pipelines. `pipelineId` (or the stage’s pipeline) is for opportunities only.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"8fa424c3-71e6-41ec-8291-cf245ef38fed":{"description":"RATE_LIMITED: More than 600 requests in an hour with this key, or 3000 with all of the organization’s keys together. `Retry-After` says how many seconds to wait.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"e01eb200-035f-47ba-8024-a0df57c981df":{"description":"INTERNAL: Something failed on our side. Retry; if it persists, contact support quoting the `X-Request-Id` response header.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"},"ba7ad411-63f3-4bfc-b3bf-f3253e325c7f":{"description":"NOT_READY: The organization has no stage for new leads, or no active user to own them. Retry after it is set up.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND, VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A sentence for people.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"description":"For VALIDATION_FAILED, `fields` maps each field key to its problem.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"oneOf":[{}],"uniqueKey":"error.details.additionalProperties","typeLabel":"any"},"uniqueKey":"error.details","typeLabel":"object"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"\u003cstring>","message":"\u003cstring>","details":{}}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"835ef047-672c-4b20-832d-2f81d3de68ee":{"ApiKey":{"type":"http","scheme":"bearer","description":"An organization API key, created in Settings → Integrations → API keys. Keys start with `mk_live_`. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: `objects.records.read` (Read custom objects), `objects.records.write` (Create and update custom-object records), `objects.records.delete` (Delete custom-object records), `leads.read` (Read leads), `leads.write` (Create and update leads), `leads.capture` (Capture leads), `crm.records.read` (Read customers and opportunities), `crm.records.write` (Create and update customers and opportunities), `reports.read` (Read reports), `money.read` (Read products, quotes, invoices and payments), `money.write` (Create quotes and invoices and record payments), `agent.tools` (AI agent tools (MCP)).","x-scopes":{"objects.records.read":{"label":"Read custom objects","description":"Read definitions and records within the key creator’s current per-object access.","module":"objects"},"objects.records.write":{"label":"Create and update custom-object records","description":"Create and edit within current per-object grants. Needs objects.records.read.","module":"objects"},"objects.records.delete":{"label":"Delete custom-object records","description":"Permanently delete with current object delete grant, version and exact title. Needs objects.records.read.","module":"objects"},"leads.read":{"label":"Read leads","description":"Leads with every field, and the lists that describe them: fields, stages, sources and people.","module":"leads"},"leads.write":{"label":"Create and update leads","description":"Create leads, change their fields, stage and owner, and add notes. Needs leads.read.","module":"leads"},"leads.capture":{"label":"Capture leads","description":"Capture leads from a website or form: add a lead or update the existing one with the same phone or email. Cannot read, list or change anything else.","module":"leads"},"crm.records.read":{"label":"Read customers and opportunities","description":"Read contacts, companies and enabled opportunities, including their custom fields.","module":"customers"},"crm.records.write":{"label":"Create and update customers and opportunities","description":"Create and update contacts, companies and enabled opportunities with validated custom fields. Needs crm.records.read.","module":"customers"},"reports.read":{"label":"Read reports","description":"List the custom reports shared with everyone in the organization and read their figures for any period.","module":"reports.custom"},"money.read":{"label":"Read products, quotes, invoices and payments","description":"Read the product catalogue, quotes and GST invoices with their lines and totals, and payments received.","module":"finance.quotes"},"money.write":{"label":"Create quotes and invoices and record payments","description":"Create quotes and invoices (as drafts, or issued with their number) and record payments against invoices. Needs money.read.","module":"finance.quotes"},"agent.tools":{"label":"AI agent tools (MCP)","description":"Connect another AI agent over MCP: find and read leads, see what your agents may do, and ask Marro's agent to act on a lead within your agents' permissions.","module":"ai.agents"}},"x-key-types":[{"name":"Website form","scopes":["leads.capture"],"lifetimeDays":730,"description":"A website or landing-page form that sends enquiries in as leads. Can do nothing else."},{"name":"Another application","lifetimeDays":90,"description":"Any other integration. Choose the scopes it needs when you create it."}],"scopes":["leads.capture"],"schemeName":"ApiKey"}},"26fd3e14-049e-48d9-9027-e2da45999755":{"ApiKey":{"type":"http","scheme":"bearer","description":"An organization API key, created in Settings → Integrations → API keys. Keys start with `mk_live_`. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: `objects.records.read` (Read custom objects), `objects.records.write` (Create and update custom-object records), `objects.records.delete` (Delete custom-object records), `leads.read` (Read leads), `leads.write` (Create and update leads), `leads.capture` (Capture leads), `crm.records.read` (Read customers and opportunities), `crm.records.write` (Create and update customers and opportunities), `reports.read` (Read reports), `money.read` (Read products, quotes, invoices and payments), `money.write` (Create quotes and invoices and record payments), `agent.tools` (AI agent tools (MCP)).","x-scopes":{"objects.records.read":{"label":"Read custom objects","description":"Read definitions and records within the key creator’s current per-object access.","module":"objects"},"objects.records.write":{"label":"Create and update custom-object records","description":"Create and edit within current per-object grants. Needs objects.records.read.","module":"objects"},"objects.records.delete":{"label":"Delete custom-object records","description":"Permanently delete with current object delete grant, version and exact title. Needs objects.records.read.","module":"objects"},"leads.read":{"label":"Read leads","description":"Leads with every field, and the lists that describe them: fields, stages, sources and people.","module":"leads"},"leads.write":{"label":"Create and update leads","description":"Create leads, change their fields, stage and owner, and add notes. Needs leads.read.","module":"leads"},"leads.capture":{"label":"Capture leads","description":"Capture leads from a website or form: add a lead or update the existing one with the same phone or email. Cannot read, list or change anything else.","module":"leads"},"crm.records.read":{"label":"Read customers and opportunities","description":"Read contacts, companies and enabled opportunities, including their custom fields.","module":"customers"},"crm.records.write":{"label":"Create and update customers and opportunities","description":"Create and update contacts, companies and enabled opportunities with validated custom fields. Needs crm.records.read.","module":"customers"},"reports.read":{"label":"Read reports","description":"List the custom reports shared with everyone in the organization and read their figures for any period.","module":"reports.custom"},"money.read":{"label":"Read products, quotes, invoices and payments","description":"Read the product catalogue, quotes and GST invoices with their lines and totals, and payments received.","module":"finance.quotes"},"money.write":{"label":"Create quotes and invoices and record payments","description":"Create quotes and invoices (as drafts, or issued with their number) and record payments against invoices. Needs money.read.","module":"finance.quotes"},"agent.tools":{"label":"AI agent tools (MCP)","description":"Connect another AI agent over MCP: find and read leads, see what your agents may do, and ask Marro's agent to act on a lead within your agents' permissions.","module":"ai.agents"}},"x-key-types":[{"name":"Website form","scopes":["leads.capture"],"lifetimeDays":730,"description":"A website or landing-page form that sends enquiries in as leads. Can do nothing else."},{"name":"Another application","lifetimeDays":90,"description":"Any other integration. Choose the scopes it needs when you create it."}],"scopes":["leads.write"],"schemeName":"ApiKey"}}},"servers":{"60848520-e473-4db4-a179-31ff5d813f42":{"url":"https://app.marro.si"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An organization API key, created in Settings → Integrations → API keys. Keys start with `mk_live_`. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: `objects.records.read` (Read custom objects), `objects.records.write` (Create and update custom-object records), `objects.records.delete` (Delete custom-object records), `leads.read` (Read leads), `leads.write` (Create and update leads), `leads.capture` (Capture leads), `crm.records.read` (Read customers and opportunities), `crm.records.write` (Create and update customers and opportunities), `reports.read` (Read reports), `money.read` (Read products, quotes, invoices and payments), `money.write` (Create quotes and invoices and record payments), `agent.tools` (AI agent tools (MCP)).","x-scopes":{"objects.records.read":{"label":"Read custom objects","description":"Read definitions and records within the key creator’s current per-object access.","module":"objects"},"objects.records.write":{"label":"Create and update custom-object records","description":"Create and edit within current per-object grants. Needs objects.records.read.","module":"objects"},"objects.records.delete":{"label":"Delete custom-object records","description":"Permanently delete with current object delete grant, version and exact title. Needs objects.records.read.","module":"objects"},"leads.read":{"label":"Read leads","description":"Leads with every field, and the lists that describe them: fields, stages, sources and people.","module":"leads"},"leads.write":{"label":"Create and update leads","description":"Create leads, change their fields, stage and owner, and add notes. Needs leads.read.","module":"leads"},"leads.capture":{"label":"Capture leads","description":"Capture leads from a website or form: add a lead or update the existing one with the same phone or email. Cannot read, list or change anything else.","module":"leads"},"crm.records.read":{"label":"Read customers and opportunities","description":"Read contacts, companies and enabled opportunities, including their custom fields.","module":"customers"},"crm.records.write":{"label":"Create and update customers and opportunities","description":"Create and update contacts, companies and enabled opportunities with validated custom fields. Needs crm.records.read.","module":"customers"},"reports.read":{"label":"Read reports","description":"List the custom reports shared with everyone in the organization and read their figures for any period.","module":"reports.custom"},"money.read":{"label":"Read products, quotes, invoices and payments","description":"Read the product catalogue, quotes and GST invoices with their lines and totals, and payments received.","module":"finance.quotes"},"money.write":{"label":"Create quotes and invoices and record payments","description":"Create quotes and invoices (as drafts, or issued with their number) and record payments against invoices. Needs money.read.","module":"finance.quotes"},"agent.tools":{"label":"AI agent tools (MCP)","description":"Connect another AI agent over MCP: find and read leads, see what your agents may do, and ask Marro's agent to act on a lead within your agents' permissions.","module":"ai.agents"}},"x-key-types":[{"name":"Website form","scopes":["leads.capture"],"lifetimeDays":730,"description":"A website or landing-page form that sends enquiries in as leads. Can do nothing else."},{"name":"Another application","lifetimeDays":90,"description":"Any other integration. Choose the scopes it needs when you create it."}],"scopes":["leads.capture"],"schemeName":"ApiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An organization API key, created in Settings → Integrations → API keys. Keys start with `mk_live_`. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: `objects.records.read` (Read custom objects), `objects.records.write` (Create and update custom-object records), `objects.records.delete` (Delete custom-object records), `leads.read` (Read leads), `leads.write` (Create and update leads), `leads.capture` (Capture leads), `crm.records.read` (Read customers and opportunities), `crm.records.write` (Create and update customers and opportunities), `reports.read` (Read reports), `money.read` (Read products, quotes, invoices and payments), `money.write` (Create quotes and invoices and record payments), `agent.tools` (AI agent tools (MCP)).","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An organization API key, created in Settings → Integrations → API keys. Keys start with `mk_live_`. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: `objects.records.read` (Read custom objects), `objects.records.write` (Create and update custom-object records), `objects.records.delete` (Delete custom-object records), `leads.read` (Read leads), `leads.write` (Create and update leads), `leads.capture` (Capture leads), `crm.records.read` (Read customers and opportunities), `crm.records.write` (Create and update customers and opportunities), `reports.read` (Read reports), `money.read` (Read products, quotes, invoices and payments), `money.write` (Create quotes and invoices and record payments), `agent.tools` (AI agent tools (MCP)).","x-scopes":{"objects.records.read":{"label":"Read custom objects","description":"Read definitions and records within the key creator’s current per-object access.","module":"objects"},"objects.records.write":{"label":"Create and update custom-object records","description":"Create and edit within current per-object grants. Needs objects.records.read.","module":"objects"},"objects.records.delete":{"label":"Delete custom-object records","description":"Permanently delete with current object delete grant, version and exact title. Needs objects.records.read.","module":"objects"},"leads.read":{"label":"Read leads","description":"Leads with every field, and the lists that describe them: fields, stages, sources and people.","module":"leads"},"leads.write":{"label":"Create and update leads","description":"Create leads, change their fields, stage and owner, and add notes. Needs leads.read.","module":"leads"},"leads.capture":{"label":"Capture leads","description":"Capture leads from a website or form: add a lead or update the existing one with the same phone or email. Cannot read, list or change anything else.","module":"leads"},"crm.records.read":{"label":"Read customers and opportunities","description":"Read contacts, companies and enabled opportunities, including their custom fields.","module":"customers"},"crm.records.write":{"label":"Create and update customers and opportunities","description":"Create and update contacts, companies and enabled opportunities with validated custom fields. Needs crm.records.read.","module":"customers"},"reports.read":{"label":"Read reports","description":"List the custom reports shared with everyone in the organization and read their figures for any period.","module":"reports.custom"},"money.read":{"label":"Read products, quotes, invoices and payments","description":"Read the product catalogue, quotes and GST invoices with their lines and totals, and payments received.","module":"finance.quotes"},"money.write":{"label":"Create quotes and invoices and record payments","description":"Create quotes and invoices (as drafts, or issued with their number) and record payments against invoices. Needs money.read.","module":"finance.quotes"},"agent.tools":{"label":"AI agent tools (MCP)","description":"Connect another AI agent over MCP: find and read leads, see what your agents may do, and ask Marro's agent to act on a lead within your agents' permissions.","module":"ai.agents"}},"x-key-types":[{"name":"Website form","scopes":["leads.capture"],"lifetimeDays":730,"description":"A website or landing-page form that sends enquiries in as leads. Can do nothing else."},{"name":"Another application","lifetimeDays":90,"description":"Any other integration. Choose the scopes it needs when you create it."}],"scopes":["leads.write"],"schemeName":"ApiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An organization API key, created in Settings → Integrations → API keys. Keys start with `mk_live_`. Marro stores only a hash of a key, so it is shown once, when it is created: copy it then. Revoking a key ends its access at once. To replace a key without downtime, create the new one, switch your server to it, then revoke the old one. Changes made with a key appear on the lead’s timeline as made by the person who created the key, via the API. Scopes: `objects.records.read` (Read custom objects), `objects.records.write` (Create and update custom-object records), `objects.records.delete` (Delete custom-object records), `leads.read` (Read leads), `leads.write` (Create and update leads), `leads.capture` (Capture leads), `crm.records.read` (Read customers and opportunities), `crm.records.write` (Create and update customers and opportunities), `reports.read` (Read reports), `money.read` (Read products, quotes, invoices and payments), `money.write` (Create quotes and invoices and record payments), `agent.tools` (AI agent tools (MCP)).","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"}]},"originalFileLocation":"openapi.json"},"subdomain":"marro","siteName":"Marro","title":"Capture a lead - Marro","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-20T17:31:14.276Z","originalFileLocation":"api-reference/leads/capture-a-lead.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"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.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Marro\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Capture a lead - Marro\">\u003cmeta data-mint-head property=\"og:description\" content=\"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.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Marro\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.marro.si/api-reference/leads/capture-a-lead\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://marro.mintlify.site/_mintlify/api/og/v2?division=Leads\u0026amp;title=Capture+a+lead\u0026amp;description=For+website+and+landing-page+forms.+Adds+the+enquiry+as+a+new+lead%2C+or%2C+when+the+organization+already+has+a+lead+with+this+phone+number+or+email+%28matched+ignori\u0026amp;theme=d7249f23099e2c2edb8e8ddc\u0026amp;signature=5a0075d8ec1dd4ce4707f19604a7b50df4bc7c65c51c654724a3375f1874ba4d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Capture a lead - Marro\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"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.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://marro.mintlify.site/_mintlify/api/og/v2?division=Leads\u0026amp;title=Capture+a+lead\u0026amp;description=For+website+and+landing-page+forms.+Adds+the+enquiry+as+a+new+lead%2C+or%2C+when+the+organization+already+has+a+lead+with+this+phone+number+or+email+%28matched+ignori\u0026amp;theme=d7249f23099e2c2edb8e8ddc\u0026amp;signature=5a0075d8ec1dd4ce4707f19604a7b50df4bc7c65c51c654724a3375f1874ba4d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/marro/I-0IyWvl5z8txpHY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Marro\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#047857\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.marro.si/api-reference/leads/capture-a-lead\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/leads/capture-a-lead.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.marro.si/#organization\",\"name\":\"Marro\",\"url\":\"https://docs.marro.si\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/marro/L_ff4QIYNuKFkgUx/logo/light.svg?fit=max\u0026auto=format\u0026n=L_ff4QIYNuKFkgUx\u0026q=85\u0026s=3b6108c447441cf9e27b14912873f0ac\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.marro.si#website\",\"name\":\"Marro\",\"url\":\"https://docs.marro.si\",\"publisher\":{\"@id\":\"https://docs.marro.si/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.marro.si/api-reference/leads/capture-a-lead#webpage\",\"url\":\"https://docs.marro.si/api-reference/leads/capture-a-lead\",\"name\":\"Capture a lead\",\"description\":\"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.\",\"dateModified\":\"2026-11-20T17:31:14.276Z\",\"isPartOf\":{\"@id\":\"https://docs.marro.si#website\"},\"breadcrumb\":{\"@id\":\"https://docs.marro.si/api-reference/leads/capture-a-lead#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.marro.si/api-reference/leads/capture-a-lead#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Leads\",\"item\":\"https://docs.marro.si/api-reference/leads/list-leads\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Capture a lead\",\"item\":\"https://docs.marro.si/api-reference/leads/capture-a-lead\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.marro.si/api-reference/leads/capture-a-lead#apireference\",\"headline\":\"Capture a lead\",\"name\":\"Capture a lead\",\"description\":\"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.\",\"url\":\"https://docs.marro.si/api-reference/leads/capture-a-lead\",\"mainEntityOfPage\":{\"@id\":\"https://docs.marro.si/api-reference/leads/capture-a-lead#webpage\"},\"dateModified\":\"2026-11-20T17:31:14.276Z\",\"publisher\":{\"@id\":\"https://docs.marro.si/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.marro.si#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Marro\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Marro\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/leads/capture-a-lead.md","siteName":"Marro","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","groups":[{"group":"Custom objects","pages":[{"title":"List custom objects","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/objects","href":"/api-reference/custom-objects/list-custom-objects"},{"title":"Read a custom-object definition","openapi":"GET /api/v1/objects/{slug}","href":"/api-reference/custom-objects/get-custom-object"},{"title":"List custom-object records","openapi":"GET /api/v1/objects/{slug}/records","href":"/api-reference/custom-objects/list-object-records"},{"title":"Create a custom-object record","openapi":"POST /api/v1/objects/{slug}/records","href":"/api-reference/custom-objects/create-object-record"},{"title":"Read a custom-object record","openapi":"GET /api/v1/objects/{slug}/records/{recordId}","href":"/api-reference/custom-objects/get-object-record"},{"title":"Update a custom-object record","openapi":"PATCH /api/v1/objects/{slug}/records/{recordId}","href":"/api-reference/custom-objects/update-object-record"},{"title":"Delete a custom-object record","openapi":"DELETE /api/v1/objects/{slug}/records/{recordId}","href":"/api-reference/custom-objects/delete-object-record"},{"title":"Records linked to a custom-object record","openapi":"GET /api/v1/objects/{slug}/records/{recordId}/linked-from","href":"/api-reference/custom-objects/object-record-linked-from"}]},{"group":"Reports","pages":[{"title":"List reports","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/reports","href":"/api-reference/reports/list-reports"},{"title":"Run a report","openapi":"GET /api/v1/reports/{reportId}/results","href":"/api-reference/reports/get-report-results"}]},{"group":"Money","pages":[{"title":"List products and services","openapi":"GET /api/v1/products","href":"/api-reference/money/list-products"},{"title":"List quotes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/quotes","href":"/api-reference/money/list-quotes"},{"title":"Create a quote","openapi":"POST /api/v1/quotes","href":"/api-reference/money/create-quote"},{"title":"Read a quote","openapi":"GET /api/v1/quotes/{quoteId}","href":"/api-reference/money/get-quote"},{"title":"List invoices","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices","href":"/api-reference/money/list-invoices"},{"title":"Create a invoice","openapi":"POST /api/v1/invoices","href":"/api-reference/money/create-invoice"},{"title":"Read a invoice","openapi":"GET /api/v1/invoices/{invoiceId}","href":"/api-reference/money/get-invoice"},{"title":"Record a payment","openapi":"POST /api/v1/invoices/{invoiceId}/payments","href":"/api-reference/money/record-invoice-payment"},{"title":"List payments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/payments","href":"/api-reference/money/list-payments"}]},{"group":"Leads","pages":[{"title":"List leads","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/leads","href":"/api-reference/leads/list-leads"},{"title":"Create a lead","openapi":"POST /api/v1/leads","href":"/api-reference/leads/create-lead"},{"title":"Capture a lead","openapi":"POST /api/v1/leads/capture","href":"/api-reference/leads/capture-lead"},{"title":"Get a lead","openapi":"GET /api/v1/leads/{leadId}","href":"/api-reference/leads/get-lead"},{"title":"Update a lead","openapi":"PATCH /api/v1/leads/{leadId}","href":"/api-reference/leads/update-lead"},{"title":"Add a note","openapi":"POST /api/v1/leads/{leadId}/notes","href":"/api-reference/leads/add-note"}]},{"group":"Reference","pages":[{"title":"List lead fields","openapi":"GET /api/v1/lead-fields","href":"/api-reference/reference/list-fields"},{"title":"List stages","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lead-stages","href":"/api-reference/reference/list-stages"},{"title":"List pipelines","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pipelines","href":"/api-reference/reference/list-pipelines"},{"title":"List branches","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/branches","href":"/api-reference/reference/list-branches"},{"title":"List sources","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lead-sources","href":"/api-reference/reference/list-sources"},{"title":"List people","openapi":"GET /api/v1/users","href":"/api-reference/reference/list-users"}]},{"group":"Customers","pages":[{"title":"List customer or opportunity records","openapi":"GET /api/v1/crm/{kind}","href":"/api-reference/customers/list-records"},{"title":"Create a customer or opportunity","openapi":"POST /api/v1/crm/{kind}","href":"/api-reference/customers/create-record"},{"title":"Read a customer or opportunity","openapi":"GET /api/v1/crm/{kind}/{recordId}","href":"/api-reference/customers/read-record"},{"title":"Update a customer or opportunity","openapi":"PATCH /api/v1/crm/{kind}/{recordId}","href":"/api-reference/customers/update-record"},{"title":"List custom record fields","openapi":"GET /api/v1/crm/{kind}/fields","href":"/api-reference/customers/list-record-fields"}]},{"group":"Public billing catalogue","pages":[{"title":"Get published pricing","openapi":"GET /api/public/billing-catalogue","href":"/api-reference/public-billing-catalogue/get-published-billing-catalogue"}]},{"group":"Customer quote access","pages":[{"title":"Read a published customer quote","openapi":"GET /api/public/customer-quotes","href":"/api-reference/customer-quote-access/read-published-customer-quote"},{"title":"Accept or decline a published customer quote","openapi":"POST /api/public/customer-quotes","href":"/api-reference/customer-quote-access/decide-published-customer-quote"}]},{"group":"Custom objects","pages":[{"title":"List custom objects","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/objects","href":"/api-reference/custom-objects/list-custom-objects"},{"title":"Read a custom-object definition","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/objects/{slug}","href":"/api-reference/custom-objects/read-a-custom-object-definition"},{"title":"List custom-object records","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/objects/{slug}/records","href":"/api-reference/custom-objects/list-custom-object-records"},{"title":"Create a custom-object record","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/objects/{slug}/records","href":"/api-reference/custom-objects/create-a-custom-object-record"},{"title":"Read a custom-object record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/objects/{slug}/records/{recordId}","href":"/api-reference/custom-objects/read-a-custom-object-record"},{"title":"Delete a custom-object record","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/objects/{slug}/records/{recordId}","href":"/api-reference/custom-objects/delete-a-custom-object-record"},{"title":"Update a custom-object record","deprecated":null,"version":null,"openapi":"/openapi.json patch /api/v1/objects/{slug}/records/{recordId}","href":"/api-reference/custom-objects/update-a-custom-object-record"},{"title":"Records linked to a custom-object record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/objects/{slug}/records/{recordId}/linked-from","href":"/api-reference/custom-objects/records-linked-to-a-custom-object-record"}]},{"group":"Reports","pages":[{"title":"List reports","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/reports","href":"/api-reference/reports/list-reports"},{"title":"Run a report","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/reports/{reportId}/results","href":"/api-reference/reports/run-a-report"}]},{"group":"Money","pages":[{"title":"List products and services","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/products","href":"/api-reference/money/list-products-and-services"},{"title":"List quotes","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/quotes","href":"/api-reference/money/list-quotes"},{"title":"Create a quote","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/quotes","href":"/api-reference/money/create-a-quote"},{"title":"Read a quote","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/quotes/{quoteId}","href":"/api-reference/money/read-a-quote"},{"title":"List invoices","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices","href":"/api-reference/money/list-invoices"},{"title":"Create a invoice","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices","href":"/api-reference/money/create-a-invoice"},{"title":"Read a invoice","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices/{invoiceId}","href":"/api-reference/money/read-a-invoice"},{"title":"Record a payment","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices/{invoiceId}/payments","href":"/api-reference/money/record-a-payment"},{"title":"List payments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/payments","href":"/api-reference/money/list-payments"}]},{"group":"Leads","pages":[{"title":"List leads","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/leads","href":"/api-reference/leads/list-leads"},{"title":"Create a lead","description":"Creates a lead with the organization’s own field rules: required fields, option lists and formats are checked exactly as in the app. The lead starts in the starting stage unless you give one, and without an owner the organization’s assignment rules pick one. Phone number and email are unique per organization, so a retry of the same lead returns DUPLICATE_LEAD with the existing ID instead of creating a second.\n\nScope: `leads.write`.","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/leads","href":"/api-reference/leads/create-a-lead"},{"title":"Capture a lead","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/leads/capture","href":"/api-reference/leads/capture-a-lead"},{"title":"Get a lead","description":"One lead with every field.\n\nScope: `leads.read`.","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/leads/{leadId}","href":"/api-reference/leads/get-a-lead"},{"title":"Update a lead","deprecated":null,"version":null,"openapi":"/openapi.json patch /api/v1/leads/{leadId}","href":"/api-reference/leads/update-a-lead"},{"title":"Add a note","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/leads/{leadId}/notes","href":"/api-reference/leads/add-a-note"}]},{"group":"Reference","pages":[{"title":"List lead fields","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lead-fields","href":"/api-reference/reference/list-lead-fields"},{"title":"List stages","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lead-stages","href":"/api-reference/reference/list-stages"},{"title":"List pipelines","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/pipelines","href":"/api-reference/reference/list-pipelines"},{"title":"List branches","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/branches","href":"/api-reference/reference/list-branches"},{"title":"List sources","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/lead-sources","href":"/api-reference/reference/list-sources"},{"title":"List people","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/users","href":"/api-reference/reference/list-people"}]},{"group":"Customers","pages":[{"title":"List customer or opportunity records","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/crm/{kind}","href":"/api-reference/customers/list-customer-or-opportunity-records"},{"title":"Create a customer or opportunity","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/crm/{kind}","href":"/api-reference/customers/create-a-customer-or-opportunity"},{"title":"Read a customer or opportunity","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/crm/{kind}/{recordId}","href":"/api-reference/customers/read-a-customer-or-opportunity"},{"title":"Update a customer or opportunity","deprecated":null,"version":null,"openapi":"/openapi.json patch /api/v1/crm/{kind}/{recordId}","href":"/api-reference/customers/update-a-customer-or-opportunity"},{"title":"List custom record fields","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/crm/{kind}/fields","href":"/api-reference/customers/list-custom-record-fields"}]},{"group":"Public billing catalogue","pages":[{"title":"Get published pricing","deprecated":null,"version":null,"openapi":"/openapi.json get /api/public/billing-catalogue","href":"/api-reference/public-billing-catalogue/get-published-pricing"}]},{"group":"Customer quote access","pages":[{"title":"Read a published customer quote","deprecated":null,"version":null,"openapi":"/openapi.json get /api/public/customer-quotes","href":"/api-reference/customer-quote-access/read-a-published-customer-quote"},{"title":"Accept or decline a published customer quote","deprecated":null,"version":null,"openapi":"/openapi.json post /api/public/customer-quotes","href":"/api-reference/customer-quote-access/accept-or-decline-a-published-customer-quote"}]}]}]},"basePath":"","title":"Capture a lead - Marro","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CiUHMMOm.js","snippetPresets-BgfXU7Bw.js","utils-DWvOwgy_.js","style-to-object-BY3JEAdk.js","utils-BN7RXSMJ.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-CFw8bq89.js","conditional-requirements-CFM0id0Q.js","cloneDeep-CAwdfOU2.js","_Uint8Array-BJr8e-ZL.js","isObject-FP1Yky1u.js","ApiExamples-XX0UgMZK.js","usePlaygroundInputsStore-DXDFSa1V.js","shallow-CdX5aREi.js","isEqual-CoOaxexF.js","CodeSnippets-Cg2wpzWm.js","CodeSnippet-D_HwgQO_.js","getApiPlaygroundDisplay-CmCoerhe.js","Page-CVJ-f_k1.js","DynamicMarkdown-CQM9Bhbv.js","SectionHeading-DpbrP8nQ.js","icon-BPCgijHy.js","MethodPill-GQ8DuY0c.js","getPastedJson-Cb5mT31m.js","Check2Icon-a7bUI6e8.js","axios-CsQoIw0U.js","Markdown-CX2QY19L.js","AssistantPageLink-CY3bFglh.js","dist-Dl6_zDnT.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}