Skip to main content

Update company custom fields

Set custom field values on one company.

PATCH/api/companies/{company_id}/custom-fields
HTTP referenceScope companies:writeUpdated September 27, 2026

This page documents the canonical HTTP contract for this endpoint.

Replace territory with an active custom-field key defined for your organization. Each value is validated against that field's declared type/options. Blank values clear the field. Provenance records a declared qualification basis, not independent verification; its keys must accompany values in the same write.

The response example is abridged; the handler returns the serialized Company, including detail sections.

Path parameters

  • company_idrequired

    string

    Company ID.

Body parameters

  • valuesrequired

    object

    Non-empty custom field name to value map. Values are checked against active organization company-field definitions; blank/null values clear fields.

  • provenance · optional

    object

    Optional map keyed by a field in values. Each value has basis (source_evidence, model_inference, user_assumption, or unknown), nonblank rationale (max 2,000 chars), and up to 20 sources. Each source has kind (url, crm_record, user_statement, tool_result, or model_run), nonblank reference (max 2,000 chars), and optional excerpt (max 2,000 chars). source_evidence requires at least one source; cleared values cannot carry provenance.

Errors

StatusMeaning
400Organization ID missing, invalid company ID, empty values, unknown field key, invalid value/type/option, or provenance that does not match a value.
401Invalid or missing authentication.
403Missing companies:write scope.
404Company not found.
422Request body does not satisfy the values/provenance model.

Docs