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.

Note: This feature is available to Enterprise plans only. You must be the root admin to use the APIs and be on the same team as the referenced user accounts.

Transferring 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://www.appsheet.com/api/v2/admin/apps/transferall?oldOwnerId=id&newOwnerId=id

Query parameters

You must pass the following as query parameters:

Query parameter

Description

oldOwnerId

User account ID for the current owner.

newOwnerId

User account ID to which you want to assign all apps.

Note: The users must be members of the same team.

Headers

You must also pass the following headers:

Header

Description

AccessKey

API key.

To generate an API key:

  1. Navigate to My Account > Settings.

  2. Under API Settings click Generate Api Key.

  3. Click Save.

UserId

Your user account ID.

Example

For example:

curl https://www.appsheet.com/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.

Deleting the user account

To delete a user account issue a POST request to the following API:

https://www.appsheet.com/api/v2/admin/users/delete?userId=id

Query parameter

You must pass the following as query parameters:

Query parameter

Description

userId

User account ID that you want to delete.

Headers

You must also pass the same Headers required when transferring app ownership.

Example

For example:

curl https://www.appsheet.com/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.

Did this answer your question?