Delete Users and Companies

Userpilot supports data deletion to comply with right to be forgotten under (GDPR), under this right a European user can request to delete all his data. Userpilot supports this right not only for European users, but for all users. You can use Deletion APIs to schedule a job to delete the user data.

These APIs can be called in any language that supports HTTP requests, you only need to specify your api_key and a list of users or companies ids whose data should be deleted.

Authorization

Userpilot API uses API tokens to authenticate requests. You can view your API key in the Environment Page.

Your API key carries many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas.

Authentication to the API is performed via HTTP custom auth token, use -H 'Authorization: token <your API key here>'  to add your token.

Note: All API requests must be made over HTTPS.

Version

You have to send the api version in Headers. 

-H 'X-API-Version: 2020-09-22'

HTTP Endpoints

For most users, the HTTP API endpoint url is https://analytex.userpilot.io as the examples show.

However, if you are on Enterprise or EU hosting, refer to the Environment Page in the application to retrieve your dedicated endpoint.

Delete users API

Send a Delete request to delete users:

curl -X DELETE https://analytex.userpilot.io/v1/users \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token API_KEY' \
  -H 'X-API-Version: 2020-09-22' \
  -d '{"users": ["user_id", "user_id2",... // List of users IDs]}'

Delete companies API

Send a Delete request to delete companies:

curl -X DELETE https://analytex.userpilot.io/v1/companies \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token API_KEY' \
  -H 'X-API-Version: 2020-09-22' \
  -d '{"companies": ["company_id", "company_id2",.... // List of companies IDs]}'

Response

The delete APIs will schedule your request to delete users/companies, and a success request will return that corresponds to your delete request.

A success response will have a status of  202 accepted  and the following body:

{
    "message": "2 users have been scheduled for deletion"
}

Note: Deletions are scheduled to be executed every 24 hours (daily at 5:00 AM UTC).

Rate limit

Please note that these APIs are limited by 1 request every 2 seconds. You can check the limits on the response header. If you exceeded the limit we'll return  429 too many requests error.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.