When a user leaves the organization, you can automate the removal of their user account using the AppSheet API to transfer app ownership and delete the user account as described in the following sections.
- Teams are supported for AppSheet Enterprise accounts only.
- You must have team root or admin permissions to use the APIs and be on the same team as the referenced user accounts.
Transfer app ownership
To transfer ownership of all apps owned by a user account to another user account within a team issue a POST
request to the following API:
https://{appsheet-region}/api/v2/admin/apps/transferall?oldOwnerId={id}&newOwnerId={id}
Where:
Variable | Description |
|
Domain used to invoke the API based on the supported data residency regions. Valid values include:
Note: The |
Query parameters
You must pass the following as query parameters:
Query parameter |
Description |
|
User account ID for the current owner. |
|
User account ID to which you want to assign all apps. Note: The users must be members of the same team. |
Headers
You must pass the AccessKey
and UserId
headers, as described in Manage and monitor your team using the API.
Example
For example:
curl https://{appsheet-region}/api/v2/admin/apps/transferall?oldOwnerId=14853665&newOwnerId=14853667 \
\
-X POST
-H "AccessKey: DcTx1-TFq3c-7ka6t-PcnnI-7d0dO-M4wTm-vWwx0-1KBte" \
-H "UserId: 1234567"
If successful, the API call returns 200 OK
.
Delete the user account
To delete a user account issue a POST
request to the following API:
https://{appsheet-region}/api/v2/admin/users/delete?userId={id}
Where:
Variable | Description |
|
Domain used to invoke the API based on the supported data residency regions. Valid values include:
Note: The |
Query parameter
You must pass the following as query parameters:
Query parameter |
Description |
|
User account ID that you want to delete. |
Headers
You must pass the AccessKey
and UserId
headers, as described in Manage and monitor your team using the API.
Example
For example:
curl https://{appsheet-region}/api/v2/admin/users/delete?userId=14853665 \
-X POST \
-H "AccessKey: DcTx1-TFq3c-7ka6t-PcnnI-7d0dO-M4wTm-vWwx0-1KBte"
-H "UserId: 1234567"
If successful, the API call returns 200 OK
.