# Update Company

`lawmatics_update-company` · Lawmatics MCP tool · Companies

Update an existing company in Lawmatics by ID. The echo includes a `relationships` envelope of {id,type} pointers to related records (primary contact, contacts, prospects, tags, emails, phone numbers, addresses, notes, and the creating user).

## Input

- **companyId** `string` (required, pattern: ^\d+$) — ID of the company to update; a numeric string
- **name** `string` — Company name
- **email** `string(email)` (pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$) — Primary email address
- **phoneNumber** `string` — Primary phone number
- **street** `string` — Primary address street
- **street2** `string` — Primary address street line 2
- **city** `string` — Primary address city
- **state** `string` — Primary address state / province
- **country** `string` — Primary address country
- **postalCode** `string` — Primary address ZIP / postal code
- **emailsAttributes** `array` — Additional email addresses to create inline (write-only; not returned)
  - **[]** `object`
    - **info** `string` (required) — The email address or phone number
    - **label** `string` — Label for this entry (e.g. Home, Work)
- **phoneNumbersAttributes** `array` — Additional phone numbers to create inline (write-only; not returned)
  - **[]** `object`
    - **info** `string` (required) — The email address or phone number
    - **label** `string` — Label for this entry (e.g. Home, Work)
- **addressesAttributes** `array` — Additional addresses to create inline (write-only; returned via `addresses`)
  - **[]** `object`
    - **street** `string` (required) — Street address
    - **street2** `string` — Street address line 2
    - **city** `string` (required) — City
    - **state** `string` (required) — State / province
    - **country** `string` (required) — Country
    - **postalCode** `string` (required) — ZIP / postal code
    - **label** `string` — Label for this address (e.g. Home, Work)
- **customFields** `array` — Custom field values to set; pass null as a value to clear that field
  - **[]** `object`
    - **id** `string | number` (required) — Custom field ID (the API returns it as a number; either a string or number is accepted)
    - **value** `string | number | boolean | null` (required) — Value to set (matches the field's type); pass null to clear the field

## Output

- **id** `string` (required) — Lawmatics company ID
- **name** `string | null` (required) — Company name; null if unset
- **email** `string | null` (required) — Primary email address; null if unset
- **address** `string | null` (required) — Computed, formatted full address string; read-only; null if unset
- **city** `string | null` (required) — Primary address city; null if unset
- **state** `string | null` (required) — Primary address state/province; null if unset
- **postalCode** `string | null` (required) — Primary address ZIP/postal code; null if unset
- **country** `string | null` (required) — Primary address country; null if unset
- **phoneNumber** `string | null` (required) — Primary phone number as stored; null if unset
- **addresses** `array` (required) — All addresses associated with the company; empty array if none
  - **[]** `object`
    - **id** `number` (required) — Address ID
    - **street** `string | null` (required) — Street address line 1; null if unset
    - **street2** `string | null` (required) — Street address line 2; null if unset
    - **city** `string | null` (required) — Address city; null if unset
    - **state** `string | null` (required) — Address state/province; null if unset
    - **postalCode** `string | null` (required) — Address ZIP/postal code; null if unset
    - **country** `string | null` (required) — Address country; null if unset
    - **label** `string | null` (required) — Address label (e.g. Primary, Home, Work); null if unset
    - **createdAt** `string | null` (required) — When the address was created, as an ISO 8601 timestamp; null if unknown
    - **updatedAt** `string | null` (required) — When the address was last updated, as an ISO 8601 timestamp; null if unknown
- **customFields** `array` (required) — Account-defined custom fields on the company; empty array if none
  - **[]** `object`
    - **id** `string` (required) — Custom field definition ID, as a numeric string
    - **name** `string | null` (required) — Custom field display name; null if unset
    - **fieldType** `string | null` (required) — Custom field data type (e.g. text, date, select); null if unset
    - **value** `any` (required) — Raw custom field value; type varies by `fieldType`
    - **formattedValue** `any` (required) — Display-formatted custom field value; type varies by `fieldType`
- **createdAt** `string | null` (required) — When the company was created, as an ISO 8601 timestamp; null if unknown
- **updatedAt** `string | null` (required) — When the company was last updated, as an ISO 8601 timestamp; null if unknown
- **relationships** `object` (required) — JSON:API relationship pointers to related records as {id,type} stubs. Not materialized — follow a pointer by calling that resource's own get/find tool (e.g. type 'contact' -> get-contact, type 'user' -> get-user, type 'address' -> get-address).
  - **primaryContact** `object | null` (required) — Primary-contact pointer (live `type` "primary_contact"); null when unset
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
  - **createdBy** `object | null` (required) — Creating user pointer; null when unset
    - **id** `string` (required) — ID of the referenced Lawmatics record
    - **type** `string` (required) — JSON:API record class of the reference (e.g. "user", "contact", "prospect", "firm"); resolve it by calling that resource's own get/find tool — this pointer is not materialized
  - **contacts** `array` (required) — Contact pointers; empty if none
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
  - **prospects** `array` (required) — Prospect (matter) pointers; empty if none
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
  - **tags** `array` (required) — Tag pointers; empty if none
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
  - **emails** `array` (required) — Email-address pointers; empty if none
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
  - **phoneNumbers** `array` (required) — Phone-number pointers; empty if none
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
  - **addresses** `array` (required) — Address pointers; empty if none. Distinct from the `addresses` attribute above, which carries the full nested address objects
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
  - **notes** `array` (required) — Note pointers; empty if none
    - **[]** `object`
      - **id** `string` (required) — ID of the referenced Lawmatics record
      - **type** `string` (required) — JSON:API record class of the reference; resolve it by calling that resource's own tool
