Reassign work and remove member
Splitting a member’s work as you remove them
Section titled “Splitting a member’s work as you remove them”POST /organizations/{org_id}/users/{user_id}/reassign-granular
This deactivates a member in your Tallyfy organization and hands their work to the people you pick, in one call. You can give their templates, template steps and open tasks to different members, one by one or a whole type at once, or take that work away. It removes the member the same way remove member does: they lose access to this organization, but their Tallyfy account isn’t deleted.
You’ll need admin permissions. Bot users can’t be removed. There’s no screen for this in Tallyfy, so you call it through the API.
Call get reassignment options first. It shows what the member holds and gives you the item IDs this call takes.
What moves and what stays
Section titled “What moves and what stays”- Their open tasks follow your rules. Those are the tasks they’re assigned to or created that aren’t completed, archived or in an archived process.
- Completed tasks, archived tasks and tasks in archived processes stay with the removed member, so your records still show who did that work. You can’t name them in
items. - Archived templates keep the removed member as their creator and owner.
- Every process they started, own or are a member of goes to the default member, archived ones included. You can’t split processes up.
- Their scheduled jobs go to the default member once the removal is done, but only the jobs that person can run. Any other job stays with the removed member.
- Tallyfy emails each person who receives work a list of it, but the lists come from a short sample of the member’s work: at most 10 templates, 10 steps, 10 processes, 15 process tasks and 10 one-off tasks. If none of someone’s new work is in that sample, they get no email. Scheduled jobs are never listed, and work you take away isn’t listed to anyone.
Request
Section titled “Request”Replace {org_id} with your organization ID. Replace {user_id} with the member’s numeric ID.
Headers
Section titled “Headers”Authorization: Bearer {your_access_token}Accept: application/jsonX-Tallyfy-Client: APIClientContent-Type: application/json
Body (JSON)
Section titled “Body (JSON)”Every field is optional. Anything no rule covers goes to the default member.
default_to_user_id(integer) - The default member. They take every process, and anything you don’t send somewhere else. It must be an active member of this organization, and not the member you’re removing. Leave it out and the default member is you, the administrator making the call.templates,stepsandtasks(object) - A rule for every item of that type. Each takes anactionofreassignorremove, and withreassign, ato_user_idnaming the active member who takes them.items(array, up to 600 entries) - Rules for single items. Each entry takes atypeoftemplate,steportask, the item’sidas a string, anactionofreassignorremove, and withreassign, ato_user_id. Use theidvalues from theitemslists that get reassignment options returns.
Each item follows the first rule that names it: its own entry in items, then the rule for its type, then the default member. If items names the same ID twice, the first entry counts.
What remove does:
- For a template, the member stops being a member of it. If they created or own it, that passes to the default member, because a template always needs a creator and an owner.
- For a step, they’re taken off the template step, and nobody is put in their place.
- For a task, they’re taken off the task, and nobody is put in their place. If they created it, the default member becomes its creator.
{ "default_to_user_id": 1002, "templates": { "action": "reassign", "to_user_id": 1003 }, "steps": { "action": "remove" }, "items": [ { "type": "task", "id": "9f8e7d6c5b4a39281706f5e4d3c2b1a0", "action": "reassign", "to_user_id": 1004 }, { "type": "task", "id": "0a1b2c3d4e5f60718293a4b5c6d7e8f9", "action": "remove" } ]}This gives their templates to member 1003 and takes them off every template step. Member 1004 takes one task, and the member is taken off another. Their other open tasks and all their processes go to member 1002.
An empty body, {}, hands you everything that moves.
Code samples
Section titled “Code samples”const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const userId = 12345;
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/users/${userId}/reassign-granular`;
const payload = { default_to_user_id: 1002, templates: { action: 'reassign', to_user_id: 1003 }, steps: { action: 'remove' }, items: [ { type: 'task', id: '9f8e7d6c5b4a39281706f5e4d3c2b1a0', action: 'reassign', to_user_id: 1004 }, { type: 'task', id: '0a1b2c3d4e5f60718293a4b5c6d7e8f9', action: 'remove' } ]};
fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${accessToken}`, 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient', 'Content-Type': 'application/json' }, body: JSON.stringify(payload)}).then(response => { if (!response.ok) { return response.text().then(body => { throw new Error(`${response.status} ${body}`); }); } return response.json();}).then(data => { console.log(`Member ${userId} removed:`, data.message);}).catch(error => { console.error(`Error removing member ${userId}:`, error.message);});import requestsimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')user_id = 12345
api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/users/{user_id}/reassign-granular'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient', 'Content-Type': 'application/json'}
payload = { 'default_to_user_id': 1002, 'templates': {'action': 'reassign', 'to_user_id': 1003}, 'steps': {'action': 'remove'}, 'items': [ {'type': 'task', 'id': '9f8e7d6c5b4a39281706f5e4d3c2b1a0', 'action': 'reassign', 'to_user_id': 1004}, {'type': 'task', 'id': '0a1b2c3d4e5f60718293a4b5c6d7e8f9', 'action': 'remove'} ]}
try: response = requests.post(api_url, headers=headers, json=payload) response.raise_for_status() print(f"Member {user_id} removed: {response.json()['message']}")except requests.exceptions.RequestException as e: print(f"Error removing member {user_id}: {e}") if hasattr(e, 'response') and e.response is not None: print(f"Response: {e.response.text}")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 ReassignWorkAndRemoveMember { 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"); int userId = 12345; String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/users/%d/reassign-granular", orgId, userId);
// Text blocks need Java 15 or later String jsonPayload = """ { "default_to_user_id": 1002, "templates": { "action": "reassign", "to_user_id": 1003 }, "steps": { "action": "remove" }, "items": [ { "type": "task", "id": "9f8e7d6c5b4a39281706f5e4d3c2b1a0", "action": "reassign", "to_user_id": 1004 }, { "type": "task", "id": "0a1b2c3d4e5f60718293a4b5c6d7e8f9", "action": "remove" } ] } """;
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("Member removed. Response: " + response.body()); } else { System.err.println("Failed: " + response.statusCode() + " - " + 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" } userId := 12345
apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/users/%d/reassign-granular", orgId, userId)
payload := map[string]interface{}{ "default_to_user_id": 1002, "templates": map[string]interface{}{"action": "reassign", "to_user_id": 1003}, "steps": map[string]interface{}{"action": "remove"}, "items": []map[string]interface{}{ {"type": "task", "id": "9f8e7d6c5b4a39281706f5e4d3c2b1a0", "action": "reassign", "to_user_id": 1004}, {"type": "task", "id": "0a1b2c3d4e5f60718293a4b5c6d7e8f9", "action": "remove"}, }, } jsonPayload, err := json.Marshal(payload) if err != nil { fmt.Printf("Error building request body: %v\n", err) return }
client := &http.Client{Timeout: 30 * time.Second} req, err := http.NewRequest(http.MethodPost, apiUrl, bytes.NewReader(jsonPayload)) 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("Member %d removed: %s\n", userId, string(body)) } else { fmt.Printf("Failed: %d - %s\n", resp.StatusCode, string(body)) }}#include <iostream>#include <string>#include <vector>#include <cpprest/http_client.h>#include <cpprest/json.h>
using namespace web;using namespace web::http;using namespace web::http::client;
// One rule: an action, and with "reassign", the member who takes the workjson::value Rule(const utility::string_t &action, int toUserId = 0){ json::value rule; rule[U("action")] = json::value::string(action); if (toUserId > 0) { rule[U("to_user_id")] = json::value::number(toUserId); } return rule;}
// A rule for one item, by its type and the id from get reassignment optionsjson::value Item(const utility::string_t &type, const utility::string_t &id, const utility::string_t &action, int toUserId = 0){ json::value item = Rule(action, toUserId); item[U("type")] = json::value::string(type); item[U("id")] = json::value::string(id); return item;}
pplx::task<void> ReassignWorkAndRemoveMember(int userId){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); utility::string_t orgId = U("YOUR_ORGANIZATION_ID");
uri_builder builder(U("https://go.tallyfy.com/api/organizations/")); builder.append_path(orgId); builder.append_path(U("users")); builder.append_path(utility::conversions::to_string_t(std::to_string(userId))); builder.append_path(U("reassign-granular"));
json::value payload; payload[U("default_to_user_id")] = json::value::number(1002); payload[U("templates")] = Rule(U("reassign"), 1003); payload[U("steps")] = Rule(U("remove")); payload[U("items")] = json::value::array(std::vector<json::value>{ Item(U("task"), U("9f8e7d6c5b4a39281706f5e4d3c2b1a0"), U("reassign"), 1004), Item(U("task"), U("0a1b2c3d4e5f60718293a4b5c6d7e8f9"), U("remove")) });
http_client client(builder.to_string()); 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.set_body(payload); // Also sets Content-Type: application/json
return client.request(request).then([userId](http_response response) { return response.extract_string().then([userId, status = response.status_code()](utility::string_t body) { if (status == status_codes::OK) { ucout << U("Member ") << userId << U(" removed: ") << body << std::endl; } else { ucerr << U("Failed: ") << status << U(" - ") << body << std::endl; } }); });}
int main() { try { ReassignWorkAndRemoveMember(12345).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.Threading.Tasks;
public class TallyfyGranularRemover{ private static readonly HttpClient client = new HttpClient();
public static async Task ReassignWorkAndRemoveMemberAsync(int userId) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID"; var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/users/{userId}/reassign-granular";
var payload = new { default_to_user_id = 1002, templates = new { action = "reassign", to_user_id = 1003 }, steps = new { action = "remove" }, items = new object[] { new { type = "task", id = "9f8e7d6c5b4a39281706f5e4d3c2b1a0", action = "reassign", to_user_id = 1004 }, new { type = "task", id = "0a1b2c3d4e5f60718293a4b5c6d7e8f9", action = "remove" } } };
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"); request.Content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await client.SendAsync(request); string responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode) { Console.WriteLine($"Member {userId} removed: {responseBody}"); } else { Console.WriteLine($"Failed: {response.StatusCode} - {responseBody}"); } }
// static async Task Main(string[] args) => await ReassignWorkAndRemoveMemberAsync(12345);}Response
Section titled “Response”You’ll get 200 OK with a short message. There’s no data object.
Success response example
Section titled “Success response example”{ "message": "User reassigned successfully with granular control"}Error responses
Section titled “Error responses”On any error, nobody is removed and nothing moves. The 403 body is plain text. The 404, the 409 and the first three 422 errors below come back in message. The other 422 errors are validation errors, with the message under errors for the field it’s about, such as default_to_user_id or items.0.id.
| Status | Error message | What to do |
|---|---|---|
| 403 | Forbidden. | Only an administrator can call this. Use an administrator’s access token. |
| 404 | Resource not found | The user ID isn’t a member of this organization. Check the ID. |
| 409 | Someone else is changing this group or one of its tasks right now. Try again in a moment. | Someone is changing one of the member’s groups at the same moment. Send the same request again. |
| 422 | You can't remove a bot user from this organization! | Bot users can’t be removed. |
| 422 | Cannot modify the default administrator. Please assign another member as default administrator first. | The member is an administrator and no other active administrator exists. Make another member an administrator first. |
| 422 | The reassignment target user (ID: 1004) is no longer an active member of this organization. | A member you named left the organization while the request ran. Pick someone else. |
| 422 | The specified default user does not exist. | default_to_user_id isn’t an active member of this organization. Pick one who is. |
| 422 | The default_to_user_id and user being disabled must be different. | default_to_user_id is the member you’re removing. Pick someone else. |
| 422 | You are the member being disabled, so a default_to_user_id is required. | You’re removing yourself. Send default_to_user_id with another member’s ID. |
| 422 | The templates.to_user_id and user being disabled must be different. | A to_user_id names the member you’re removing. Pick someone else. Steps, tasks and items get the same message with their own field name. |
| 422 | A user ID is required when reassigning templates. | A reassign rule has no to_user_id. Steps, tasks and items get the same message for their type. |
| 422 | The specified user for template reassignment does not exist. | A to_user_id isn’t an active member of this organization. Steps, tasks and items get the same message for their type. |
| 422 | Template action must be either "reassign" or "remove". | Send reassign or remove. Steps, tasks and items get the same message for their type. |
| 422 | Item type must be "template", "step" or "task". | Fix the entry’s type. |
| 422 | This template does not belong to the member being disabled in this organization. | The ID isn’t one of the member’s templates. Use an ID from the templates items list in get reassignment options. |
| 422 | This step assignment does not belong to the member being disabled in this organization. | The member isn’t assigned to that step. Use an ID from the steps items list. |
| 422 | This task is not an active, reassignable task of the member being disabled (completed tasks, archived tasks and tasks in archived processes are preserved). | The task is completed, archived or in an archived process, or it isn’t theirs. Leave it out. |
| 422 | Another validation error | A field has the wrong type, an action is missing, or items has more than 600 entries. |
Related articles
Section titled “Related articles”Members > Get reassignment options
Org Settings > Member deletion
Org Settings > Remove a member