crm_write
crm_write submits records to OnFire’s async export pipeline, which
enriches them, decides create-vs-update, and writes each record to your
tenant’s connected CRM.
This is a live write path and is deny-by-default — your tenant must be granted the tool explicitly. Confirm the exact records and changes with the user before calling.
Prerequisite
Section titled “Prerequisite”Call get_tenant_settings first to
confirm a CRM is connected (settings.crm.enabled). The pipeline resolves
the integration internally — there is no integration_id argument here.
Three-step workflow
Section titled “Three-step workflow”crm_write→ returns ajob_idandstatus: "pending".- Poll
crm_write_statusuntil the status iscompletedorfailed. crm_write_results→ per-record outcomes, persisted as a queryable dataset.
Inputs
Section titled “Inputs”| Parameter | Type | Required | Description |
|---|---|---|---|
entity_type | string | Yes | "account" or "prospect". |
records | object[] | Yes | The records — see the closed key sets below. |
mode | string | No | "async" (default — parks on rate limits and resumes) or "sync" (fail fast). |
contact_data_enrich | boolean | No | Enrich prospects with email/phone before export. Prospect-only. Default false. |
contact_data_priority | string | No | "fast" (interactive) or "regular" (batch). Ignored unless enrichment is on. |
Record shapes
Section titled “Record shapes”Records are validated with extra="forbid": any key outside the allowed
set rejects the whole batch with HTTP 400 and writes nothing — one stray
field on record 1 discards all 10,000.
account — all four required, no others: website, linkedin_url,
linkedin_id, name.
prospect — required: name (the full name, in this one field),
email (not nullable), linkedin_url, company_linkedin_url. Optional:
phones (a list — fills the CRM phone columns by index, up to 3; only
phones can fill the 2nd and 3rd, so prefer it), phone (legacy single),
company_website, company_name, job_title, location.
Naming: snake_case or camelCase both validate (linkedin_url or
linkedinUrl). Pick one per record.
Never send: first_name / last_name / full_name (there is no
split-name form — use name), description, title, company. Both
LinkedIn URLs are required on a prospect even when
contact_data_enrich=true.
Returns
Section titled “Returns”JSON with job_id, status ("pending"), entity_type, and
record_count.
Notes & limits
Section titled “Notes & limits”- Max 10,000 records and 25 MB per batch; oversized batches are rejected.
- The export respects the tenant’s CRM field mapping, configured in the OnFire app — check the mapping if records land in the wrong fields.