# GET Cases

### GET `api/v1/cases` and GET `api/v1/cases/:uuid`

#### Path Params

| Name   | Type     | Required | Description                                                   |
| ------ | -------- | -------- | ------------------------------------------------------------- |
| `uuid` | `string` | No       | Case UUID in route path. Optional because route is `/:uuid?`. |

#### Query Params

Only these query params are accepted (unknown params return `400`):

| Name          | Type      | Required | Validation / Behavior                                                                                 |
| ------------- | --------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `pageSize`    | `integer` | No       | Must be positive integer. Service caps effective page size to `< 1000`; otherwise defaults to `1000`. |
| `page`        | `integer` | No       | Must be positive integer.                                                                             |
| `search`      | `string`  | No       | Full-text style search across multiple case-related fields.                                           |
| `uuid`        | `string`  | No       | Alternate UUID filter via query.                                                                      |
| `case_id`     | `integer` | No       | Must be positive integer.                                                                             |
| `user_id`     | `integer` | No       | Must be positive integer. Filters by assigned user or case lead.                                      |
| `client_id`   | `integer` | No       | Must be positive integer.                                                                             |
| `case_number` | `string`  | No       | Max length `255`. Exact match filter.                                                                 |

#### Success Response (200)

Returns a pagination object:

```json
{
  "data": [
    {
      "case_id": 123,
      "uuid": "abc123...",
      "case_number": "CASE-0001",
      "case_name": "Example Case"
    }
  ],
  "total": 1,
  "pageCount": 1,
  "currentPage": 1,
  "nextPage": null,
  "pageSize": 1000
}
```

#### Error Responses

* `400` validation error:

```json
{
  "message": "Invalid case data",
  "success": false,
  "errors": [
    { "message": "\"page\" must be a positive number" }
  ]
}
```

* `500` server error:

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

#### Example

```bash
curl -X GET "https://<host>/v1/cases?page=1&pageSize=25&search=fraud" \
  -H "x-api-key: <api-key>"
```


---

# 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/get-cases-1.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.
