# Get case type/category

### Description

This service retrieves the list of active case types and categories available for the authenticated touchpoint.

> Note on Uniqueness: Because types and categories can be reused, a unique record is identified by the combination of `caseTypeCode` + `caseCategoryCode`.

***

### Request

#### Restrictions

* Authentication: Requires a successful consumer/party login.
* Authorization: The results are filtered based on the specific permissions granted to the touchpoint.

#### Endpoint

```
GET https://<server-url>/api/v4/cases/typecategory
```

#### Parameters

| **Parameter**      | **Location**   | **Description**                                                                    |
| ------------------ | -------------- | ---------------------------------------------------------------------------------- |
| `touchpoint`       | Query / Header | The identifier for the touchpoint. Use `Thalamus-Touchpoint` for the header.       |
| `token`            | Query / Header | The authentication token for the API session. Use `Thalamus-Token` for the header. |
| `visibility`       | Query          | Optional. Filter by app visibility. Values: `app` or `all` (default).              |
| `caseTypeCode`     | Query          | Optional. Filter the list by a specific case type code.                            |
| `caseCategoryCode` | Query          | Optional. Filter the list by a specific case category code.                        |

#### Full URL Examples

```
# Filter by visibility for the application
https://<server-url>/api/v4/cases/typecategory?visibility=app&touchpoint=test&token=...

# Filter by specific Type and Category
https://<server-url>/api/v4/cases/typecategory?caseTypeCode=caseType03&caseCategoryCode=caseCategory2&touchpoint=test&token=...
```

***

### Response

#### ✅ Successful Response: `200 OK`

Returns a JSON object containing an array of `caseTypeCategories`.

| **Field**          | **Type** | **Description**                                                                   |
| ------------------ | -------- | --------------------------------------------------------------------------------- |
| `caseTypeCode`     | String   | The unique code for the case type.                                                |
| `caseTypeName`     | String   | The display name for the case type.                                               |
| `caseCategoryCode` | String   | The unique code for the case category.                                            |
| `caseCategoryName` | String   | The display name for the case category.                                           |
| `defaultAnswer`    | String   | A pre-configured default response or instruction for this specific type/category. |

Example Response Body:

```
{
    "caseTypeCategories": [
        {
            "caseTypeCode": "cine",
            "caseTypeName": "Cinema",
            "caseCategoryCode": "diversion",
            "caseCategoryName": "Diversion",
            "defaultAnswer": "la entrada tiene garantía"
        },
        {
            "caseTypeCode": "desperfecto",
            "caseTypeName": "Desperfecto",
            "caseCategoryCode": "mobile",
            "caseCategoryName": "Mobile",
            "defaultAnswer": "indique marca y modelo"
        }
    ]
}
```
