> ## Documentation Index
> Fetch the complete documentation index at: https://docs.case.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Matters Overview

> Matter-native operator primitives for legal work.

Matters are the workspace primitive for legal work on Case.dev. A matter owns the operating
context: metadata, its primary vault, work items, parties, audit logs, sharing, and execution
policy.

<div className="cyber-band">
  <div className="cyber-band-actions">
    <a className="cyber-button cyber-button-primary" href="/api-reference">
      Open API
    </a>

    <a className="cyber-button cyber-button-secondary" href="/services">
      All Services
    </a>
  </div>

  <div className="cyber-command-row">
    <span className="cyber-command-label">Create</span>
    <code>POST /matters/v1</code>
  </div>

  <div className="cyber-command-row">
    <span className="cyber-command-label">Execute</span>
    <code>POST /matters/v1/{`{id}`}/work-items</code>
  </div>

  <div className="cyber-command-row">
    <span className="cyber-command-label">Decide</span>
    <code>POST /matters/v1/{`{id}`}/work-items/{`{workItemId}`}/decision</code>
  </div>
</div>

## What a matter owns

* Primary vault linkage
* Work items and execution history
* Reusable parties and matter-specific roles
* Optional playbook (matter type) for agent instructions
* Audit logs, exports, events, and shares

## Core resources

| Resource       | Endpoint family                                     | Purpose                                                 |
| -------------- | --------------------------------------------------- | ------------------------------------------------------- |
| Matter         | `/matters/v1`                                       | Create, update, and inspect legal workspaces            |
| Matter types   | `/matters/v1/types`                                 | Optional playbooks with agent instructions              |
| Agent types    | `/matters/v1/agent-types`                           | Reusable agent role definitions                         |
| Parties        | `/matters/v1/parties`                               | Reusable people and organizations                       |
| Matter parties | `/matters/v1/{id}/parties`                          | Attach parties to a matter with roles                   |
| Work items     | `/matters/v1/{id}/work-items`                       | Create and manage tasks — agents dispatch automatically |
| Decisions      | `/matters/v1/{id}/work-items/{workItemId}/decision` | Approve, revise, block, or reassign work                |
| Logs           | `/matters/v1/{id}/log`                              | Operational history and exports                         |
| Shares         | `/matters/v1/{id}/shares`                           | Cross-org matter access                                 |

## How it works

The matters API is a task board. Create a work item, an agent picks it up automatically.

1. **Create a work item** → an agent starts immediately (fire and forget)
2. **Agent completes** → work item status moves to `done` (or `blocked` if it failed)
3. **Agents can create more work items** — they have full API access scoped to the matter
4. **Humans or agents can decide** — approve, revise (re-run), block, or reassign any work item

Work items support `depends_on` in metadata — a draft work item with dependencies won't dispatch until all dependencies are `done`.

## Quickstart

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
# Create a matter
curl https://api.case.dev/matters/v1 \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Doe v. Example Corp.",
    "practice_area": "litigation"
  }'
```

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
# Create a work item — agent starts automatically
curl https://api.case.dev/matters/v1/$MATTER_ID/work-items \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Review demand letter",
    "type": "review",
    "instructions": "Check all citations and verify damages calculations against the medical records."
  }'
```

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
# Kick back with feedback
curl https://api.case.dev/matters/v1/$MATTER_ID/work-items/$WORK_ITEM_ID/decision \
  -H "Authorization: Bearer $CASEDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "decision": "revise",
    "reason": "Citation on page 3 was overturned in 2024. Fix and resubmit."
  }'
```

The full schema and every tagged operation live in the [API Reference](/api-reference).
