public_api:leads:write scope.
Deduplication
MEGA de-duplicates on email and phone last-10 digits. If an incoming lead matches an existing one, it is merged rather than duplicated. Each request must include at least one ofcontact_name, contact_phone, or contact_email.
Idempotency
Send anIdempotency-Key header on any create. Replaying the same key returns the original stored response instead of creating again. Keys are scoped per customer + endpoint; reusing a key with a different body returns 409.
Use a fresh unique key per logical operation (e.g. a UUID), and reuse it only when retrying that same operation.
Single lead
201 with { "lead": { ... } } (same lead shape as the pull API).
Bulk import
400). Uploaded leads are inert — they do not trigger downstream automation.
| Field | Type | Default | Notes |
|---|---|---|---|
leads | array | — | 1–500 rows. |
on_duplicate | enum | update | update merges, skip leaves the existing lead untouched. |
dry_run | bool | false | Validate + preview results without writing. |
row_ref (your correlation id, echoed back), owner_id (must belong to your customer), lead_line (buyer/seller), stage_slug, and custom_fields.
Response
- Per-row
status:created|updated|skipped|failed. A failing row (e.g. a cross-tenantowner_idor astage_slugnot in your pipeline) is markedfailedand never aborts the batch. matched_by:email|phone|null— how a merge target was found.ignored_custom_fields/ top-levelunknown_custom_fields: slugs that didn’t match any custom-field definition and were ignored (not silently dropped).
The bulk endpoint has a stricter per-minute rate limit than the other endpoints — see Rate limits.
dry_run requests are not idempotency-cached.