Skip to main content

API: Global Search

The search endpoint performs a full-text search across objects in a tenant. It uses the tenant's generalSearchType configuration as the default scope, but this can be overridden per request.

Endpoint

GET /data/{tenantId}/search?q={query}
Path parameterDescription
tenantIdThe tenant identifier

Request parameters

ParameterRequiredDescription
qYesThe search query string
typesNoComma-separated list of plural REST type names to search within (e.g. persons,companies). Overrides the tenant's generalSearchType for this request.

When types is omitted, the endpoint falls back to the tenant's generalSearchType configuration. If neither types is provided nor generalSearchType is configured, the endpoint returns 400 Bad Request.

Response structure

Returns a DataObjectPage — the same structure used by list endpoints:

{
"content": [
{
"id": "a1b2c3",
"class": "commons.person",
"name": "Alice Johnson"
}
],
"totalElements": 42,
"totalPages": 3,
"number": 0,
"size": 15
}

Error responses

StatusCause
400 Bad RequestNo types parameter and no generalSearchType configured for the tenant

Example

Search for "johnson" across the tenant's configured search scope:

GET /data/acme/search?q=johnson

Search for "johnson" restricted to persons and companies only:

GET /data/acme/search?q=johnson&types=persons,companies