User Search (API v2)¶
DATAMIMIC exposes a typed user search endpoint intended for the user-management UI and other authenticated clients.
Endpoint¶
POST /api/v2/users/search— Search system users (user auth).
The endpoint uses a backend-owned table-search envelope in the request body:
1 2 3 4 5 | |
Example: free-text search (case-insensitive substring):
1 2 3 4 5 | |
Legacy note:
- This
POST .../searchendpoint does not usepage/per_pagequery parameters; clients must send pagination in the request body.
Pagination rules:
pageis 1-based;page<=0is clamped to1per_page<=0uses the API default (10)per_pageis capped byserver_settings.DB_ITEM_LIMIT(page-size cap only, no separate total-results cap)pageis clamped tototal_pages
Substring filters:
- All substring filters are case-insensitive (
ILIKE %value%) whenmatch_type="like".
Request Model¶
UserSearchRequest¶
Body shape:
filters—UserSearchFilterspagination—PaginationRequestsorting—UserSortConfig
UserSearchFilters:
| Field | Type | Match semantics |
|---|---|---|
q |
string \| null |
Free-text filter. Case-insensitive substring match across supported text fields and ID fields (id). |
id |
integer \| null |
Exact match (==) |
email |
string \| null |
match_type="like": substring match (ILIKE %value%, case-insensitive); match_type="exact": exact match (==) |
active |
boolean \| null |
Exact match (==) |
first_name |
string \| null |
match_type="like": substring match (ILIKE %value%, case-insensitive); match_type="exact": exact match (==) |
last_name |
string \| null |
match_type="like": substring match (ILIKE %value%, case-insensitive); match_type="exact": exact match (==) |
language |
string \| null |
match_type="like": substring match (ILIKE %value%, case-insensitive); match_type="exact": exact match (==) |
match_type |
"like" \| "exact" |
Controls whether string filters use substring vs exact matching (default: like) |
Unknown fields are rejected with 422 (request models forbid extras).
Sorting¶
UserSortConfig:
sort_by: one ofid,tc_creation,tc_update,emailsort_order:ascordesc(default:desc)
Default behaviour: sort by id descending (deterministic, tie-broken by id).
Response Model¶
The endpoint returns UserSearchResponse:
data:UserSearchDataResponse[]meta:pagination:total_items,total_pages,current_page,per_page,next_page_num,prev_page_numsorting: the applied sorting configapplied_filters: normalized filters actually applied by the server
UserSearchDataResponse includes: id, email, first_name, last_name, language, active, tc_creation, tc_update, auth_groups, preferences.
Known Limitations (No Fake Features)¶
- No date-range filters (e.g.
from/to,tc_creation_from, …)