---
title: "For a firm: The seed import: clients with their matters, matched by name, idempotent (billing, admin)"
method: POST
path: "/v1/admin/tenants/{tenant}/matters/import"
tags: ["admin"]
---

# For a firm: The seed import: clients with their matters, matched by name, idempotent (billing, admin)

`POST /v1/admin/tenants/{tenant}/matters/import`

## Request

- Base URL: `https://api.sixminute.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sixminute.ai/v1/admin/tenants/{tenant}/matters/import`
- Auth: HTTP bearer

The shape `six-minute matter import` reads. Clients are matched by exact name and matters by (client, name); missing rows are created, known rows are corrected in `code`, `description`, `external_ref`, `billing`, the record's own words, `temporary`, `billable` and `active` only where the seed differs, and an identical re-import changes nothing. One transaction: a refused row refuses the whole import.

Operator mount: an operator acting for the firm named in the path, as its oldest active admin, else its oldest active billing member; `X-Six-Minute-Acting-As` names them. 404 for no such firm, 409 `urn:six-minute:problem:no-acting-member` for one with neither. Served for an internal tenant alone: any other is 409 `urn:six-minute:problem:tenant-not-internal`, before the audit row and before any write.

## Path parameters

- `tenant` string, required

## Request body

- object
  - `clients` object[], required
    - `name` string, required
    - `external_ref` string, nullable
    - `contacts` object[]
      - `name` string, required
      - `email` string, nullable
      - `kind` 'primary' | 'billing' | 'other'
    - `domains` string[]
    - `matters` object[], required
      - `name` string, required
      - `code` string, nullable
      - `description` string, nullable
      - `billable` boolean
      - `external_ref` string, nullable
      - `active` boolean
      - `temporary` boolean
      - `parties` object[]
        - `name` string, required
        - `kind` 'counterparty' | 'counterparty_counsel' | 'co_party' | 'court' | 'other'
        - `email` string, nullable
        - `organisation` string, nullable
        - `role` string, nullable
        - `emails` string[]
        - `contacts` object[]
          - `name` string, required
          - `email` string, nullable
        - `reference` string, nullable
        - `external_refs` string[]
      - `domains` string[]
      - `folders` string[]
      - `keywords` string[]
      - `matter_type` string, nullable
      - `references` object[]
        - `kind` string
        - `value` string, required
      - `category` object, nullable
        - `code` string, nullable
        - `name` string, required
      - `main_category` string, nullable
      - `phase` string, nullable
      - `billing` object
        - `narrative_profile` string
      - `attribute_sets` object
      - `sync_source` 'manual' | 'legalsense' | 'urios' | 'import'
      - `opened_at` string, date-time

## Response `200`

What was created, updated and left alone.

- object
  - `clients` object, required
    - `created` integer, required
    - `updated` integer, required
    - `unchanged` integer, required
  - `matters` object, required
    - `created` integer, required
    - `updated` integer, required
    - `unchanged` integer, required

## Other responses

- `400`: The body, query or path did not validate; `errors` lists the fields.
- `401`: No bearer token, or one that does not verify or has expired.
- `403`: The token verified but may not do this: no organisation, not provisioned, wrong role, or a device problem.
- `404`: No such row for this tenant.
- `409`: The id or the email already belongs to something else.
- `503`: A capability this service was not configured with, or a practice system that could not be reached; the `type` says which.

---

[API](https://skmtc.dev/sixminute/apis/sixminute-api.md) - [All operations](https://skmtc.dev/sixminute/apis/sixminute-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sixminute/apis/sixminute-api/revisions/605577eadc10?raw)
