# Search Custom Value Objects

Operation ID: `searchCustomValueObjects`

Group: Value Accounting › Custom Value Objects

[Open in the interactive reference](https://lensing.ai/api-docs/lensing/v1/endpoints/searchCustomValueObjects)

`POST /value-accounting/custom-value-objects/search`

Read-only: A read that takes its filters in the body. Changes nothing, and ignores Idempotency-Key.

Search custom value objects — the values of the tenant's custom dimensions — by name (exact, or a case-insensitive fragment), by dimension, by category and by whether they are active. Read-only, cursor-paginated. This is where a value is looked up by NAME: its sibling, the customValueObjects data-set (GET value-accounting/custom-value-objects) returns names but cannot filter or sort on them. Names are unique per dimension, not globally, so resolve a name to its id with filters.name AND filters.customValueDimensionId together. Omitting filters entirely returns every value, paged. A filter matching nothing — including a dimension or category id that names no record — returns an empty items array with HTTP 200, never an error. Rows carry the same fields as getCustomValueObject (GET value-accounting/custom-value-objects/:id). POST rather than GET because a name fragment does not belong in a URL.

Finds custom value objects by name — the exact name, or any value whose name contains a fragment, matched case-insensitively — optionally narrowed to one dimension, one category, and active or inactive values.

This is the name lookup the routed list cannot do: the customValueObjects data-set (GET value-accounting/custom-value-objects) returns names but does not filter or sort on them. Use `filters.name` together with `filters.customValueDimensionId` to resolve the one value holding a name on an axis — names are unique per dimension, not globally — and `filters.nameContains` for a type-ahead.

An empty `filters` is a valid request for every value, paged. A filter that matches nothing — including a dimension or category id that names no record — returns an empty `items` array with HTTP 200, not an error.

Rows carry the same fields as getCustomValueObject (GET value-accounting/custom-value-objects/:id), so a search result can be used wherever a fetched value can.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | string · v1 | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Request body

Required, `application/json`: searchCustomValueObjectsInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `filters` | object | no | How to narrow the search. A value must match every member you send. Omit it — or send it with no members — to page through every value, which is what the customValueObjects data-set (GET value-accounting/custom-value-objects) returns. Example: `{"nameContains":"north","customValueDimensionId":"0f1e4b9a-6a71-4a2c-8a0d-2f9c5d3b7e10","isActive":true}`. |
| `filters.name` | string | no | Exact name, matched on the stored text (case- and space-sensitive). Names are unique within a dimension only, so send customValueDimensionId with it to resolve at most one value. A name matching nothing yields an empty page, not an error. |
| `filters.nameContains` | string | no | Fragment the name must contain, matched case-insensitively anywhere in the name — the lookup for a type-ahead. A substring match, not a pattern language: the fragment is taken as literal text apart from the SQL wildcards % and _, which are not escaped and therefore still act as wildcards. A fragment matching nothing yields an empty page, not an error. |
| `filters.customValueDimensionId` | string | no | Id (a UUID) of a custom value dimension, from the customValueDimensions data-set (GET value-accounting/custom-value-dimensions): only that axis's values match. An id that names no dimension matches nothing — an empty page, not an error. Matched case-insensitively. |
| `filters.categoryId` | string | no | Id (a UUID) of a category, from the categories data-set (GET value-accounting/categories): only values filed under it match. An id that names no category matches nothing — an empty page, not an error. Matched case-insensitively. There is no way to ask for uncategorised values here; the list's filter on categoryId answers that. |
| `filters.isActive` | boolean | no | true for values active today (no endDate, or one on or after today, UTC), false for values whose endDate has passed. Omit for both. The same rule every read publishes as isActive. |
| `page` | object | no | Cursor and page size. Omit for the first page at the default size. Example: `{"size":50}`. |
| `page.cursor` | string | no | Opaque forward cursor from a previous response's pagination.nextCursor; omit for the first page. Do not construct or decode it — a token is bound to this endpoint, so one this endpoint did not issue (a cursor from another list, or one altered by hand) raises INVALID_CURSOR rather than silently restarting at the first page, which would make a paging loop repeat forever. Keep filters identical across the pages of one walk; changing it mid-walk re-interprets the cursor against a different result set. It encodes the LAST ROW of the page you received, not a position, so the walk resumes AT THAT ROW rather than at a count: a row created or removed before your position cannot make a later page repeat a row you already saw or skip one you have not. |
| `page.size` | number | no | Maximum number of values to return. Defaults to 50, capped at 200; a larger value is clamped rather than rejected, so the server may return fewer but never more. |

```json
{}
```

## Response

`200` Success

Under `data` (searchCustomValueObjectsOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array<object> | yes | The values on this page, one row per custom value object, in the same shape getCustomValueObject (GET value-accounting/custom-value-objects/:id) returns. Empty when nothing matched — an empty page with HTTP 200, never a 404. Ordered by id ascending — a unique, immutable key, so a rename never moves a row across a page boundary. The cursor is a KEYSET cursor over that order, so a value created after your cursor position appears on a later page, one created before it does not, and no row is ever repeated or skipped, whatever else is written while you walk. |
| `items[].id` | string | yes | Id (a UUID) of the custom value object — the id getCustomValueObject, updateCustomValueObject and deleteCustomValueObject (GET, PATCH and DELETE value-accounting/custom-value-objects/:id) are keyed by. |
| `items[].name` | string | yes | Display name of the value, e.g. 'North'. Unique within its dimension only. |
| `items[].customObjectNumber` | string | no | System-generated business number of the value, e.g. 'CVO-202360' — unique tenant-wide, never editable. Declared optional on the record, so a reader must tolerate its absence. |
| `items[].customValueDimensionId` | string | yes | Id (a UUID) of the custom value dimension this value belongs to. |
| `items[].categoryId` | string | no | Id (a UUID) of the category the value is filed under. Absent — not null — when the value is uncategorised. |
| `items[].startDate` | date | yes | First day the value is valid, inclusive. Format YYYY-MM-DD. |
| `items[].endDate` | date | no | Last day the value is valid, inclusive. Format YYYY-MM-DD. Absent — not null — when the value is open-ended. |
| `items[].isActive` | boolean | yes | Whether the value is active today: true when it has no endDate, or an endDate on or after today (UTC). |
| `items[].lastModifiedDate` | date-time | yes | Instant the value last changed, as ISO 8601 UTC (YYYY-MM-DDTHH:mm:ss.sssZ). The same value the list and the keyed read publish. |
| `pagination` | object | yes | Pagination cursor for this page. |
| `pagination.nextCursor` | string | no | Opaque cursor to pass as `page.cursor` for the next page; absent on the last page. |
| `pagination.hasMore` | boolean | yes | True when more values remain beyond this page. |

```json
{
  "data": {
    "items": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "<name>",
        "customObjectNumber": "<customObjectNumber>",
        "customValueDimensionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "categoryId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "startDate": "2026-01-15",
        "endDate": "2026-01-15",
        "isActive": true,
        "lastModifiedDate": "2026-01-15T09:30:00.000Z"
      }
    ],
    "pagination": {
      "nextCursor": "<nextCursor>",
      "hasMore": true
    }
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Errors

| Code | Status |
| --- | --- |
| `INVALID_CURSOR` | 400 |

## Statuses

- `400` — Invalid request or business failure. Codes: INVALID_CURSOR
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
