Spring naar inhoud

Developer documentation

API Documentatie

REST API voor integraties met Epdee. JSON in/out, NextAuth-session voor authenticatie. Alle endpoints respecteren tenant-isolatie.

Authenticatie

De API gebruikt session-based authenticatie via NextAuth (Google OAuth + 2FA cookie). Externe integraties die als tenant willen integreren krijgen toegang via:

  • Browser session — voor frontend-aanroepen vanuit het EPD zelf
  • API tokens — komt in volgende release. Per-tenant programmatic access.
  • Webhooks — wij sturen events naar URL's die u configureert (in roadmap)
Auth-niveaus:
PublicSessionTenantSuperadminPatient sessionCron

Public endpoints

Geen authenticatie nodig — gebruikt voor publieke pagina's en booking-flow.

GET/api/statusPublic

System health check (database, services). Geen auth.

Response

{
  "status": "operational",
  "checks": {
    "database": { "status": "ok", "latencyMs": 23 },
    "tenants": { "status": "ok" }
  }
}
GET/api/booking/configPublic

Tenant + locaties + booking-instellingen voor publieke /boeken pagina. Tenant-resolution via host.

GET/api/booking/availabilityPublic

Beschikbare tijdsloten voor een locatie + datum.

Request

?locationId=xxx&date=2026-05-15
POST/api/booking/createPublic

Maak een afspraak vanuit /boeken. Rate-limited (5/uur per IP).

POST/api/signupPublic

Tenant-aanvraag indienen. Rate-limited (3/uur per IP) + honeypot.

POST/api/portaal/request-linkPublic

Magic link voor patiëntportaal aanvragen. Anti-enumeratie.

Tenant data API

Vereist een ingelogde gebruiker met een tenant. Auto-scoped op session.user.tenantId.

GET/api/patientenTenant

Lijst van patiënten van eigen tenant. Filterbaar via search query.

POST/api/patientenTenant

Nieuwe patiënt aanmaken.

GET/api/patienten/:idTenant

Patiënt detail incl. dossier + verzekeringen.

GET/api/patienten/:id/dossier-pdfTenant

Volledige PDF-export van patiëntdossier. Audit-logged.

GET/api/afsprakenTenant

Afspraken filterbaar op datum-range, locatie, patiënt, status.

GET/api/facturenTenant

Facturen lijst incl. lines.

GET/api/workflowsTenant

Workflow definities binnen tenant.

GET/api/notificationsSession

In-app notificaties + unread count.

GET/api/tenant-exportTenant

Volledige tenant-data als JSON download (AVG portabiliteit).

POST/api/branding/uploadTenant

Upload logo / favicon naar Vercel Blob. Multipart form-data.

POST/api/cov/checkTenant

COV-check via Vecozo SOAP — BSN+geboortedatum → verzekeraar. Slaat resultaat op als PatientInsurance. Body: { patientId, peildatum? }

Request

{ "patientId": "cmpbl9d1l000004l5xzv50rwr" }

Response

{
  "ok": true,
  "zoekresultaat": "Gevonden",
  "verzekerde": { "bsn": "...", "achternaam": "...", "geboortedatum": "1986-09-29" },
  "verzekeringen": [
    { "uzovi": "9015", "labelnaam": "CZ", "verzekerdenummer": "...",
      "soort": "Basis", "ingangsdatum": "2026-01-01", "resultaat": "Actief" }
  ],
  "peildatum": "2026-05-19"
}
GET/api/vektis/agb/[code]Tenant

Lookup AGB-code → naam + contact + relaties. Auto-detecteert zorgverlener/vestiging/onderneming.

POST/api/patienten/[id]/huisartsTenant

Koppel huisarts aan patient via AGB-lookup. Body: { agbCode }. Upserts HealthcareProvider.

DELETE/api/patienten/[id]/huisartsTenant

Ontkoppel huisarts van patient.

GET/api/nza-codes/search?type=tarief&q=urologie&limit=20Tenant

Zoek door gesynchroniseerde NZa-data. type = tarief | zorgproduct | zorgactiviteit. Alleen geldige codes.

Response

{
  "type": "tarief",
  "count": 3,
  "results": [
    { "prestatieCode": "190010", "omschrijving": "Eerste polikliniekbezoek",
      "tariefCents": 16500, "zorgsoort": "urologie", "geldigVanaf": "2026-01-01" }
  ]
}
GET/api/verrichtingen?patientId=&appointmentId=Tenant

Lijst verrichtingen (zorgactiviteiten) voor patient of afspraak.

POST/api/verrichtingenTenant

Registreer zorgactiviteit met optionele NZa-codes. Body: { patientId, appointmentId?, description, prestatieCode?, zorgactiviteitCode?, unitPriceCents?, quantity?, performedAt?, notes? }

DELETE/api/verrichtingen/[id]Tenant

Verwijder verrichting.

Superadmin

Alleen voor platform-administrators. Vereist role=superadmin.

GET/api/superadmin/dashboardSuperadmin

Platform-wide metrics: tenants, MRR, signups, etc.

GET/api/superadmin/tenantsSuperadmin

Lijst van alle tenants.

POST/api/superadmin/tenantsSuperadmin

Maak nieuwe tenant aan.

GET/api/superadmin/billingSuperadmin

MRR, ARR, invoices, subscription overzicht.

POST/api/superadmin/impersonateSuperadmin

View-as tenant mode. Body: { tenantId } of null om te stoppen.

GET/api/superadmin/audit-logSuperadmin

Cross-tenant audit log met filters (tenant, action, date, search).

GET/api/superadmin/integration-checksSuperadmin

Alle integraties met huidige config + laatste 50 checks + uptime 24h.

PATCH/api/superadmin/integration-checks/[slug]Superadmin

Update config: enabled, intervalMinutes, failureThreshold, alertEmail, snoozeMinutes.

POST/api/superadmin/integration-checks/[slug]Superadmin

Handmatige check-run nu. Returnt resultaat + opslaan.

POST/api/superadmin/vecozo-testSuperadmin

Test Vecozo mTLS-verbinding. Diagnose-fases: config/cert/network/auth/service.

POST/api/superadmin/vektis-testSuperadmin

Test Vektis API. Token + (optioneel) mTLS-cert. Auto-fallback op Vecozo PFX.

GET/api/superadmin/nza-syncSuperadmin

Overview per dataset: laatste run, stored count, source URL.

POST/api/superadmin/nza-sync/[slug]Superadmin

Handmatige sync van 1 dataset (tarieven|zorgproducten|zorgactiviteiten). Max 5 min.

GET/api/cron/integration-checksCron

Cron — elke 5 min, test alle integraties, verstuurt alert-mails bij transitions. Auth: ?key=CRON_SECRET of Vercel cron UA.

GET/api/cron/nza-syncCron

Cron — 1ste van de maand 03:00. Synct NZa Excel-bestanden. Auth: ?key=CRON_SECRET.

🚧 Op de roadmap

  • Per-tenant API tokens (programmatic access)
  • Outgoing webhooks (events naar uw eigen system)
  • OpenAPI / Swagger spec (machine-readable)
  • Zapier integratie
  • HL7/FHIR endpoints voor zorgsysteem-koppelingen

Wilt u een API-token voor uw integratie?

hallo@epdee.nl