Skip to content

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.

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.

  1. crm_write → returns a job_id and status: "pending".
  2. Poll crm_write_status until the status is completed or failed.
  3. crm_write_results → per-record outcomes, persisted as a queryable dataset.
ParameterTypeRequiredDescription
entity_typestringYes"account" or "prospect".
recordsobject[]YesThe records — see the closed key sets below.
modestringNo"async" (default — parks on rate limits and resumes) or "sync" (fail fast).
contact_data_enrichbooleanNoEnrich prospects with email/phone before export. Prospect-only. Default false.
contact_data_prioritystringNo"fast" (interactive) or "regular" (batch). Ignored unless enrichment is on.

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.

JSON with job_id, status ("pending"), entity_type, and record_count.

  • 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.