latestOpenAPI 3.1.02026-08-194237902.5 MB

563848e0ecc0

Template

Update a roster template built from scratch

Updates a scratch-built roster template (CP-31959) from a revised list of column definitions. Rewrites the template/mappings CSVs, replaces the column records, and regenerates the schema.

patch/templates/{id}/scratch

Path parameters

idstring required

Template ID to update

Headers

tenant-idstring required

Tenant identifier

Request body

templateNamestring
descriptionstring
type'PRACTITIONER' | 'FACILITY' | 'GROUP'

Example request

{
  "columns": [
    {
      "name": "First Name",
      "mappedKey": "firstName",
      "mappedEntity": "practitioner",
      "entityGroup": "license",
      "validationRegex": "^\\d{10}$",
      "separator": ";"
    }
  ]
}

Response

Template updated successfully

statusstring

Final template status. success when the validation schema was generated and the template is ready for roster uploads; failure when schema generation failed with an I/O error. Metadata-only updates preserve and return the template's existing status.

templateIdstring

Server-generated ID of the created or updated template.

templateUrlstring

GCS object path (not a signed URL) of the stored template CSV. Fetch a signed download URL via GET /templates/{id}, which returns it as templateUrl in the record's data.

schemaUrlstring

GCS object path (not a signed URL) of the generated JSON validation schema. Fetch a signed download URL via GET /templates/{id}, which returns it as schemaUrl in the record's data.

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"
}