Skip to main content

core — REST API

model-city-core owns users (citizens + staff, JIT-provisioned from Auth0, mTLS certificate verification) and the OTP / operation authorizations (the second factor used to authorize sensitive operations across the platform). Every other vertical reaches these capabilities through the commons CoreClient.

External systems: Auth0 (JWT validation at the edge + Management API for provisioning), SMTP (OTP and invitation emails), PostgreSQL (modelcity-core in microservices, the single modelcity in the monolith) and Valkey (cache). See the core data model.

The controllers are abstract extension points (UsersController, AgentController, OperationAuthorizationController, SystemTrailController); the platform registers the Default* subclass as the active bean. See the Extensibility Guide.

Users​

OperationEndpointPage
Sign-in / JIT provisioningPOST /api/core/usersregister-user
Get user profileGET /api/core/users/{userId}get-user
List usersGET /api/core/userslist-users
Check citizen existsHEAD /api/core/users/{sub}find-user
Enable / disable userPATCH /api/core/users/{userId}set-user-status
Delete userDELETE /api/core/users/{userId}delete-user
Verify mTLS certificatePOST /api/core/certificate-verificationsverify-certificate
Invite agent (staff)POST /api/core/agentsinvite-agent

OTP / operation authorizations​

OperationEndpointPage
Create challenge (send OTP)POST /api/core/operation-authorizationscreate-challenge
Validate challenge (verify OTP)PATCH /api/core/operation-authorizations/{id}validate-challenge
Get operation authorizationGET /api/core/operation-authorizations/{id}get-operation-authorization
Burn operation authorizationPATCH /api/core/operation-authorizations/{id}/burnburn-operation-authorization

Audit (system trails)​

OperationEndpointPage
Query the audit logGET /api/core/system-trailsget-system-trails