# Create Matter From Company

`lawmatics_create-matter-from-company` · Lawmatics MCP tool · Matters

Create a matter (legal case) in Lawmatics linked to a company, by company ID or by company name (found or created). Contact fields create or update the matter's point-of-contact.

## Input

- **companyId** `string` (pattern: ^\d+$) — ID of an existing company to link; a numeric string. Mutually exclusive with companyName
- **companyName** `string` — Company name to find or create and link. Mutually exclusive with companyId
- **caseTitle** `string` — Title of the matter/case
- **firstName** `string` — First name of the matter's point-of-contact (created or updated)
- **lastName** `string` — Last name of the matter's point-of-contact (created or updated)
- **email** `string(email)` (pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$) — Email address of the matter's point-of-contact (created or updated)
- **phone** `string` — Phone number of the matter's point-of-contact (created or updated)
- **notes** `array` — Notes to create inline with the matter (write-only; not returned)
  - **[]** `object`
    - **name** `string` (required) — Note title
    - **body** `string` (required) — Note content
- **tags** `array` — Tag names to attach to the matter; missing tags are created
  - **[]** `string`
- **customFields** `array` — Custom field values to set on the new matter; pass null as a value to clear
  - **[]** `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 matter ID of the newly created matter
- **caseTitle** `string | null` (required) — Title of the matter/case; null if unset
- **caseBlurb** `string | null` (required) — Short description of the matter (read-only attribute); null if unset
- **status** `string` (required) — Matter status (e.g. "pnc", "hired", "lost"); new matters start as "pnc"
- **subStatus** `string | null` (required) — Sub-status label within the status; null if unset
- **firstName** `string | null` (required) — First name of the matter's point-of-contact; null if unset
- **lastName** `string | null` (required) — Last name of the matter's point-of-contact; null if unset
- **email** `string | null` (required) — Primary email address of the matter's point-of-contact; null if unset
- **phone** `string | null` (required) — Primary phone number of the matter's point-of-contact; null if unset
- **customFields** `array` (required) — Account-defined custom fields on the matter; 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` (required) — When the matter was created, as an ISO 8601 timestamp
- **updatedAt** `string` (required) — When the matter was last updated, as an ISO 8601 timestamp
- **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 'company' -> get-company, type 'user' -> get-user).
  - **source** `object | null` (required) — Lead source 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
  - **stage** `object | null` (required) — Pipeline stage 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
  - **campaign** `object | null` (required) — Marketing campaign 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
  - **practiceArea** `object | null` (required) — Practice area 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
  - **salesperson** `object | null` (required) — Salesperson (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
  - **leadAttorney** `object | null` (required) — Lead attorney (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
  - **originatingAttorney** `object | null` (required) — Originating attorney (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
  - **ownedBy** `object | null` (required) — Owning 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
  - **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
  - **contact** `object | null` (required) — Primary contact 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
  - **company** `object | null` (required) — Linked company 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
  - **assignedStaff** `array` (required) — Assigned staff (user) 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
  - **events** `array` (required) — Event 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
  - **fileRequests** `array` (required) — File-request 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
  - **documents** `array` (required) — Document 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
  - **files** `array` (required) — File 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
  - **folders** `array` (required) — Folder 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
  - **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
  - **tasks** `array` (required) — Task 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
    - **[]** `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
  - **invoices** `array` (required) — Invoice 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
  - **relationships** `array` (required) — Related-party relationship-record 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
