Skip to content

Search

The Search module provides search with three different scopes based on the caller’s role: member-scope (data belonging to the user themselves), organization-scope (all data in the user’s organization), and global (across the entire application — MORIA superadmin only). All endpoints require Bearer JWT and use the same query string (SearchQueryDto).

PropertyValue
Base URL{HOST}/v1
AuthBearer JWT (header Authorization) or access_token cookie
Content-Typeapplication/json
Error envelope{ "message": string | string[], "statusCode": number, "error": string }
ValidationGlobal ValidationPipe · whitelist: true, forbidNonWhitelisted: true · unknown fields → 400
Related modulesusers, organizations, accounts, transactions
Document versionv1 · 2026-05-20
AudienceInternal FE devs (mobile + web)

Pick an endpoint based on the role of the logged-in user. INDIVIDUAL can only call member-scope. ORGANIZATION admin can call member-scope (their own data) and organization-scope (across the org’s members). MORIA superadmin has access to the global endpoint for cross-tenant search.

MethodPathAuthSummary
GET/v1/search/member-scopebearerSearch within the logged-in user’s data
GET/v1/search/organization-scopebearerSearch within the organization scope (organization admin)
GET/v1/search/globalbearerGlobal cross-application search (MORIA superadmin)

GET /v1/search/member-scope bearer

Section titled “GET /v1/search/member-scope ”

Search within the logged-in user’s scope: personal data, accounts, and personal items. Endpoint for both INDIVIDUAL and ORGANIZATION users — both will see only their own items.

bearer INDIVIDUAL, ORGANIZATION RESOURCE_FETCHED
ParamTypeDefaultNotes
querystringoptionalSearch keyword. If empty, results are still paginated without text filtering.
pagenumber1Page number. Minimum 1.
limitnumber20Items per page. Maximum 100.
order'asc' | 'desc'ascResult order. Validated via IsEnum.
{
"status": "success",
"statusCode": 200,
"message": "Search results",
"data": {
"total": 12,
"page": 1,
"limit": 20,
"results": [
{ "...": "shape per item depends on the matched entity type" }
]
}
}

The results field is a free-form array (any[]) — the service returns a mix of objects (user, account, transaction, etc.) each with a type/kind indicator. FE must discriminate based on that field.

StatusWhen it occurs
400 Bad Requestlimit > 100, page < 1, or order other than asc/desc
401 UnauthorizedBearer/cookie token is invalid
403 ForbiddenRole is not INDIVIDUAL / ORGANIZATION

GET /v1/search/organization-scope bearer

Section titled “GET /v1/search/organization-scope ”

Search across members and resources of the logged-in user’s organization. Only ORGANIZATION users with an organization_id may call this endpoint.

bearer ORGANIZATION RESOURCE_FETCHED
ParamTypeDefaultNotes
querystringoptionalSearch keyword
pagenumber1Page number
limitnumber20Maximum 100
order'asc' | 'desc'ascResult order
{
"status": "success",
"statusCode": 200,
"message": "Search results",
"data": {
"total": 42,
"page": 1,
"limit": 20,
"results": [
{ "...": "mix of users / accounts / transactions belonging to the organization" }
]
}
}
StatusWhen it occurs
400 Bad RequestQuery validation failed, or user has no organization_id (User must belong to an organization)
401 UnauthorizedBearer/cookie token is invalid
403 Forbiddenuser_type is not ORGANIZATION (Only organization users can access organization scope search)

Search across the entire application — all organizations, all users, all resources. MORIA superadmin only.

bearer MORIA RESOURCE_FETCHED
ParamTypeDefaultNotes
querystringoptionalSearch keyword
pagenumber1Page number
limitnumber20Maximum 100
order'asc' | 'desc'ascResult order
{
"status": "success",
"statusCode": 200,
"message": "Search results",
"data": {
"total": 1280,
"page": 1,
"limit": 20,
"results": [
{ "...": "mix of cross-tenant entities" }
]
}
}
StatusWhen it occurs
400 Bad RequestQuery validation failed
401 UnauthorizedBearer/cookie token is invalid
403 Forbiddenuser_type is not MORIA (Only Moria admins can access global search)

  • individual — can only access member-scope
  • organization — can access member-scope and organization-scope
  • moria — can access global
  • asc — ascending (default)
  • desc — descending
  • page ≥ 1
  • limit ≥ 1 and ≤ 100
{
"message": "Only organization users can access organization scope search",
"statusCode": 403,
"error": "Forbidden"
}

message can be a string or an array of strings (multi-field validation error).

  • 400 query validation or preconditions failed (e.g. user without org)
  • 401 token expired / missing
  • 403 role does not match the scope
  • 500 internal — show a generic toast