Skip to main content

User Service

Backend-for-Frontend (BFF) that aggregates data from multiple downstream services. Handles user profiles, admin settings, sharing/access control, documents, tags, pins, favorites, activity logs, Langflow flows, and settings streaming.

Does not own a database. All persistence is delegated to downstream services via HTTP.

  • Tech: NestJS 11, CASL (access control)
  • Port: 4000
  • Auth: JWT (RS256), Public
  • Database: None (pure aggregator)

User Endpoints

MethodPathAuthDescription
GET/api/v1/user/profileJWTGet current user profile
GET/api/v1/user/by-email?email=PublicGet user by email (internal)
POST/api/v1/user/zitadelPublicCreate user from ZITADEL (internal)
GET/api/v1/user/zitadel/:zitadelUserIdPublicFind by ZITADEL ID (internal)
PATCH/api/v1/userJWTUpdate profile
POST/api/v1/userPublicCreate user (internal)
GET/api/v1/user/bulk?ids=PublicGet multiple users by IDs

The "Public" endpoints are not exposed to end users -- they exist for service-to-service calls from auth-service.

Admin Endpoints

Organization settings management. All calls proxy to admin-base-ms.

MethodPathAuthDescription
GET/api/v1/admin/languagesJWTAll available languages
GET/api/v1/admin/organization-settings/languages/selectionsJWTOrg language selections
PUT/api/v1/admin/organization-settings/languagesJWTUpdate org languages
GET/api/v1/admin/connectorsJWTAll available connectors
GET/api/v1/admin/organization-settings/connectors/selectionsJWTOrg connector selections
PUT/api/v1/admin/organization-settings/connectorsJWTUpdate org connectors
GET/api/v1/admin/organization-settings/agents/selectionsJWTOrg agent selections
PUT/api/v1/admin/organization-settings/agentsJWTUpdate org agents
GET/api/v1/admin/organization-settings/templates/selectionsJWTOrg template selections
PUT/api/v1/admin/organization-settings/templatesJWTUpdate org templates
GET/api/v1/admin/organization-settings/parsing/selectionsJWTOrg parsing selections
PUT/api/v1/admin/organization-settings/parsingJWTUpdate org parsing
GET/api/v1/admin/organization-settings/models/selectionsJWTOrg model selections
PUT/api/v1/admin/organization-settings/modelsJWTUpdate org models
GET/api/v1/admin/mcp-serversJWTGet enabled MCP servers
GET/api/v1/admin/organization-mcp-servers/:organizationIdJWTGet org MCP server selections
POST/api/v1/admin/organization-settingsJWTCreate org settings
GET/api/v1/admin/organization-settings/meJWTGet my org settings
PUT/api/v1/admin/organization-settings/meJWTUpdate my org settings
GET/api/v1/admin/organizations/:organizationId/settingsJWTGet org settings (legacy)
PUT/api/v1/admin/organizations/:organizationId/settingsJWTUpdate org settings (legacy)

Sharing Endpoints

Resource sharing with granular access control.

MethodPathAuthDescription
POST/api/v1/sharing/shareJWTShare a resource with users/groups
GET/api/v1/sharing/resource/:resourceType/:resourceId/peopleJWTGet people with access
GET/api/v1/sharing/resource/:type/:id/check-user-access/:userIdJWTCheck user access
PATCH/api/v1/sharing/share/:shareIdJWTUpdate share role
DELETE/api/v1/sharing/share/:shareIdJWTRevoke share
PUT/api/v1/sharing/resource/:type/:id/link-settingsJWTUpdate link sharing settings
GET/api/v1/sharing/shared-with-meJWTResources shared with me
POST/api/v1/sharing/check-accessJWTCheck access
POST/api/v1/sharing/check-access/batchJWTBatch check access
GET/api/v1/sharing/search-usersJWTSearch users for sharing
POST/api/v1/sharing/locks/:type/:idJWTAcquire editing lock
DELETE/api/v1/sharing/locks/:type/:idJWTRelease lock
GET/api/v1/sharing/locks/:type/:idJWTGet lock status

Tags, Pins, Favorites

MethodPathAuthDescription
GET/api/v1/tagsJWTGet user's tags
POST/api/v1/tagsJWTCreate tag
PUT/api/v1/tags/:idJWTUpdate tag
DELETE/api/v1/tags/tag/:idJWTDelete tag
POST/api/v1/tags/tag-entitiesJWTLink tag to entity
POST/api/v1/tags/tag-entities/batchJWTGet tag entities by type/IDs
DELETE/api/v1/tags/tag-entities/:idJWTUnlink tag
GET/api/v1/pinsJWTGet pins
POST/api/v1/pinsJWTCreate pin
DELETE/api/v1/pins/:targetIdJWTDelete pin
POST/api/v1/pins/is-pinnedJWTCheck pinned status
GET/api/v1/favorites?targetType=JWTGet favorites
POST/api/v1/favoritesJWTAdd favorite
PATCH/api/v1/favorites/:targetIdJWTRemove favorite
POST/api/v1/favorites/is-favoritedJWTCheck favorited status
POST/api/v1/favorites/countsJWTGet favorite counts

Activity Logs

MethodPathAuthDescription
GET/api/v1/activity-logs/recentJWT + CASLRecent activity logs
POST/api/v1/activity-logs/createJWT + CASLCreate log entry
PUT/api/v1/activity-logs/hideJWT + CASLHide log entry

Document Endpoints

MethodPathAuthDescription
GET/api/v1/documents/treeJWT + CASLDocument tree (proxied from document-service)
GET/api/v1/documents/:docId/downloadJWTDownload document (streams from document-service)

Langflow Flow Endpoints

MethodPathAuthDescription
GET/api/v1/flowsJWT + CASLList flows
GET/api/v1/flows/:flowIdJWT + CASLGet flow
POST/api/v1/flows/:flowId/runJWT + CASLRun a flow
POST/api/v1/flowsJWT + CASLCreate flow
PATCH/api/v1/flows/:flowIdJWTUpdate flow
DELETE/api/v1/flows/:flowIdJWTDelete flow
POST/api/v1/flows/tokens/refreshJWT + CASLRefresh Langflow token
GET/api/v1/flows/healthPublicLangflow health

Settings (with SSE)

MethodPathAuthDescription
GET/api/v1/settings/meJWTGet user settings
PATCH/api/v1/settings/me/preferencesJWTUpdate preferences
GET (SSE)/api/v1/settings/streamJWTReal-time settings stream

User Roles

MethodPathAuthDescription
POST/api/v1/user-roles--Create a user role assignment
GET/api/v1/user-roles--Get all user roles
GET/api/v1/user-roles/:id--Get by ID
PATCH/api/v1/user-roles/:id--Update
DELETE/api/v1/user-roles/:id--Delete

Langflow Accounts

MethodPathAuthDescription
POST/api/v1/langflow-usersJWT + CASLCreate Langflow account
GET/api/v1/langflow-users/meJWT + CASLGet my Langflow account
PATCH/api/v1/langflow-usersJWT + CASLUpdate Langflow account

Features

MethodPathAuthDescription
POST/api/v1/features/createPublicCreate a feature (sharing system)
GET/api/v1/features/:idPublicGet feature by ID

Integration Tools

Note: This controller uses @Controller('api/v1/integrations') which, combined with the global prefix, results in a double path prefix (/api/v1/api/v1/integrations/...). This appears to be a bug in the source code.

MethodPathAuthDescription
GET/integrations/tools--Get all integration tools
GET/integrations/tools/:key--Get tool by key
GET/integrations/providers--Get providers
POST/integrations/:providerName/tokensJWTEnsure provider tokens
POST/integrations/:providerName/accountJWTEnsure provider account
GET/integrations/:providerName/health--Check provider health
GET/integrations/health--Check all providers health

Inter-Service Communication

TargetProtocolPurpose
user-base-msHTTPAll user data persistence (users, tags, pins, favorites, logs, features, shares, locks, tools, Langflow accounts, connectors, languages)
admin-base-msHTTPRoles, permissions, org settings, org resource configurations
llm-coreHTTPConversations, agents, available models, agent files
document-serviceHTTPDocument tree, downloads
identity-serviceHTTPGroup management, user-group resolution
integration-serviceHTTPProvider tokens, accounts, health checks
LangflowHTTPFlow CRUD, execution, tokens