# Search Resources

`GET /lokta-lms/api/v1/search`

Searches loans, clients and other records for a text query, optionally limited to chosen resources.

Example Requests:

search?query=000000001


search?query=Petra&resource=clients,loans


search?query=Petra&resource=clients,loans&exactMatch=true

## Parameters
- `query` (query, string): query
- `resource` (query, string): resource
- `exactMatch` (query, boolean): exactMatch

## Responses
- `200`: OK

## Response fields
- `entityAccountNo` (integer)
- `entityExternalId` (string)
- `entityId` (integer)
- `entityName` (string)
- `entityOverdue` (number): Loans only: total overdue from the arrears aging, null elsewhere
- `entityStatus` (EnumOptionData)
- `entityType` (string)
- `parentId` (integer)
- `parentName` (string)

## Example request (cURL)
```bash
curl -X GET \
  'https://default.lokta.tech/lokta-lms/api/v1/search' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default'
```

## Example response
```json
[
  {
    "entityAccountNo": 1,
    "entityExternalId": "ID_JKZGEXF",
    "entityId": 1,
    "entityName": "Client_Name_HVCU5"
  }
]
```

Interactive: https://developer.lokta.ai/reference#operation/searchData
