Postman > Task operations and automation
Complete task
This endpoint marks a task as complete. The URL differs depending on whether it’s a process task or a standalone task:
- Process task:
POST /organizations/{org_id}/runs/{run_id}/completed-tasks - Standalone task:
POST /organizations/{org_id}/completed-tasks
Replace {org_id} and {run_id} with your actual IDs.
Authorization: Bearer {your_access_token}Accept: application/jsonX-Tallyfy-Client: APIClientContent-Type: application/json
Fields:
task_id(string, required) - The ID of the task to complete.is_approved(boolean, required for approval tasks) - Settrueto approve,falseto reject. Ignored for non-approval tasks.override_user(integer, optional) - User ID to record as the completer instead of the authenticated user.
Note: Form field values can’t be sent in the completion request. Update form fields through the Update Task endpoint before completing. The API validates that all required form fields are filled before allowing completion.
Example body (simple completion):
{ "task_id": "TASK_ID_TO_COMPLETE"}Example body (approval task - approve):
{ "task_id": "APPROVAL_TASK_ID", "is_approved": true}These examples use the process task endpoint. For standalone tasks, drop the /runs/{run_id} segment from the URL.
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const runId = 'PROCESS_RUN_ID'; // null for standalone tasksconst taskId = 'TASK_ID_TO_COMPLETE';
const apiUrl = runId ? `https://go.tallyfy.com/api/organizations/${orgId}/runs/${runId}/completed-tasks` : `https://go.tallyfy.com/api/organizations/${orgId}/completed-tasks`;
const payload = { task_id: taskId, // is_approved: true, // Required for approval tasks};
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: 'POST', headers: headers, body: JSON.stringify(payload)}).then(response => { return response.json().then(data => { if (!response.ok) { console.error(`Failed to complete task ${taskId}:`, data); throw new Error(`HTTP error! status: ${response.status}`); } console.log(`Task ${taskId} completed. Status: ${response.status}`); return data; });}).then(data => { console.log('Completed task details:'); console.log(JSON.stringify(data, null, 2));}).catch(error => { console.error(`Error completing task ${taskId}:`, error.message);});import requestsimport jsonimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')run_id = os.environ.get('TALLYFY_RUN_ID') # None for standalone taskstask_id = 'TASK_ID_TO_COMPLETE'
if run_id: api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/runs/{run_id}/completed-tasks'else: api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/completed-tasks'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient', 'Content-Type': 'application/json'}
payload = { 'task_id': task_id, # 'is_approved': False, # Required for approval tasks}
response = Nonetry: response = requests.post(api_url, headers=headers, json=payload) response.raise_for_status()
completed_task = response.json() print(f'Successfully completed task {task_id}:') print(json.dumps(completed_task, indent=4))
except requests.exceptions.HTTPError as http_err: error_details = response.json() if response else "" print(f"HTTP error completing task {task_id}: {http_err}") print(f"Response: {error_details}")except requests.exceptions.RequestException as req_err: print(f"Request failed completing task {task_id}: {req_err}")import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;
public class CompleteTask { public static void main(String[] args) { String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN"); String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID"); String runId = System.getenv("TALLYFY_RUN_ID"); // null for standalone tasks String taskId = "TASK_ID_TO_COMPLETE";
String apiUrl; if (runId != null && !runId.isEmpty()) { apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/runs/%s/completed-tasks", orgId, runId); } else { apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/completed-tasks", orgId); }
// For approval tasks, add: "is_approved": true String jsonPayload = String.format("{\"task_id\": \"%s\"}", taskId);
HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) .header("Authorization", "Bearer " + accessToken) .header("Accept", "application/json") .header("X-Tallyfy-Client", "APIClient") .header("Content-Type", "application/json") .POST(HttpRequest.BodyPublishers.ofString(jsonPayload)) .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) { System.out.println("Successfully completed task " + taskId + ":"); System.out.println(response.body()); } else { System.err.println("Failed to complete task " + taskId + ". Status: " + response.statusCode()); System.err.println("Response: " + response.body()); } } catch (IOException | InterruptedException e) { System.err.println("Request failed: " + e.getMessage()); Thread.currentThread().interrupt(); } }}package main
import ( "bytes" "encoding/json" "fmt" "io" "net/http" "os" "time")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") if accessToken == "" { accessToken = "YOUR_PERSONAL_ACCESS_TOKEN" } orgId := os.Getenv("TALLYFY_ORG_ID") if orgId == "" { orgId = "YOUR_ORGANIZATION_ID" } runId := os.Getenv("TALLYFY_RUN_ID") // empty for standalone tasks taskId := "TASK_ID_TO_COMPLETE"
var apiUrl string if runId != "" { apiUrl = fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/runs/%s/completed-tasks", orgId, runId) } else { apiUrl = fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/completed-tasks", orgId) }
payloadData := map[string]interface{}{ "task_id": taskId, // "is_approved": true, // Required for approval tasks }
jsonData, err := json.Marshal(payloadData) if err != nil { fmt.Printf("Error marshalling JSON: %v\n", err) return }
client := &http.Client{Timeout: 15 * time.Second} req, err := http.NewRequest(http.MethodPost, apiUrl, bytes.NewBuffer(jsonData)) if err != nil { fmt.Printf("Error creating request: %v\n", err) return }
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient") req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req) if err != nil { fmt.Printf("Error executing request: %v\n", err) return } defer resp.Body.Close()
body, err := io.ReadAll(resp.Body) if err != nil { fmt.Printf("Error reading response: %v\n", err) return }
if resp.StatusCode != http.StatusOK { fmt.Printf("Failed to complete task %s. Status: %d\nBody: %s\n", taskId, resp.StatusCode, string(body)) return }
fmt.Printf("Successfully completed task %s:\n", taskId) var prettyJSON bytes.Buffer if err := json.Indent(&prettyJSON, body, "", " "); err == nil { fmt.Println(prettyJSON.String()) } else { fmt.Println(string(body)) }}#include <iostream>#include <string>#include <optional>#include <cpprest/http_client.h>#include <cpprest/json.h>
using namespace web;using namespace web::http;using namespace web::http::client;using namespace web::json;
pplx::task<void> CompleteTallyfyTask(const utility::string_t& taskId, std::optional<utility::string_t> runId = std::nullopt, std::optional<bool> isApproved = std::nullopt){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); utility::string_t orgId = U("YOUR_ORGANIZATION_ID");
utility::string_t apiUrlBase = U("https://go.tallyfy.com/api/organizations/") + orgId; utility::string_t apiUrl = runId ? apiUrlBase + U("/runs/") + runId.value() + U("/completed-tasks") : apiUrlBase + U("/completed-tasks");
value payload = value::object(); payload[U("task_id")] = value::string(taskId); if (isApproved.has_value()) { payload[U("is_approved")] = value::boolean(isApproved.value()); }
http_client client(apiUrl); http_request request(methods::POST);
request.headers().add(U("Authorization"), U("Bearer ") + accessToken); request.headers().add(U("Accept"), U("application/json")); request.headers().add(U("X-Tallyfy-Client"), U("APIClient")); request.headers().set_content_type(U("application/json")); request.set_body(payload);
return client.request(request).then([taskId](http_response response) { utility::string_t taskIdW = taskId; return response.extract_json().then([response, taskIdW](pplx::task<value> task) { try { value const & body = task.get(); if (response.status_code() == status_codes::OK) { std::wcout << L"Successfully completed task " << taskIdW << L":\n" << body.serialize() << std::endl; } else { std::wcerr << L"Failed to complete task " << taskIdW << L". Status: " << response.status_code() << L"\nResponse: " << body.serialize() << std::endl; } } catch (const std::exception& e) { std::wcerr << L"Error: " << e.what() << std::endl; } }); });}
int main() { try { // Complete a process task CompleteTallyfyTask(U("TASK_ID_1"), U("RUN_ID_1")).wait();
// Complete a standalone task CompleteTallyfyTask(U("ONEOFF_TASK_ID")).wait();
// Approve an approval task CompleteTallyfyTask(U("APPROVAL_TASK_ID"), U("RUN_ID_2"), true).wait(); } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; } return 0;}// Requires C++ REST SDK (Casablanca)using System;using System.Net.Http;using System.Net.Http.Headers;using System.Text;using System.Text.Json;using System.Text.Json.Serialization;using System.Threading.Tasks;
public class TallyfyTaskCompleter{ private static readonly HttpClient client = new HttpClient();
public class CompleteTaskPayload { [JsonPropertyName("task_id")] public string TaskId { get; set; }
[JsonPropertyName("is_approved")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? IsApproved { get; set; } // Required for approval tasks }
// Pass runId = null for standalone tasks public static async Task CompleteTaskAsync(string taskId, string runId, CompleteTaskPayload payload = null) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID";
string apiUrl = !string.IsNullOrEmpty(runId) ? $"https://go.tallyfy.com/api/organizations/{orgId}/runs/{runId}/completed-tasks" : $"https://go.tallyfy.com/api/organizations/{orgId}/completed-tasks";
if (payload == null) { payload = new CompleteTaskPayload(); } payload.TaskId = taskId;
try { using var request = new HttpRequestMessage(HttpMethod.Post, apiUrl); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); request.Headers.Add("X-Tallyfy-Client", "APIClient");
var options = new JsonSerializerOptions { DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; string jsonPayload = JsonSerializer.Serialize(payload, options); request.Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.SendAsync(request); string responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode) { Console.WriteLine($"Successfully completed task {taskId}:"); using var doc = JsonDocument.Parse(responseBody); Console.WriteLine(JsonSerializer.Serialize(doc.RootElement, new JsonSerializerOptions { WriteIndented = true })); } else { Console.WriteLine($"Failed to complete task {taskId}. Status: {response.StatusCode}"); Console.WriteLine($"Response: {responseBody}"); } } catch (HttpRequestException e) { Console.WriteLine($"Request error: {e.Message}"); } }
// Example usage: // static async Task Main(string[] args) // { // await CompleteTaskAsync("PROCESS_TASK_ID", "RUN_ID"); // await CompleteTaskAsync("STANDALONE_TASK_ID", null); // await CompleteTaskAsync("APPROVAL_TASK_ID", "RUN_ID", // new CompleteTaskPayload { IsApproved = true }); // }}A successful request returns 200 OK with the completed task details.
{ "data": { "id": "TASK_ID_TO_COMPLETE", "title": "Review Proposal", "status": "completed", "completed_at": "2025-05-20T17:00:00.000Z", "completer_id": 1001, "tasks_changed_by_rules": {} }}For process tasks, the response includes tasks_changed_by_rules showing any tasks affected by automation rules triggered by this completion. Standalone task responses don’t include this field.
The API returns an error if the task is already completed, the user lacks permission, required form fields aren’t filled, or the task has unresolved issues.
Workato > Complete Tallyfy tasks from Workato
Was this helpful?
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks