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

# Case types

> Give a kind of case its own fields, tables, and tasks.

A case type sets what every case of that kind has: which custom fields, which tables, and which tasks.
Use one per kind of work, such as `phishing` or `account_takeover`.
Each type has a `ref`, the slug you create cases with, which cannot change, and a `name` shown to people.

Create and edit case types in the console, through the API, the MCP server, or [Git sync](https://docs.tracecat.com/gitops/workspace-git-sync.md#case-types). Workflows can read them with the `core.cases` actions.

## What a case type sets

| Setting | Effect on a case of the type |
| - | - |
| `fields` | The case has only these custom fields. Setting any other field is rejected. |
| `tables` | These tables always show on the case, even with no linked rows. You can still link rows from other tables. |
| `task_groups` | Ordered groups of tasks, each with a title. |
| `tasks` | Tasks outside any group, after the groups. |

A task has a `title`, and optionally a `description`, a `priority`, a `response_action`, and static `args` for it.
The response action is the ID of a [response action](https://docs.tracecat.com/automations/cases/response-actions.md).

```json theme={null}
{
  "ref": "phishing",
  "name": "Phishing",
  "definition": {
    "fields": ["sender_domain", "reporter_email"],
    "tables": ["iocs"],
    "task_groups": [
      {
        "title": "Triage ${{ case.fields.sender_domain }}",
        "tasks": [
          {
            "title": "Check reputation of ${{ case.fields.sender_domain }}",
            "description": "Reporter: ${{ case.fields.reporter_email }}\n\n${{ case.tables.iocs }}",
            "priority": "high",
            "response_action": "6f1c2a54-9b0e-4c57-8a3d-2e7f41c0b9d2"
          }
        ]
      }
    ],
    "tasks": [{ "title": "Notify reporter" }]
  }
}
```

## Expressions

Task and group text can show values from the case.

| Expression | Where | Shows |
| - | - | - |
| `${{ case.fields.<field> }}` | Titles and descriptions | The field's current value. |
| `${{ case.tables.<table> }}` | Task descriptions | The case's linked rows from that table, as a Markdown table. |

* Nothing else is allowed inside `${{ }}`: no functions, secrets, or variables. Tracecat rejects the case type when you save it.
* The field or table must be listed in the type's `fields` or `tables`.
* Text is filled in from the case's current values each time the tasks are read, so it follows changes to the case.
* Each task run keeps the title and description as they were when the run started.

## Cases of a type

Set `case_type` to the type's `ref` when you create a case. The type cannot be changed afterwards.

On a case of a type:

* Custom fields outside the type are hidden and cannot be set.
* Tasks cannot be added or removed.
* A task's title, description, and response action cannot be edited. Its status, assignee, and priority can.
* A batch update that sets a field some cases do not have fails for those cases and updates the rest.

A case created without a type is of the `default` type: every custom field, and no tasks until you add them. Every case created before case types is a `default` case.

## Versions

Each change to a type's fields, tables, or tasks saves a new version.
A case keeps the version of its type it was created with; new cases use the latest.
Changing the name or description does not create a version.

You cannot delete or rename a custom field, table, or response action while the latest version of a case type uses it.

## Preview

Preview renders a saved case type, or a definition you have not saved, without changing anything.

* With a case, expressions show that case's values.
* Without one, each expression shows as its name, such as `{sender_domain}`.
* `problems` lists the fields, tables, and response actions the definition names that do not exist.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.