Skip to content

Update template

Endpoint

PUT /organizations/{org_id}/checklists/{checklist_id}

This endpoint allows you to update the properties of an existing process template (blueprint) identified by its ID.

Request

Replace {org_id} with your Organization ID and {checklist_id} with the ID of the template you want to update.

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient
  • Content-Type: application/json

Body (JSON)

The request body requires a JSON object containing the template properties you wish to modify. You only need to include the fields you want to change.

Refer to the #definitions/createChecklistInput schema in the Swagger specification for the full list of updatable properties (it’s often the same or similar to the creation schema). Common fields to update include:

  • title (string)
  • summary (string)
  • owner_id (integer)
  • webhook (string)
  • guidance (string)
  • starred (boolean)
  • type (string)
  • users (array of integers) - Note: This usually replaces the existing list.
  • groups (array of strings) - Note: This usually replaces the existing list.

Example Body (Updating title and summary):

{
"title": "Updated Template Name",
"summary": "This template has been updated via the API."
}

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const checklistId = 'TEMPLATE_ID_TO_UPDATE';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/checklists/${checklistId}`;
const updateData = {
title: "Updated via JS Fetch",
starred: true // Let's star this template
};
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
headers.append('Content-Type', 'application/json');
fetch(apiUrl, {
method: 'PUT', // Use PUT for updates
headers: headers,
body: JSON.stringify(updateData)
})
.then(response => {
if (!response.ok) {
return response.json().then(errData => {
throw new Error(`HTTP error! status: ${response.status}, message: ${JSON.stringify(errData)}`);
}).catch(() => {
throw new Error(`HTTP error! status: ${response.status}`);
});
}
return response.json();
})
.then(data => {
console.log(`Successfully updated template ${checklistId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error('Error updating template:', error);
});

Response

A successful request returns a 200 OK status code and a JSON object containing the full details of the template after the update.

{
"data": {
"id": "TEMPLATE_ID_TO_UPDATE",
"title": "Updated via JS Fetch", // Updated title
"summary": "This template has been updated via the API.", // Original or updated summary
"starred": true, // Updated value
// ... other template properties reflecting the current state ...
"last_updated": "2024-05-20T12:30:00.000Z" // Timestamp reflects the update
}
}

If the template ID is not found, you lack permission, or the request body is invalid, you will receive an appropriate error status code (404, 403, 400, 422).