accounts

Fuzzy search

Typo-tolerant identity search over username, first/last name, email and phone, ranked by pg_trgm trigram similarity. Matches when EITHER the similarity operator fires (typo tolerance, governed by pg_trgm.similarity_threshold) OR q is a plain substring of the haystack OR q exactly equals the account's Privy DID. Row visibility is the identical compiled authz filter GET /accounts uses, so this endpoint cannot surface anything the plain list would hide. Like every tenant-bearing list, the search covers the caller's OWN session tenant unless it says otherwise — platform admins included. tenant_id=<another tenant> and all_tenants=true require the cross_tenant grant (403 otherwise); passing both, or a malformed value, is a 400. scoped_to_tenant names the tenant searched (empty with all_tenants=true, which also sets all_tenants). Service accounts are excluded by default; kind=service|all surfaces them for tenant admins.

get/accounts/search

Request

  • Base URL: https://api.instruxi.dev/api/v1/enforcer
  • URL: https://api.instruxi.dev/api/v1/enforcer/accounts/search
  • Auth: API key in header Authorization

Query parameters

qstring required

search text (min 2 chars) — username, name, email, phone, or an exact privy DID

tenant_idstring uuid

search this tenant instead of your own (another tenant requires the cross_tenant grant; 403 otherwise)

all_tenantsboolean

search every tenant (requires the cross_tenant grant; 403 otherwise). Mutually exclusive with tenant_id

verifiedboolean

true = KYC-verified accounts only; false = everything not verified (same bucket predicate as /accounts?verification_status=)

kind'human' | 'service' | 'all'

account kind: human (default, excludes service accounts), service, or all. service|all require tenant admin (403 otherwise)

limitinteger

page size

offsetinteger

page offset

Response

OK

all_tenantsboolean
limitinteger
offsetinteger
scoped_to_tenantstring uuid
successboolean
totalinteger

Example response

{
  "success": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.