latestOpenAPI 3.1.02026-08-194237902.5 MB

563848e0ecc0

EgressTemplate

Update an existing egress template

Updates the metadata and/or mapping CSV of an existing egress template and increments its version.

When to use: call this to replace the column-mapping CSV or change configuration on a template previously created with POST /api/v1/egress-templates.

Partial-update semantics: only fields explicitly included in the request are changed; omitted fields keep their current stored values. entityType is immutable and is not an accepted field on this endpoint — it is always taken from the existing record.

Preconditions: tenant-id header must be present. The template must belong to the requesting tenant; cross-tenant access returns 404 (not 403). status, if supplied, is limited to draft or activeinactive is rejected with 400 on update.

Side effects: if a new CSV is supplied, it is uploaded to GCS at a new versioned path and the previous CSV object is left in place. Unlike create, a data-store write failure after a successful CSV upload does not roll back the new GCS object. file is optional; when omitted, the existing CSV is preserved.

Schedule field rules: the same daily/weekly/monthly/custom interdependencies as POST /api/v1/egress-templates apply.

Returns: the updated EgressTemplateResponse with the incremented version and, if a new CSV was uploaded, the updated mappingsCsvUrl.

put/api/v1/egress-templates/{templateId}

Path parameters

templateIdstring required

ID of the egress template to update.

Headers

tenant-idstring
x-user-idstring

Response

The updated egress template, with incremented version and, if a new CSV was uploaded, the updated mappings CSV URL

idstring

Server-assigned unique identifier of the template.

tenantIdstring

ID of the tenant that owns this template.

createdAtstring date-time
createdBystring

ID of the user who created the template.

updatedAtstring date-time
updatedBystring

ID of the user who last updated the template.

templateNamestring

Human-readable template name.

descriptionstring

Free-text description of the template's purpose.

entityTypestring

Entity type this template maps: practitioner, facility, or group. Immutable after creation.

outputFormatstring

Output file format produced by exports run from this template, e.g. csv.

separatorstring

Delimiter used in the output CSV.

statusstring

Template lifecycle status: draft, active, or inactive (soft-deleted).

versioninteger

Version number, incremented on each successful update. Not incremented by delete.

mappingsCsvUrlstring

GCS URL of the current mapping CSV for this template version.

scheduleEnabledboolean

Whether scheduled (unattended) exports are enabled for this template.

scheduleFrequencystring

Schedule cadence: daily, weekly, monthly, or custom. Null when no schedule is configured.

scheduleTimestring

Time of day the schedule runs, 24-hour HH:mm. Null when scheduleFrequency is custom or no schedule is configured.

scheduleDayOfWeekinteger

Day of week the schedule runs: 1 = Sunday ... 7 = Saturday. Only set when scheduleFrequency=weekly.

scheduleDayOfMonthinteger

Day of month (1-31) the schedule runs. Only set when scheduleFrequency=monthly.

scheduleCronstring

Quartz cron expression (6-7 fields, not standard 5-field Unix cron) defining the schedule. Only set when scheduleFrequency=custom.

scheduleTimezonestring

IANA timezone identifier the schedule runs in, e.g. America/New_York.

scheduleDaysOfWeekstring

Comma-separated days of week the schedule runs: 1 = Sunday ... 7 = Saturday. Only set when scheduleFrequency=weekly.

scheduleIntervalinteger

Interval in hours between runs (1, 2, 3, 4, 6, 8 or 12 — divisors of 24). Only set when scheduleFrequency=hourly.

lastExportAtstring date-time
nextExportAtstring date-time
jobTypestring

Derived export trigger type for the Activity Center UI: SCHEDULED when a schedule is enabled, MANUAL otherwise. Not persisted by the data store.

createdByNamestring

Display name resolved from createdBy, when resolvable. Null if resolution failed or has not been attempted; callers should fall back to createdByEmail then createdBy in that case.

createdByEmailstring

Email resolved from createdBy, when resolvable. Null if resolution failed or has not been attempted; used as the display fallback between createdByName and the raw createdBy id.

bqExportEnabledboolean
bqTableNamestring
bqDatasetstring

Example response

{
  "createdAt": "2022-03-10T16:15:50Z",
  "updatedAt": "2022-03-10T16:15:50Z",
  "scheduleCron": "0 0 8 ? * MON",
  "scheduleDaysOfWeek": "2,4,6",
  "scheduleInterval": 6,
  "lastExportAt": "2022-03-10T16:15:50Z",
  "nextExportAt": "2022-03-10T16:15:50Z"
}