Skip to content

API reference

Data Source

The replication framework. Configure external data sources, sync data into the engine’s database, and query replicated records — without live API calls during scheduling.

Key points

  • External system data is replicated into the engine’s database, not proxied through live API calls
  • Adapters are pre-built integrations (NetSmart CRM, Outlook, custom REST APIs); each registers with the engine
  • Sync runs in three modes: initial-load (full), incremental (delta), and replicate (USS-internal)
  • Schedulers register cron-based recurring syncs; one-off syncs are also supported

About data sources

The Data Source API exposes the engine’s replication framework. External data — patient records, calendar events, GPS feeds — gets replicated into the engine’s database ahead of time. Scheduling decisions read locally, never live.

See the integrations framework for the architectural reasoning. The endpoints below are the operational surface — most teams configure once and let the engine sync automatically, but the manual operations are useful for debugging, backfills, and one-off imports.

Configuration

Eight endpoints for inspecting and configuring data sources.

List registered adapters

GET/api/v1/data-source/adapters

List all adapter factories registered with the engine. Adapters are the building blocks for data sources.

Responses

200Names of all registered adapters
{
  "adapters": [
    "netsmart_crm",
    "outlook_calendar",
    "google_maps",
    "test_source"
  ]
}

Load configuration

POST/api/v1/data-source/configure

Configure data sources from template JSON. Reads the data source section of a template and applies it.

Request body

Either inline configuration or a templateId reference. Most production setups use templates.

{
  "templateId": "home_care_v1",
  "sources": [
    {
      "name": "netsmart_crm",
      "type": "rest_api",
      "config": {
        "baseUrl": "https://api.netsmart.example",
        "authType": "oauth2",
        "syncInterval": "PT15M"
      }
    }
  ]
}

Responses

200Data sources configured successfully

Parse config (dry-run)

POST/api/v1/data-source/parse-config

Parse a template config without applying it. Useful for validating configuration before deployment.

Responses

200Parsed config returned without changes

Fetch directly

POST/api/v1/data-source/fetch

Fetch directly from an adapter. Bypasses replication; useful for testing adapter configuration.

Responses

200Data fetched from the adapter

Adapter health

GET/api/v1/data-source/health

Health check across all configured adapters. Returns per-adapter status.

Responses

200Health status for all adapters

Configuration summary

GET/api/v1/data-source/status

Current data source configuration summary.

Responses

200Configuration summary with active source count
{
  "configured": [
    {
      "name": "netsmart_crm",
      "type": "rest_api",
      "status": "active",
      "lastSyncAt": "2026-04-26T15:00:00Z"
    }
  ],
  "totalSources": 3,
  "activeSources": 3
}

List templates with data sources

GET/api/v1/data-source/templates

List non-deprecated templates that include data source configuration sections.

Responses

200List of templates with data source metadata

Replicated data

Four endpoints for working with replicated records — the snapshot of external data that lives in the engine’s database.

Upsert single record

POST/api/v1/data-source/replicated-data

Upsert a replicated data record. Creates if new, updates if existing (matched by external system + ID).

Request body

Required: recordType, externalSystemName, externalRecordId, data. Optional: parentEntityId to link to a USS entity.

{
  "recordType": "patient",
  "externalSystemName": "netsmart_crm",
  "externalRecordId": "PT-9001",
  "parentEntityId": "ent_pt_9001",
  "data": {
    "firstName": "Mary",
    "lastName": "Johnson",
    "carePlanId": "CP-114782"
  }
}

Responses

201Record upserted successfully

Bulk upsert

POST/api/v1/data-source/replicated-data/bulk

Upsert many replicated records in one call. Each item processes independently with per-item status.

Responses

200Bulk upsert completed; check per-item results

Query records

GET/api/v1/data-source/replicated-data

Query replicated records by type and optional parent entity.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Query parameters

  • recordTypestring

    Filter by replicated record type

  • parentEntityIdUUID

    Filter to records linked to a specific entity

Responses

200Matching replicated records

Look up by external ID

GET/api/v1/data-source/replicated-data/lookup

Look up a single record by its external system name and external record ID.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Query parameters

  • externalSystemNamestringrequired

    Source system name

  • externalRecordIdstringrequired

    Record ID in the external system

Responses

200Replicated record (null if not found)

Sync operations

Nine endpoints for triggering and managing sync. Most production flows use scheduled incremental sync; the manual operations are for backfills, debugging, and one-off imports.

Sync engine status

GET/api/v1/data-source/sync/status

Get the SyncEngine’s current state — running flag, polling info, last sync timestamps.

Responses

200SyncEngine status

Start unified sync

POST/api/v1/data-source/sync/start

Start sync based on template configuration. Runs initial load if needed and registers incremental schedulers.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Responses

200Sync started based on template configuration

Initial load

POST/api/v1/data-source/sync/initial-load

Run a full initial data extraction. Use for first-time sync or when forcing a complete refresh.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Responses

200Initial load completed with summary

Incremental sync (one-off)

POST/api/v1/data-source/sync/incremental

Run a one-off incremental delta sync. Pulls changes since last sync timestamp.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Responses

200Incremental sync completed with summary
{
  "summary": {
    "source": "netsmart_crm",
    "recordsProcessed": 247,
    "recordsCreated": 12,
    "recordsUpdated": 235,
    "recordsFailed": 0,
    "durationMs": 8243
  }
}

Schedule incremental sync

POST/api/v1/data-source/sync/incremental/schedule

Register an automatic cron-based incremental sync for a source.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Request body

Cron expression and source name. Standard cron syntax (5-field).

{
  "sourceName": "netsmart_crm",
  "cronExpression": "*/15 * * * *",
  "enabled": true
}

Responses

200Incremental scheduler registered

List schedulers

GET/api/v1/data-source/sync/schedulers

List all active incremental cron schedulers.

Responses

200List of active schedulers

Flush stale schedulers

DELETE/api/v1/data-source/sync/schedulers

Remove stale or unused cron schedulers. Use during cleanup or when reconfiguring sync.

Responses

200Schedulers removed successfully

Replicate to domain tables

POST/api/v1/data-source/sync/replicate

Replicate from internal source tables to the USS domain tables. The final step in the sync pipeline that maps replicated data into entity records.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Responses

200Replication completed with summary

Verify replicated data

GET/api/v1/data-source/sync/verify

Verify replicated data in target tables. Useful for post-sync sanity checks and reconciliation.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Responses

200Verification results

Test source helpers

POST/api/v1/data-source/sync/seed-source

Seed test_source tables with sample data. Development and testing only — not for production use.

Responses

200Source data seeded successfully

Sync operations affect production data

These endpoints run real sync against configured external systems. Triggering an initial load against a production NetSmart CRM connection will hit the upstream system and may exceed rate limits. Use the test source for development; reach for production sync operations deliberately.