563848e0ecc0
Partially update a template, re-approving on file replacement
Updates one or more attributes (name, description, type, file) of an existing template. At least one must be provided; supplying none causes a 400.
When to use: Use this to rename a template, change its description or type, or replace its mappings CSV without going through the full create flow. For confirming column mappings in the legacy two-step flow use PUT /templates/{id} instead.
How: Send a multipart/form-data request with the required tenant-id header, {id} identifying an existing template for the tenant (404 otherwise), and any subset of the updatable fields. If file is supplied it must have a .csv extension and every mapping row must carry a mapped attribute (400 otherwise). A type of GROUP requires the tenant's supportGroupRosters configuration.
Returns: A SingleStepTemplateFlowResponse, with side effects depending on the branch taken. With file: the template's existing column records are deleted, new template.csv/mappings.csv objects are uploaded to GCS, new column records are created, schema.json is regenerated, and the resulting status (success, or failure if schema generation failed) is persisted and returned with the refreshed fields. Without file: only the metadata changes; the stored columns, artifacts, and status are preserved, and the response echoes the existing fields and status with the stored artifact object paths.
Path parameters
Server-generated ID of the template to update, as returned by the create endpoints.
Headers
Tenant that owns the template; scopes all reads and writes. Blank values are rejected with a 400.
Response
The updated template's resolved column mappings, status, and artifact object paths.
Example response
{
"fields": [
{
"name": "First Name",
"mappedKey": "firstName",
"mappedEntity": "practitioner",
"entityGroup": "license",
"validationRegex": "^\\d{10}$",
"separator": ";"
}
],
"status": "success",
"templateId": "3f8e2b6c-9d41-4a7b-b6a0-5e2f8c1d9a37",
"templateUrl": "roster/templates/3f8e2b6c-9d41-4a7b-b6a0-5e2f8c1d9a37/template.csv",
"schemaUrl": "roster/templates/3f8e2b6c-9d41-4a7b-b6a0-5e2f8c1d9a37/schema.json"
}