Skip to content

Update process

Endpoint

PUT /organizations/{org_id}/runs/{run_id}

This endpoint allows you to update certain properties of an existing process instance (run).

Request

Replace {org_id} with your Organization ID and {run_id} with the ID of the process run 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 process properties you wish to modify. You only need to include the fields you want to change.

Refer to the #definitions/createRunInput schema (often similar for updates) in Swagger. Common updatable fields include:

  • name (string): New name for the process instance.
  • summary (string): New summary/description.
  • owner_id (integer): Change the process owner.
  • tags (array of strings): Replaces the current list of tag IDs associated with the process.
  • folders (array of strings): Replaces the current list of folder IDs.
  • prerun (array): Update kick-off form field values (structure depends on field type, see Launch Process).

Example Body:

{
"name": "Onboarding - Globex Corp (Updated)",
"summary": "Updated summary notes for this run.",
"tags": ["tag_id_urgent", "tag_id_onboarding"]
}

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const runId = 'PROCESS_RUN_ID_TO_UPDATE';
const apiUrl = `https://api.tallyfy.com/organizations/${orgId}/runs/${runId}`;
const updateData = {
name: "JS Updated Process Name",
summary: "Adding more details here."
// Add other fields like 'tags' or 'owner_id' if needed
};
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',
headers: headers,
body: JSON.stringify(updateData)
})
.then(response => {
if (!response.ok) {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
return response.json();
})
.then(data => {
console.log(`Successfully updated process ${runId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error updating process ${runId}:`, error);
});

Response

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

{
"data": {
"id": "PROCESS_RUN_ID_TO_UPDATE",
"name": "Onboarding - Globex Corp (Updated)", // Updated name
"summary": "Updated summary notes for this run.", // Updated summary
"tags": ["tag_id_urgent", "tag_id_onboarding"], // Updated tags
// ... other process properties reflecting the current state ...
"last_updated": "2024-05-21T22:00:00Z" // Timestamp reflects the update
}
}

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