Skip to content

API reference

Templates

Template authoring, versioning, and effective-resolution lookups across the four-tier inheritance chain.

Key points

  • Templates define what the engine schedules — entity types, event types, constraints, notifications
  • Four-tier inheritance: Platform → Application → Customer → Instance
  • Effective configuration is the merged result of the full inheritance chain
  • Versions follow draft → published → deprecated lifecycle; only published versions are usable

About templates

Templates are JSON configurations that define your domain. They layer through four tiers, with deeper tiers overriding shallower ones. Most operations against templates target a specific tier — customer-tier configuration changes don’t require republishing the underlying application template.

See the configuration framework for the full inheritance model with examples.

List templates

GET/api/v1/templates

Paginated list of templates the organization can read.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Query parameters

  • layerenum

    Filter by layer — platform, application, customer, instance

  • statusenum

    draft, published, deprecated

  • searchstring

    Search across templateId and name

  • tagsstring[]

    Filter by tag(s)

  • limitinteger

    Default 20, max 100

  • offsetinteger

    Default 0

Responses

200Paginated template list
{
  "items": [
    {
      "templateId": "home_care_v1",
      "name": "Home Care PACE",
      "layer": "application",
      "currentVersion": "1.4.0",
      "status": "published",
      "tags": ["healthcare", "pace"]
    }
  ],
  "total": 12,
  "limit": 20,
  "offset": 0
}
401Unauthorized

Get template

GET/api/v1/templates/{templateId}

Retrieve a specific template by ID. Optionally pin to a version.

Path parameters

  • templateIdstringrequired

    Template identifier

Query parameters

  • versionstring

    Specific version to retrieve. Defaults to current published version.

Responses

200Template configuration returned
404Template not found

Effective configuration

GET/api/v1/templates/{templateId}/effective

Return the merged result of the full inheritance chain — what the engine actually uses for this template in this organization.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Path parameters

  • templateIdstringrequired

    Template to resolve

Responses

200Resolved effective configuration with provenance
{
  "templateId": "home_care_v1_seniorlife",
  "resolvedFrom": [
    "platform/universal_person_scheduling@1.0.0",
    "application/home_care_v1@1.4.0",
    "customer/seniorlife@2.1.0",
    "instance/seniorlife_main_center@1.0.2"
  ],
  "config": {
    "entities": { ... },
    "eventTypes": { ... },
    "constraints": { ... },
    "operatingHours": {
      "monday": { "start": "07:00", "end": "19:00" }
    }
  }
}
404Template not found

When to use effective vs. raw

Use GET /templates/{id} when editing — you want to see one tier’s configuration in isolation. Use /effective when debugging — you want to see what the engine sees after all overrides have applied.

Validate

POST/api/v1/templates/{templateId}/validate

Validate a template configuration without persisting. Returns structured errors and warnings.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Path parameters

  • templateIdstringrequired

    Template ID

Request body

Configuration object to validate against the template schema and parent-tier expectations.

{
  "config": {
    "entities": { ... },
    "constraints": { ... }
  }
}

Responses

200Validation result. Check the isValid field; errors and warnings are always populated.
{
  "isValid": false,
  "errors": [
    {
      "path": "constraints.daily_hour_limit.rule",
      "code": "INVALID_EXPRESSION",
      "message": "Unknown variable 'travel_time' — declare it in extension_inputs"
    }
  ],
  "warnings": []
}
400Request body is not valid JSON

Versioning

Templates carry version history. New versions start as drafts, get reviewed and published, and eventually get deprecated. Only published versions are usable for live scheduling.

Version history

GET/api/v1/templates/{templateId}/versions

List all versions of a template with their status.

Headers

  • x-organization-idUUIDrequired

    Organization scope

Path parameters

  • templateIdstringrequired

    Template ID

Responses

200List of versions
{
  "versions": [
    { "version": "1.4.0", "status": "published", "publishedAt": "..." },
    { "version": "1.3.2", "status": "deprecated", "deprecatedAt": "..." },
    { "version": "1.5.0-rc.1", "status": "draft" }
  ]
}
404Template not found

Lifecycle endpoints

Four endpoints manage the version lifecycle:

  • POST /api/v1/templates/{templateId}/versions — create a new draft version (optionally based on an existing version)
  • PUT /api/v1/templates/{templateId}/versions/{version} — update a draft version’s configuration
  • POST /api/v1/templates/{templateId}/versions/{version}/publish — promote a draft to published. Validation runs server-side; bad templates fail with 400.
  • POST /api/v1/templates/{templateId}/versions/{version}/deprecate — mark a published version as deprecated. Existing references continue working; new uses are blocked.

Publish is one-way

Once published, a version cannot be edited. To change a published version, create a new draft (typically based on the published one), edit it, validate, and publish. The Config Studio handles this flow visually; the API requires explicit sequencing.