Skip to main content

API

The arch repo service publishes its model over REST, and receives OpenAPI specs and database schemas the same way. This page documents that API - the one that existed before the docs API was added.

There are two roots:

RootWhat lives there
/api/**The model, the artifact push and read endpoints, the job triggers and the management endpoints
/external-api/**The one resource meant for a consumer outside the platform: the database schema of a component

A third root, /docs-api/**, is the segregated read API for the jEAP Doc Service and is documented separately - see Docs API. It shares nothing with this page: neither its authentication, nor its payloads, nor its error format.

The OpenAPI description is served by the jEAP Swagger starter and grouped by root, in OpenApiConfig and DocsApiConfiguration:

GroupPaths
Internal Architecture Repository API/api/**
External Architecture Repository API/external-api/**
Architecture Repository Docs API/docs-api/** - see Docs API

The operations​

Method and resourcePurpose
GET /api/modelAll systems with their components, without relations
GET /api/model/exportComplete systems/teams configuration as deterministic YAML
GET /api/model/{system}/relationsEvery active relation - REST, event, command - with one end in a system
GET /api/model/rest-api-relation-without-pactGovernance query: active REST relations with no Pact contract
GET /api/model/system-components-without-open-api-specGovernance query: backend services and self-contained systems with no spec
POST /api/openapi/{component}Push a component's OpenAPI spec
POST /api/openapi/{system}/{component}The same handler; the system segment is ignored
GET /api/openapi/{component}The stored spec of a component, verbatim
GET /api/openapi/{system}/{component}The same handler; the system segment is ignored
GET /api/openapi/{component}/rest-apisThe REST endpoints derived from the spec, with its version and server URL
GET /api/openapi/{system}/{component}/rest-apisThe same handler; the system segment is ignored
GET /api/openapi/versionsThe spec version of every component that has one
POST /api/dbschemasPush a component's database schema
GET /api/dbschemas/versionsThe schema version of every component that has one
GET /external-api/dbschemasThe stored database schema of one component
POST /api/jobsRun the model update or the documentation generation now
POST /api/jobs/import/{importerName}Run a single importer now
DELETE /api/management/rest-apiMark one REST API relation deleted

{component} is always matched by name, ignoring case, and never by an alias. {system} is matched by name, ignoring case, only in GET /api/model/{system}/relations; in every path under /api/openapi the segment is bound to a parameter the handler ignores.

Authentication​

Which mechanism applies is decided by the path prefix, on two filter chains - see Security for the whole picture.

PathChainCredentials
/api/**WebSecurityConfig.apiSecurityFilterChainHTTP basic as archrepo.api.username (default archrepo-admin), password archrepo.api.secret
everything else, /external-api/** includedthe jEAP security starter's resource serverAn OAuth2 bearer token, plus a semantic role

On the basic chain these GETs are permitAll() and need no credentials at all:

  • GET /api/model, GET /api/model/{system}/relations, GET /api/model/export
  • GET /api/model/rest-api-relation-without-pact, GET /api/model/system-components-without-open-api-spec
  • GET /api/openapi/**, GET /api/dbschemas/**

Everything else under /api/** requires the basic credentials.

The chain also permits GET /api/reactions/**, but no controller serves that path - it is a leftover matcher from an endpoint that no longer exists.

The two pushes are the exception​

POST /api/openapi/** and POST /api/dbschemas are cut out of the basic chain's security matcher when the request carries an Authorization: Bearer ... header, and then fall to the resource-server chain instead. The same request without that header stays on the basic chain. That is what lets a pushing pipeline use whichever credential it has.

The two do not check the role the same way:

PushHow the role is checkedBasic credentials alone
POST /api/openapi/**Programmatically, and only for a JeapAuthenticationToken: openapidoc / writeaccepted - the check is skipped
POST /api/dbschemas@PreAuthorize("hasRole('database-schema', 'write')")not sufficient, see below

The two-argument hasRole(resource, operation) exists only on the expression root jEAP builds for a JeapAuthenticationToken; for any other authentication the handler falls back to Spring's default root, which has no such method. POST /api/dbschemas is therefore a bearer-token endpoint in practice, even though the filter chain would let the basic credentials through as far as the method-security check.

Semantic roles resolve to <system-name>_@<resource>_#<operation>, with <system-name> taken from jeap.security.oauth2.resourceserver.system-name.

Errors​

Errors on these endpoints are plain text, not RFC 9457 problem documents. The advice that answers with application/problem+json is scoped to the docs API package; the endpoints on this page keep the format their consumers already parse, which ExistingApiUnchangedIT pins down.

GlobalExceptionHandler maps four exceptions:

ExceptionStatusRaised by
MethodArgumentNotValidException400A @Valid request body that fails its constraints
OpenApiFileParsingException400An uploaded OpenAPI spec that cannot be parsed
OpenApiException400An unknown component, on the /api/openapi read endpoints
DatabaseSchemaExceptionthe status the exception carriesThe database schema endpoints; every factory method uses 500

Everything else is left to Spring: a ResponseStatusException - 404 for an unknown system, 400 for a system that already exists - becomes the container's standard error response, and a @Size violation on a path variable or a query parameter becomes a 400.

GET /api/model​

Every system with its components, without relations. The payload other services consume, and the one under Pact contract - which is why the docs API deliberately does not reuse it.

Request​

GET /api/model

No path parameters, no query parameters, no request body.

Authentication: none. The endpoint is permitAll().

Response​

200 OK, application/json.

{
"systems": [
{
"name": "system",
"description": "Warenverkehrssystem",
"ownedBy": "Team Blue",
"aliases": ["SYSTEM-ALIAS"],
"systemComponents": [
{
"name": "system-foo-bar-service",
"description": "Handles foo and bar",
"ownedBy": "Team Blue",
"importer": "DEPLOYMENT_LOG",
"type": "BACKEND_SERVICE"
}
]
}
]
}
FieldTypeMeaning
systemsarrayEvery system of the landscape
systems[].namestringThe system's name
systems[].descriptionstringFree text from the importers; omitted when the system has none
systems[].ownedBystringThe name of the system's default owner; omitted when it has none
systems[].aliasesarray of stringFurther names the system is known under; an empty array when it has none
systems[].systemComponentsarrayThe system's components
systemComponents[].namestringThe component's name, and what {component} matches everywhere else on this page
systemComponents[].descriptionstringFree text from the importers, null when it has none
systemComponents[].ownedBystringThe name of the component's own team, null when it has none
systemComponents[].importerenumGRAFANA, DEPLOYMENT_LOG, MESSAGE_TYPE_REGISTRY, PACT_BROKER, OPEN_API or REST_CONTROLLER; null when no importer is recorded
systemComponents[].typeenumBACKEND_SERVICE, FRONTEND, GATEWAY, MOBILE_APP, SELF_CONTAINED_SYSTEM or UNKNOWN

SystemDto is annotated @JsonInclude(NON_NULL), so an absent system field is missing from the payload; SystemComponentDto is not, so an absent component field is an explicit null.

A component the deployment log reports as undeployed from this environment is left out of systemComponents entirely, and a system left with no components this way is left out of systems too - a consumer reading this endpoint sees exactly the components that are currently deployed, with no flag to check and nothing to filter itself. This is also what lets the governance service's importer work unchanged: a component absent from one fetch that was present in the last one is, as far as it is concerned, deleted - which is the outcome wanted for a component that left.

StatusWhen
200Always - an empty landscape is an empty systems array

GET /api/model/{system}/relations​

Every active relation with one end in the named system, wherever it was defined.

Request​

GET /api/model/{system}/relations

Path parameterMatches
systemThe system's name, ignoring case. Aliases are not matched here

No query parameters, no request body.

Authentication: none. The endpoint is permitAll().

Response​

200 OK, application/json.

[
{
"relationType": "REST_API_RELATION",
"consumerSystem": "example",
"consumer": "example-gateway",
"providerSystem": "system",
"provider": "system-foo-bar-service",
"method": "GET",
"path": "/api/foo/{id}"
},
{
"relationType": "EVENT_RELATION",
"consumerSystem": "example",
"consumer": "example-gateway",
"providerSystem": "system",
"provider": "system-foo-bar-service",
"messageType": "SystemDeclarationAcceptedEvent"
}
]
FieldTypeMeaning
relationTypeenumREST_API_RELATION, EVENT_RELATION or COMMAND_RELATION
consumerstringName of the consuming component
consumerSystemstringThe system owning that component; omitted when the component is not part of the model
providerstringName of the providing component
providerSystemstringThe system owning that component; omitted when the component is not part of the model
methodstringHTTP method - REST relations only
pathstringPath template - REST relations only
messageTypestringThe event or the command name - event and command relations only

RelationDto is annotated @JsonInclude(NON_NULL), so the fields that do not apply to a relation type are omitted, not rendered as null. A relation with either end an undeployed component is left out too, the same as in GET /api/model.

StatusWhen
200The system exists; a system without relations answers an empty array
404No system of that name - an alias does not count

GET /api/model/rest-api-relation-without-pact​

The governance query behind "which REST call is not covered by a contract": every active REST API relation of the whole landscape whose pactUrl is null.

Request​

GET /api/model/rest-api-relation-without-pact

No path parameters, no query parameters, no request body.

Authentication: none. The endpoint is permitAll().

Response​

200 OK, application/json.

[
{
"consumerSystem": "example",
"consumer": "example-gateway",
"providerSystem": "system",
"provider": "system-foo-bar-service",
"method": "GET",
"path": "/api/foo/{id}"
}
]
FieldTypeMeaning
consumerSystemstringThe system owning the consuming component, null when it is not part of the model
consumerstringName of the consuming component
providerSystemstringThe system owning the providing component, null when it is not part of the model
providerstringName of the providing component
methodstringThe HTTP method of the called endpoint
pathstringThe path template of the called endpoint

RestApiRelationDto carries no @JsonInclude, so an unresolved system is an explicit null here - unlike in RelationDto. A relation with either end an undeployed component is left out, so it is never offered as something to add a Pact test for.

StatusWhen
200Always - nothing to report is an empty array

GET /api/model/system-components-without-open-api-spec​

The other governance query: which components ought to have published an OpenAPI spec and have not.

Request​

GET /api/model/system-components-without-open-api-spec

No path parameters, no query parameters, no request body.

Authentication: none. The endpoint is permitAll().

Response​

200 OK, application/json - a flat array of component names.

["system-foo-bar-service", "system-gateway"]

Only components of type BACKEND_SERVICE or SELF_CONTAINED_SYSTEM are considered; a component is listed when its system holds no OpenApiSpec naming it as the provider. An undeployed component is never listed, whether or not it has a spec.

StatusWhen
200Always - full coverage is an empty array

POST /api/openapi/{component}​

Push the OpenAPI spec of one component. POST /api/openapi/{system}/{component} reaches the same handler; its system segment is bound to a parameter the handler ignores, so the two forms behave identically.

Request​

POST /api/openapi/{component}

Path parameterMatches
componentThe component's name, ignoring case. At most 200 characters
systemTwo-segment form only; accepted, at most 200 characters, and ignored
Query parameterRequiredMeaning
versionnoThe version to record with the spec. At most 200 characters; stored as null when absent
Request headerRequiredValue
AuthorizationyesHTTP basic, or a Bearer token carrying openapidoc / write
Content-Typeyesmultipart/form-data

The body is multipart/form-data with one required part:

PartRequiredContent
fileyesThe OpenAPI document, JSON, as-is
curl -u api:$ARCHREPO_API_SECRET \
-F file=@openapi.json \
"https://archrepo.example.com/my-archrepo-service/api/openapi/system-foo-bar-service?version=1.4.2"

What the handler does, in order:

  1. If the request is authenticated with a bearer token, it checks openapidoc / write programmatically. Basic authentication skips that check.
  2. It looks the component up by name, ignoring case. If there is no such component the push is ignored and answered 200 - no component, no system and no spec is created.
  3. It parses the uploaded bytes as JSON to read servers[0].url. A body that does not parse, or that names no server, is rejected with 400 and nothing is persisted.
  4. It stores the spec - creating it (201), or replacing the stored bytes, version and server URL (200).
  5. It re-imports the component's REST APIs from the paths object of the spec, adding the ones that are new and dropping the ones only the OPEN_API importer still claimed.

The server URL is read from the spec on every push and stored with it, whether the spec is created or updated.

Response​

Empty body in every case.

StatusWhen
201The component had no spec yet and one was stored
200The component's spec was replaced - or the component does not exist and the push was ignored
400component, system or version longer than 200 characters, or a spec that is not parseable JSON with a server URL
401Neither basic credentials nor a bearer token
403A bearer token without openapidoc / write
500The upload could not be read - an IOException on file.getBytes()

200 is therefore ambiguous by design: it means "updated" and "ignored" alike. A caller that wants to know whether the component is in the model has to ask GET /api/model.

GET /api/openapi/{component}​

The stored spec of a component, verbatim. GET /api/openapi/{system}/{component} is the same handler with the system segment ignored.

Request​

GET /api/openapi/{component}

Path parameterMatches
componentThe component's name, ignoring case. At most 200 characters
systemTwo-segment form only; accepted, at most 200 characters, and ignored

No query parameters, no request body.

Authentication: none. GET /api/openapi/** is permitAll().

Response​

200 OK. The body is the stored spec, decoded as UTF-8 and written unchanged - no envelope and no field of the arch repo's own. The handler returns a String and declares no produces, so the media type is negotiated with the request rather than fixed to application/json.

{
"openapi": "3.0.3",
"info": { "title": "system-foo-bar-service", "version": "1.4.2" },
"servers": [ { "url": "https://foo-bar.example.com" } ],
"paths": {
"/api/foo/{id}": {
"get": {
"operationId": "getFoo",
"responses": { "200": { "description": "The foo" } }
}
}
}
}
StatusWhen
200The component exists and has a spec
400No component of that name - plain text, SystemComponent ... does not exists in architecture model
400component or system longer than 200 characters
404The component exists but has published no spec - plain text, No Open API spec found for ...

An unknown component answering 400 rather than 404 is a quirk of this endpoint: the miss is raised as an OpenApiException, which GlobalExceptionHandler maps to 400.

GET /api/openapi/{component}/rest-apis​

The REST endpoints the arch repo derived from a component's spec, with the version and server URL it recorded. GET /api/openapi/{system}/{component}/rest-apis is the same handler with the system segment ignored.

Request​

GET /api/openapi/{component}/rest-apis

Path parameterMatches
componentThe component's name, ignoring case. At most 200 characters
systemThree-segment form only; accepted, at most 200 characters, and ignored

No query parameters, no request body.

Authentication: none. GET /api/openapi/** is permitAll().

Response​

200 OK, application/json.

{
"serverUrl": "https://foo-bar.example.com",
"lastUpdated": "2026-08-12T05:31:00Z",
"version": "1.4.2",
"restApis": [
{ "method": "get", "path": "/api/foo/{id}" },
{ "method": "post", "path": "/api/foo" }
]
}
FieldTypeMeaning
serverUrlstringThe first entry of the spec's servers, recorded on every push
lastUpdatedISO-8601 timestampWhen the spec was last written: its modification time, or its creation time if never modified
versionstringThe version the push carried, null when it carried none
restApisarrayThe endpoints of the component that carry the OPEN_API importer
restApis[].methodstringThe HTTP method as the model stores it - the spec's method key, so lower case, unless another importer created the entry first
restApis[].pathstringThe path template

Endpoints the model knows only from another source - Grafana, the Pact broker, a REST controller scan - are filtered out; only those the OpenAPI importer claims are listed. A REST API another importer found first and the OpenAPI importer then confirmed keeps the method spelling of that first importer.

StatusWhen
200The component exists and has a spec
400No component of that name, or a path segment longer than 200 characters
404The component exists but has published no spec - empty body

GET /api/openapi/versions​

Which spec version each component last published. The literal path wins over the /{component} template, so a component cannot be read under the name versions.

Request​

GET /api/openapi/versions

No path parameters, no query parameters, no request body.

Authentication: none. GET /api/openapi/** is permitAll().

Response​

200 OK, application/json.

[
{ "system": "system", "component": "system-foo-bar-service", "version": "1.4.2" },
{ "system": "example", "component": "example-gateway", "version": null }
]
FieldTypeMeaning
systemstringThe system that defines the spec
componentstringThe component the spec belongs to
versionstringThe version the push carried, null when it carried none

One entry per stored spec, and there is exactly one spec per component. The query declares no order by, so the order is whatever the database returns.

StatusWhen
200Always - no spec anywhere is an empty array

POST /api/dbschemas​

Push the database schema of one component: the tables, columns, primary key and foreign keys an ERD is generated from.

Request​

POST /api/dbschemas

No path parameters and no query parameters.

Request headerRequiredValue
AuthorizationyesA Bearer token carrying database-schema / write
Content-Typeyesapplication/json - the handler declares consumes

The body is a CreateOrUpdateDbSchemaDto and is validated with @Valid:

{
"systemComponentName": "system-foo-bar-service",
"schema": {
"name": "system_foo_bar",
"version": "42",
"tables": [
{
"name": "declaration",
"columns": [
{ "name": "id", "type": "uuid", "nullable": false },
{ "name": "consignee_id", "type": "uuid", "nullable": true }
],
"primaryKey": { "name": "declaration_pkey", "columnNames": ["id"] },
"foreignKeys": [
{
"name": "declaration_consignee_fk",
"columnNames": ["consignee_id"],
"referencedTableName": "consignee",
"referencedColumnNames": ["id"]
}
]
}
]
}
}
FieldRequiredMeaning
systemComponentNameyesThe component the schema belongs to, matched by name, ignoring case
schemayesThe DatabaseSchema record of jeap-archrepo-dbschema-model
schema.nameyesThe database schema's own name
schema.versionyesThe schema version the publisher wrote
schema.tablesyesAt least one table
tables[].nameyesTable name
tables[].columnsyesAt least one column, each with name, type and nullable
tables[].primaryKeynoname and a non-empty columnNames
tables[].foreignKeysnoEach with name, columnNames, referencedTableName and referencedColumnNames

Unlike the OpenAPI push, this one creates the component when it does not exist, provided the system derived from the prefix before the first - is already onboarded. The prefix resolves by name or alias ignoring case. An unknown system is logged as an ERROR and returns 422, without creating a system, team, component or schema. Declare the system in configuration and run a model update before its first push. A new component is recorded with importer REST_CONTROLLER.

The push replaces the component's single schema in place, or creates it. Two concurrent creations are handled: the loser of the unique constraint retries as an update in a new transaction.

Response​

Empty body in every case.

StatusWhen
201The component had no schema yet and one was stored
200The component's schema was replaced
400The body fails its constraints - a missing tables, an empty column name, and so on
401No bearer token
403A token without database-schema / write
422The system derived from the component name has not been onboarded; nothing is persisted
500The schema could not be serialized, or any other unexpected failure - plain text from DatabaseSchemaException

GET /api/dbschemas/versions​

Which schema version each component last published - the counterpart of GET /api/openapi/versions.

Request​

GET /api/dbschemas/versions

No path parameters, no query parameters, no request body.

Authentication: none. GET /api/dbschemas/** is permitAll().

Response​

200 OK, application/json.

[
{ "system": "system", "component": "system-foo-bar-service", "version": "42" },
{ "system": "example", "component": "example-gateway", "version": "7" }
]
FieldTypeMeaning
systemstringThe system the schema is linked to
componentstringThe component the schema belongs to
versionstringThe schema version as published

One entry per stored schema, and there is exactly one schema per component. The query declares no order by.

StatusWhen
200Always - no schema anywhere is an empty array

GET /external-api/dbschemas​

The stored database schema of one component, for a consumer outside the platform. The only resource under /external-api/**, and the reason that root exists: it sits on the resource-server chain and carries its own role.

Request​

GET /external-api/dbschemas?systemComponentName=system-foo-bar-service

No path parameters.

Query parameterRequiredMeaning
systemComponentNameyesThe component whose schema to return, matched by name, ignoring case
Request headerRequiredValue
AuthorizationyesA Bearer token carrying external-database-schema / read

No request body.

Response​

200 OK, application/json.

{
"systemComponentName": "system-foo-bar-service",
"schema": {
"name": "system_foo_bar",
"version": "42",
"tables": [
{
"name": "declaration",
"columns": [
{ "name": "id", "type": "uuid", "nullable": false }
],
"primaryKey": { "name": "declaration_pkey", "columnNames": ["id"] },
"foreignKeys": null
}
]
}
}
FieldTypeMeaning
systemComponentNamestringEchoed back as the caller spelled it, not as the component is stored
schemaobjectThe DatabaseSchema deserialized from the stored bytes and serialized again

DatabaseSchema and its nested types carry no @JsonInclude(NON_NULL), so a table without a primary key or without foreign keys renders those as an explicit null.

StatusWhen
200The component exists and has a schema
401No bearer token, or one the resource server rejects - basic credentials do not help here
403A token without external-database-schema / read
404No component of that name, or the component has published no schema - empty body
500The stored bytes could not be deserialized - plain text from DatabaseSchemaException

The two 404 cases are deliberately not told apart; this endpoint has no way to say "the component exists but has nothing to show".

POST /api/jobs​

Run the scheduled model update now instead of waiting for its cron expression - see Operations.

Request​

POST /api/jobs

No path parameters and no query parameters.

Request headerRequiredValue
AuthorizationyesHTTP basic - there is no public access
Content-Typeyesapplication/json
{ "type": "UPDATE_MODEL" }
FieldRequiredMeaning
typeyesUPDATE_MODEL for a full import run

Response​

200 OK, empty body.

The handler is @Async: the response says the job started, not that it finished, and a failure during the run appears only in the log. The job still takes its ShedLock lock, so a cluster runs it once.

StatusWhen
200The job was handed to the executor
400The body is not valid JSON, or type is not UPDATE_MODEL
401No basic credentials

POST /api/jobs/import/{importerName}​

Run a single importer, to refresh one source without a full run.

Request​

POST /api/jobs/import/{importerName}

Path parameterMatches
importerNameThe importer's simple class name, matched ignoring case - PactBrokerImporter, for instance

No query parameters and no request body.

Request headerRequiredValue
AuthorizationyesHTTP basic - there is no public access

Response​

200 OK, empty body.

@Async like POST /api/jobs. The run loads and saves the model as a full run does, but it does not call ArchitectureModel.cleanup(). An unknown importer name fails on the async thread and is visible only in the log - the response is still 200.

StatusWhen
200The import was handed to the executor
401No basic credentials

GET /api/model/export​

Returns 200 with Content-Type: application/yaml; no authentication is required. The document has exactly the archrepo.model.teams and archrepo.model.systems shape accepted by configuration binding. It contains every team and system, including empty systems and those with only undeployed components. Only config-owned metadata is exported: no IDs, timestamps, components or relations. Teams/systems are sorted by name, aliases are sorted, and null fields are omitted for stable Git diffs.

The endpoint reads the primary, not a replica, so a bootstrap export includes recent changes. It faithfully exports legacy duplicate names/aliases; review and resolve those case-insensitively before applying the document. See Configuration for the full format, bootstrap, activation guard and destructive semantics.

System/team creation endpoints were removed in 18.0.0. Declare both lists in configuration instead; deploying without them leaves existing systems and teams untouched.

DELETE /api/management/rest-api​

Mark one REST API relation deleted - the manual correction for a relation an importer got wrong and will not retract by itself.

Request​

DELETE /api/management/rest-api

No path parameters and no query parameters.

Request headerRequiredValue
AuthorizationyesHTTP basic - there is no public access
Content-Typeyesapplication/json
{
"providerName": "system-foo-bar-service",
"consumerName": "example-gateway",
"method": "GET",
"path": "/api/foo/{id}"
}
FieldRequiredMeaning
providerNameyesThe providing component, matched exactly
consumerNameyesThe consuming component, matched exactly
methodyesThe HTTP method, matched ignoring case
pathyesThe path template, matched ignoring case

The body is annotated @Valid, so a missing field is a 400 before the handler runs. Only relations whose status is ACTIVE are searched, and the first match is marked deleted - the row stays, its status changes.

Response​

200 OK with the plain-text body Relation deleted successfully.

StatusWhen
200A matching active relation was found and marked deleted
400A field of the body is null
401No basic credentials
404No active relation between the two components matches the method and path - No relations found
  • Docs API - the segregated read API for the doc service, which changes nothing here
  • Security - the two authentication mechanisms and all roles
  • Architecture - the model behind the API
  • Data model - the entities the payloads map onto
  • Concepts - what a system, a component and a relation are
  • Operations - the management and job endpoints in context
  • Importers - the pushed sources