Update Templates
Updates the specified template(s).
Note
A template cannot be moved to a different organization on update; its organizationId is fixed. The organizationId field is still required in the request body, but any value other than the template's current organization is ignored rather than rejected.
| Verb | PATCH |
|---|---|
| Endpoint | {base-url}/templates/ |
| Max Page Size | N/A |
Request body
{
"body": [
{
"id": 406,
"organizationId": 1,
"name": "Lunch Room Template",
"comment": "updated comment",
"count": 0
}
]
}
Note
All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.
Returns
On Success
Echoes back the provided models.
Response Body
[
{
"id": 406,
"organizationId": 1,
"name": "Lunch Room Template",
"comment": "updated comment",
"count": 24,
"createdAt": "2021-08-13T14:11:39.41"
}
]
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 403 | DATA_ACCESS_VIOLATION | One or more of the specified template id values belong to an organization you do not have access to. |
| 404 | MISSING_RECORD | One or more of the specified template id values does not exist. |
| 422 | VALIDATION_ERROR | A required field is missing or invalid (e.g. organizationId must be a positive integer, name is required and must be 25 characters or fewer, comment must be 100 characters or fewer). |