Skip to main content

Admin Base Microservice

Multi-tenant administration backend. Manages organizations, RBAC (roles, permissions, actions, modules, features), resource units, and per-organization configuration for models, agents, connectors, templates, workflows, parsing techniques, and languages.

  • Tech: NestJS 11, TypeORM, PostgreSQL
  • Port: 4001
  • Auth: JWT (RS256), API Key, Public
  • Database: admin-base DB (18 tables)

Health Endpoints

MethodPathAuthDescription
GET/api/v1/healthPublicHealth check (memory heap + RSS)
GET/api/v1/health/readyPublicReadiness probe
GET/api/v1/health/livePublicLiveness probe

Admin Endpoints

MethodPathAuthDescription
GET/api/v1/admin/organization-settings/agentsJWTGet enabled agent IDs
GET/api/v1/admin/organization-settings/modelsJWTGet enabled model IDs
GET/api/v1/admin/organization/:idJWTGet organization

Organization Endpoints

MethodPathAuthDescription
POST/api/v1/organizationsJWTCreate organization
GET/api/v1/organizationsJWTList all
GET/api/v1/organizations/defaultPublicGet default organization
GET/api/v1/organizations/:idPublicGet by ID
PATCH/api/v1/organizations/:idJWTUpdate
DELETE/api/v1/organizations/:idJWTDelete
GET/api/v1/organizations/admin/organization-settings/agentsPublicEnabled agent IDs
GET/api/v1/organizations/admin/organization-settings/modelsPublicEnabled model IDs
GET/api/v1/organizations/admin/organization-core-details-by-idPublicOrg core details
GET/api/v1/organizations/:orgId/languagesPublicOrg languages
GET/api/v1/organizations/:orgId/settingsPublicOrg settings
PUT/api/v1/organizations/:orgId/settingsJWTUpdate org settings

Role Endpoints

MethodPathAuthDescription
POST/api/v1/rolesPublicCreate role
GET/api/v1/roles/organization/:orgIdPublicGet roles by organization

Roles support hierarchy via parentId and level. Flags: isSuperAdmin, isSystemRole.

Permission Endpoints

MethodPathAuthDescription
POST/api/v1/permissionsJWTCreate
GET/api/v1/permissionsJWTList all
GET/api/v1/permissions/module/:moduleIdJWTBy module (optional featureId filter)
POST/api/v1/permissions/rolesJWTGet permissions for role IDs
GET/api/v1/permissions/:idJWTGet by ID
PATCH/api/v1/permissions/:idJWTUpdate
DELETE/api/v1/permissions/:idJWTDelete

Role-Permission Endpoints

MethodPathAuthDescription
POST/api/v1/role-permissionsJWTAssign permission to role
GET/api/v1/role-permissions/role/:roleIdPublicGet permissions by role
POST/api/v1/role-permissions/rolesPublicPermissions for multiple roles
DELETE/api/v1/role-permissions/role/:roleId/permission/:permIdJWTRemove specific permission
DELETE/api/v1/role-permissions/role/:roleIdJWTRemove all permissions

Module, Feature, Action Endpoints

Modules

MethodPathAuthDescription
POST/api/v1/modulesJWTCreate
GET/api/v1/modulesJWTList
GET/api/v1/modules/:idJWTGet
PATCH/api/v1/modules/:idJWTUpdate
DELETE/api/v1/modules/:idJWTDelete

Features

MethodPathAuthDescription
POST/api/v1/featuresJWTCreate
GET/api/v1/featuresJWTList (filter by moduleId)
GET/api/v1/features/:idJWTGet
PATCH/api/v1/features/:idJWTUpdate
DELETE/api/v1/features/:idJWTDelete

Actions

MethodPathAuthDescription
POST/api/v1/actionsJWTCreate
GET/api/v1/actions/:idJWTGet
PATCH/api/v1/actions/:idJWTUpdate
DELETE/api/v1/actions/:idJWTDelete

Resource Unit Endpoints

Resource units group users within an organization.

MethodPathAuthDescription
POST/api/v1/resource-units/unit-typesJWTCreate unit type
GET/api/v1/resource-units/unit-typesJWTList unit types
GET/api/v1/resource-units/unit-types/:idJWTGet unit type
PATCH/api/v1/resource-units/unit-types/:idJWTUpdate unit type
DELETE/api/v1/resource-units/unit-types/:idJWTDelete unit type
POST/api/v1/resource-unitsJWTCreate unit
GET/api/v1/resource-unitsJWTList (filter by organizationId)
GET/api/v1/resource-units/:idJWTGet
PATCH/api/v1/resource-units/:idJWTUpdate
DELETE/api/v1/resource-units/:idJWTDelete
POST/api/v1/resource-units/:id/membersJWTAdd member
DELETE/api/v1/resource-units/:id/membersJWTRemove member

Organization Settings Endpoints

General organization settings.

MethodPathAuthDescription
POST/api/v1/organization-settingsJWTCreate
GET/api/v1/organization-settingsJWTList
GET/api/v1/organization-settings/:orgIdPublicGet by org
PUT/api/v1/organization-settings/:orgIdJWTUpdate
DELETE/api/v1/organization-settings/:orgIdJWTDelete
GET/api/v1/organization-settings/:orgId/languagesJWTOrg languages
GET/api/v1/organization-settings/:orgId/languages/selected-codesJWTSelected codes
GET/api/v1/organization-settings/:orgId/modelsJWTOrg models
GET/api/v1/organization-settings/:orgId/models/enabled-idsJWTEnabled model IDs
GET/api/v1/organization-settings/:orgId/default-rolePublicDefault role ID

Per-Organization Resource Configuration

Each resource type has its own controller with a consistent pattern:

All endpoints in this section require JWT authentication.

Organization Languages (/api/v1/organization-languages)

MethodPathDescription
POST/organization-languagesCreate
GET/organization-languages/organizations/:orgIdGet by org
GET/organization-languages/organizations/:orgId/selected-codesSelected codes
PUT/organization-languages/organizations/:orgIdBulk update
GET/organization-languagesList all (optional ?organizationId filter)
GET/organization-languages/:idGet by ID
PATCH/organization-languages/:idUpdate
DELETE/organization-languages/:idDelete

Organization Models (/api/v1/organization-models)

MethodPathDescription
POST/organization-modelsCreate
GET/organization-models/organizations/:orgIdGet by org
GET/organization-models/organizations/:orgId/enabledEnabled models
GET/organization-models/organizations/:orgId/enabled-idsEnabled IDs
PUT/organization-models/organizations/:orgIdBulk update
GET/organization-models/organizations/:orgId/default-completionDefault completion model
GET/organization-models/organizations/:orgId/default-embeddingDefault embedding model
PUT/organization-models/organizations/:orgId/default-completion/:modelIdSet default completion
PUT/organization-models/organizations/:orgId/default-embedding/:modelIdSet default embedding
PUT/organization-models/organizations/:orgId/bulkBulk update with DTO
GET/organization-modelsList all
GET/organization-models/:idGet by ID
PATCH/organization-models/:idUpdate
DELETE/organization-models/:idDelete

Organization Agents (/api/v1/organization-agents)

MethodPathDescription
GET/organization-agents/organizations/:orgIdGet by org
GET/organization-agents/organizations/:orgId/enabled-idsEnabled IDs
GET/organization-agents/organizations/:orgId/defaultDefault agent
PUT/organization-agents/organizations/:orgIdUpdate

Organization Connectors (/api/v1/organization-connectors)

MethodPathDescription
GET/organization-connectors/organizations/:orgIdGet by org
GET/organization-connectors/organizations/:orgId/enabled-idsEnabled IDs
PUT/organization-connectors/organizations/:orgIdUpdate

Organization Templates (/api/v1/organization-templates)

MethodPathDescription
GET/organization-templates/organizations/:orgIdGet by org
GET/organization-templates/organizations/:orgId/enabled-idsEnabled IDs
PUT/organization-templates/organizations/:orgIdUpdate

Organization Workflows (/api/v1/organization-workflows)

MethodPathDescription
GET/organization-workflows/organizations/:orgIdGet by org
GET/organization-workflows/organizations/:orgId/enabled-idsEnabled IDs
PUT/organization-workflows/organizations/:orgIdUpdate

Organization Parsing (/api/v1/organization-parsing)

MethodPathDescription
GET/organization-parsing/organizations/:orgIdGet by org
GET/organization-parsing/organizations/:orgId/enabled-idsEnabled IDs
PUT/organization-parsing/organizations/:orgIdUpdate

Inter-Service Communication

This service does not call other Jeen services. It is a data layer consumed by user-service and document-service.