Reassign Account

Use this endpoint to move an account to a different user within your company. This is useful when accounts have been grouped under the wrong user and need to be corrected programmatically — for example, when aggregated earnings are showing incorrect totals because two accounts belonging to the same worker are under different users.

📘

Private API key required

This endpoint requires a private API key (private_...). It is not accessible with a public key.

Here's an example request and response:

PATCH /v1/accounts/{account_id}/user

// No-param mode — creates a new user and moves the account there
Request body: {}

Response:
{
  "success": true,
  "error": null,
  "data": {
    "account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "new_user_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "old_user_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "old_user_deleted": true
  }
}

Let's dive into the request parameters and response fields.

Request parameters

All parameters are optional. Sending an empty body creates a new user and moves the account there.

ParameterTypeDescription
smartboolean | nullIf true, find other accounts in your company with the same phone identifier and move this account to the user of the one with the most recent successful connection. Cannot be combined with user_id or external_id.
user_idstring | nullUUID of an existing user in your company to move the account to. Returns 404 if not found.
external_idstring | nullYour internal identifier for the target user. If a user with this external_id exists, the account is moved there. If not, a new user is created with this external_id.
📘

smart is mutually exclusive

Sending smart: true alongside user_id or external_id returns a 400 error.

Response

DataDescriptionTypeExample
account_idThe account that was reassignedstringa1b2c3d4-e5f6-7890-abcd-ef1234567890
new_user_idThe user the account now belongs tostringb2c3d4e5-f6a7-8901-bcde-f12345678901
old_user_idThe user the account previously belonged tostringc3d4e5f6-a7b8-9012-cdef-123456789012
old_user_deletedtrue if the previous user had no remaining accounts and was automatically deletedbooleantrue

Behavior modes

Params sentBehavior
(none)Creates a new empty user, moves the account there.
smart: trueFinds accounts with the same phone identifier in your company. Moves to the user of the account with the most recent successful connection. Returns 400 if the account's identifier_type is not phone. Returns 404 if no matching accounts are found.
external_idFinds a user with that external_id in your company. If found, moves the account there. If not, creates a new user with that external_id and moves the account.
user_idFinds the user in your company and moves the account. Returns 404 if the user is not found.
user_id + external_idMoves the account to the specified user. If that user's external_id doesn't match the one you sent, it is updated to match.

In all modes, if the previous user ends up with no remaining accounts, it is automatically deleted and old_user_deleted is set to true in the response.