> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/case-repository-api.md).

# Case Repository - use in low-code

## Low-code integration with Case Repository

{% hint style="warning" %}
Functionality available from platform version: 4.760.0
{% endhint %}

{% hint style="info" %}
The functionality for adding new entries to Case Repository is available for scripts (scriptService) and script tasks (scriptTask).
{% endhint %}

## Low-Code API for Case Repository

`Eximee Case Repository` serves as a central repository of customer cases, aggregating information from multiple channels and systems into a unified data model.\
In the context of the low-code platform, the API enables standardized integration of processes, forms, and services with the case repository so that data about statuses and events is consistent, up to date, and available across applications.

Integration is based on an event-driven model, which allows data publication and updates to happen in real time, regardless of where the process is initiated.\
This enables building a unified view of customer cases (omnichannel), supports automation, and ensures continuity of service in customer and internal channels.

This section describes how to use the low-code API to communicate with `Case Repository`, including the rules for data publication, requirements for the object model `Case`.

Detailed description of the role, architecture, and data model `Eximee Case Repository` can be found in the document describing the assumptions [Case Repository](/documentation/documentation-en/wprowadzenie/architektura-platformy/rozszerzenia-platformy/eximee-case-repository.md).

### Creating a new case status

Method `create` creates a new case status entry in `Case Repository`.

Required fields:

* `caseType` - case type,
* `client` - client identifier,
* `clientType` - type of client identifier,
* `status` - current case status.

Field `statusDescription` is optional and is used to extend the status description.

Field `source` is filled by default with the value "eximee" for all entries created from the low-code platform. Field `caseType` is filled by default with the application name for all entries created from the low-code platform.

```javascript
api.caseRepository.v1.create({
    caseType: "caseType",
    client: "client",
    clientType: "clientType",
    businessKey: "businessKey",
    source: "source",
    status: "status",
    statusDescription: "statusDescription"
});
```

Example:

```javascript
api.caseRepository.v1.create({
    caseType: "MORTGAGE_APPLICATION",
    client: "12345678901",
    clientType: "PERSON",
    businessKey: "MORTGAGE_APPLICATION-12345678901",
    source: "eximee",
    status: "APPLICATION_SUBMITTED",
    statusDescription: "The application has been successfully registered"
});
```

### Modification of an existing case status

Method `update` updates the status of an existing case. The request should contain only the fields to be changed. The operation modifies all statuses assigned to the given case.

```javascript
api.caseRepository.v1.update({
    caseType: "caseType",
    client: "client",
    clientType: "clientType",
    source: "source",
    businessKey: "businessKey",
    status: "status",
    statusDescription: "statusDescription"
});
```

Example of calling update of status and description:

```javascript
api.caseRepository.v1.update({
    status: "UNDER_VERIFICATION",
    statusDescription: "Income document verification in progress"
});
```

### Deleting a case status

Method `delete` deletes all statuses assigned to the given case. The operation is irreversible.

```javascript
api.caseRepository.v1.delete();
```

### Retrieving the current case status

Method `get` retrieves the current case status.

```javascript
api.caseRepository.v1.get();
```

Sample response:

```json
{
  "caseId": "f6d7b6ba-5f7f-4f7a-b4d8-0f5be3fd8f16",
  "creationDate": "2026-05-06T10:15:22",
  "updateDate": "2026-05-07T08:42:03",
  "caseType": "MORTGAGE_APPLICATION",
  "clientId": "12345678901",
  "clientType": "PESEL",
  "status": "APPLICATION_SUBMITTED",
  "source": "eximee",
  "businessKey": "MORTGAGE_APPLICATION-12345678901",
  "statusDescription": "The application has been successfully registered"
}
```

### Searching for a case status

Method `search` allows searching for case statuses based on the provided filters. Filters can be combined freely, and the results are paginated. A logical AND (`AND`) is used between different filter fields, which means that only records meeting all specified conditions are returned.

```javascript
api.caseRepository.v1.search({
    caseTypes: ["caseType"],
    statuses: ["status"],
    clientId: "clientId",
    clientType: "clientType",
    createdDate: {
        from: "YYYY-MM-DDTHH:mm:ss",
        to: "YYYY-MM-DDTHH:mm:ss"
    },
    updatedDate: {
        from: "YYYY-MM-DDTHH:mm:ss",
        to: "YYYY-MM-DDTHH:mm:ss"
    },
    page: 0,
    pageSize: 10
});
```

Example usage:

```javascript
api.caseRepository.v1.search({
    caseTypes: ["MORTGAGE_APPLICATION"],
    statuses: ["APPLICATION_SUBMITTED", "UNDER_VERIFICATION"],
    clientId: "12345678901",
    clientType: "PESEL",
    createdDate: {
        from: "2026-05-01T00:00:00",
        to: "2026-05-12T23:59:59"
    },
    page: 0,
    pageSize: 20
});
```

Sample response:

```json
{
  "page": 0,
  "pageSize": 20,
  "count": 2,
  "statuses": [
    {
      "caseId": "f6d7b6ba-5f7f-4f7a-b4d8-0f5be3fd8f16",
      "creationDate": "2026-05-06T10:15:22",
      "updateDate": "2026-05-07T08:42:03",
      "caseType": "MORTGAGE_APPLICATION",
      "clientId": "12345678901",
      "clientType": "PESEL",
      "status": "APPLICATION_SUBMITTED",
      "source": "eximee",
      "businessKey": "MORTGAGE_APPLICATION-12345678901",
      "statusDescription": "The application has been successfully registered"
    },
    {
      "caseId": "f6d7b6ba-5f7f-4f7a-b4d8-0f5be3fd8f16",
      "creationDate": "2026-05-06T10:15:22",
      "updateDate": "2026-05-08T12:09:41",
      "caseType": "MORTGAGE_APPLICATION",
      "clientId": "12345678901",
      "clientType": "PESEL",
      "source": "eximee",
      "businessKey": "MORTGAGE_APPLICATION-12345678901",
      "status": "UNDER_VERIFICATION",
      "statusDescription": "Income document verification in progress"
    }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.eximee.com/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/scriptcode/case-repository-api.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.
