# gematik/api-kim architecture

> Architecture diagram of the GitHub repository gematik/api-kim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gematik/api-kim
- Repository: https://github.com/gematik/api-kim

## Overview

This repository documents KIM (Kommunikation im Medizinwesen), a secure email service for healthcare. Its documented workflow is a participant using a client system to send or receive mail through the Fachdienst’s mail server; account administration and large-attachment storage are distinct capabilities. The repository contains API contracts and architecture documentation, not runtime implementations. Relationships below follow the README; sampled source excerpts were not available, so undocumented interactions are omitted.

Main entry points: [`docs/Fachdienst.adoc`](https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc) (Account Manager), [`docs/Primaersystem.adoc`](https://github.com/gematik/api-kim/blob/main/docs/Primaersystem.adoc) (Primary system), [`docs/KIM_API.adoc`](https://github.com/gematik/api-kim/blob/main/docs/KIM_API.adoc) (Client module), [`src/openapi/AccountManager.yaml`](https://github.com/gematik/api-kim/blob/main/src/openapi/AccountManager.yaml) (Account Manager API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client system"]
  node_primary_system["Primary system<br/>[Primaersystem.adoc]"]
  node_client_module["Client module<br/>[KIM_API.adoc]"]
  node_admin_module["Administration module<br/>[KIM_API.adoc]"]
end

subgraph group_fachdienst["KIM Fachdienst"]
  node_mail_server["Mail server<br/>[Fachdienst.adoc]"]
  node_account_manager["Account Manager<br/>[Fachdienst.adoc]"]
  node_attachment_service["Attachment Service<br/>[Fachdienst.adoc]"]
end

subgraph group_contracts["API contracts"]
  node_account_manager_api["Account Manager API"]
  node_account_limit_api["Account Limit API<br/>[AccountLimit.yaml]"]
  node_service_information_api["Service Information API"]
  node_attachment_api["Attachment API"]
end

subgraph group_directory["Directory service"]
  node_directory_service["Directory service"]
end

node_participant(("KIM participant"))

node_participant -->|"uses"| node_primary_system
node_primary_system -.->|"integrates optionally"| node_client_module
node_client_module -->|"SMTP / POP3"| node_mail_server
node_admin_module -->|"administers account"| node_account_manager
node_account_manager -->|"offers service"| node_account_manager_api
node_account_manager -->|"offers service"| node_account_limit_api
node_account_manager -->|"offers service"| node_service_information_api
node_attachment_service -->|"exposes REST"| node_attachment_api
node_mail_server -->|"stores large mail"| node_attachment_service

click node_primary_system "https://github.com/gematik/api-kim/blob/main/docs/Primaersystem.adoc"
click node_client_module "https://github.com/gematik/api-kim/blob/main/docs/KIM_API.adoc"
click node_admin_module "https://github.com/gematik/api-kim/blob/main/docs/KIM_API.adoc"
click node_mail_server "https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc"
click node_account_manager "https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc"
click node_attachment_service "https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc"
click node_account_manager_api "https://github.com/gematik/api-kim/blob/main/src/openapi/AccountManager.yaml"
click node_account_limit_api "https://github.com/gematik/api-kim/blob/main/src/openapi/AccountLimit.yaml"
click node_service_information_api "https://github.com/gematik/api-kim/blob/main/src/openapi/ServiceInformation.yaml"
click node_attachment_api "https://github.com/gematik/api-kim/blob/main/src/openapi/AttachmentService.yaml"
click node_directory_service "https://github.com/gematik/api-kim/blob/main/docs/Verzeichnisdienst.adoc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_primary_system,node_client_module,node_admin_module toneBlue
class node_mail_server,node_account_manager,node_attachment_service toneAmber
class node_account_manager_api,node_account_limit_api,node_service_information_api,node_attachment_api toneMint
class node_directory_service toneRose
class node_participant toneIndigo
```

## Components

### Client system

- [Primary system](https://github.com/gematik/api-kim/blob/main/docs/Primaersystem.adoc): `docs/Primaersystem.adoc`
- [Client module](https://github.com/gematik/api-kim/blob/main/docs/KIM_API.adoc): `docs/KIM_API.adoc`
- [Administration module](https://github.com/gematik/api-kim/blob/main/docs/KIM_API.adoc): `docs/KIM_API.adoc`

### KIM Fachdienst

- [Mail server](https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc): `docs/Fachdienst.adoc`
- [Account Manager](https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc): `docs/Fachdienst.adoc`
- [Attachment Service](https://github.com/gematik/api-kim/blob/main/docs/Fachdienst.adoc): `docs/Fachdienst.adoc`

### API contracts

- [Account Manager API](https://github.com/gematik/api-kim/blob/main/src/openapi/AccountManager.yaml): `src/openapi/AccountManager.yaml`
- [Account Limit API](https://github.com/gematik/api-kim/blob/main/src/openapi/AccountLimit.yaml): `src/openapi/AccountLimit.yaml`
- [Service Information API](https://github.com/gematik/api-kim/blob/main/src/openapi/ServiceInformation.yaml): `src/openapi/ServiceInformation.yaml`
- [Attachment API](https://github.com/gematik/api-kim/blob/main/src/openapi/AttachmentService.yaml): `src/openapi/AttachmentService.yaml`

### Directory service

- [Directory service](https://github.com/gematik/api-kim/blob/main/docs/Verzeichnisdienst.adoc): `docs/Verzeichnisdienst.adoc`

### Other components

- **KIM participant**

## Connections

- KIM participant → Primary system: uses (evidence: `README.adoc`)
- Primary system → Client module: integrates optionally (evidence: `README.adoc`)
- Client module → Mail server: SMTP / POP3 (evidence: `README.adoc`)
- Administration module → Account Manager: administers account (evidence: `README.adoc`)
- Account Manager → Account Manager API: offers service (evidence: `README.adoc`)
- Account Manager → Account Limit API: offers service (evidence: `README.adoc`)
- Account Manager → Service Information API: offers service (evidence: `README.adoc`)
- Attachment Service → Attachment API: exposes REST (evidence: `README.adoc`)
- Mail server → Attachment Service: stores large mail (evidence: `README.adoc`)
