563848e0ecc0
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 active — inactive 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.
Path parameters
ID of the egress template to update.
Headers
Response
The updated egress template, with incremented version and, if a new CSV was uploaded, the updated mappings CSV URL
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"
}