Skip to content

Archive process

Endpoint

DELETE /organizations/{org_id}/runs/{run_id}

This endpoint archives a specific process instance (run). Archiving typically hides the process from default views but retains its data and allows it to be restored later.

Request

Replace {org_id} with your Organization ID and {run_id} with the ID of the process run to archive.

Headers

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

Body

No request body is needed for this DELETE request.

Code Samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const runId = 'PROCESS_RUN_ID_TO_ARCHIVE';
const apiUrl = `https://api.tallyfy.com/organizations/${orgId}/runs/${runId}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'DELETE',
headers: headers
})
.then(response => {
if (!response.ok) { // Expect 200 OK
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
console.log(`Successfully archived process ${runId}. Status: ${response.status}`);
return response.json(); // Archive usually returns the updated process
})
.then(data => {
console.log('Archived process details:');
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error archiving process ${runId}:`, error);
});

Response

A successful request returns a 200 OK status code. The response body usually contains the details of the archived process run, now including an archived_at timestamp and likely a status of archived.

{
"data": {
"id": "PROCESS_RUN_ID_TO_ARCHIVE",
"name": "Old Completed Project",
"status": "archived", // Status reflects archive
// ... other process properties ...
"archived_at": "2024-05-22T10:00:00Z" // Timestamp indicates archival
}
}

If the process run ID is not found or you lack permission, a 404 or 403 error will be returned.