# CREATE Cases

### POST `api/v1/cases`

Creates a new case.

#### Body Params

Only these fields are accepted (unknown fields return `400`):

| Name              | Type                   | Required | Validation / Notes                                                                 |
| ----------------- | ---------------------- | -------- | ---------------------------------------------------------------------------------- |
| `case_name`       | `string`               | **Yes**  | Max `255`, cannot contain any of: \`+ < > : " / \\                                 |
| `case_number`     | `string`               | No       | Max `255`, same character restrictions as `case_name`; must be unique if provided. |
| `description`     | `string`               | No       | Max `2000`.                                                                        |
| `case_status`     | `string`               | No       | Max `255`.                                                                         |
| `case_type`       | `string`               | No       | Max `255`.                                                                         |
| `case_lead_id`    | `integer`              | No       | Integer.                                                                           |
| `case_open_date`  | `date`                 | No       | Valid date value.                                                                  |
| `user_group_uuid` | `string` or `string[]` | No       | Either one UUID string or array of UUID strings.                                   |
| `client_id`       | `integer`              | No       | Integer.                                                                           |

#### Success Response (200)

```json
{
  "success": true,
  "message": "Case Created",
  "case_id": 123,
  "uuid": "abc123...",
  "case_number": "CASE-0001",
  "case_name": "New Case"
}
```

#### Error Responses

* `400` validation error:

```json
{
  "message": "Invalid case data",
  "success": false,
  "errors": [
    { "message": "\"case_name\" is required" }
  ]
}
```

* `400` duplicate case number:

```json
{
  "message": "Case number already exists. Case number must be unique",
  "success": false
}
```

* `500` server error:

```json
{
  "message": "Error creating case",
  "success": false
}
```

#### Example

```bash
curl -X POST "https://<host>/v1/cases" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <api-key>" \
  -d '{
    "case_name": "Customer Investigation",
    "case_number": "INV-2026-001",
    "description": "Investigation details",
    "case_open_date": "2026-02-25",
    "case_lead_id": 12,
    "client_id": 44,
    "user_group_uuid": ["group-uuid-1", "group-uuid-2"]
  }'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monolithforensics.com/monolith/monolith-api/cases-api/create-cases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
