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'
A note about base url
for most customers the API base url is https://api.userpilot.io
as the examples show.
However, if you are on the Growth or Enterprise plan which uses a custom endpoint, refer to the Installation page in Settings to retrieve your base url.
Delete users API
Send a Delete request to delete users:
curl -X DELETE https://api.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://api.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
Delete APIs will trigger a background job to delete users or 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: it may take up to 20 minutes until the users' data is deleted and the changes reflected on Userpilot after showing the success message in the response header.
Rate limit
Please note that these APIs are limited by 600 requests per minute, you can check the limits on the response header. If you exceeded the limit we'll return 429 too many requests
error
x-ratelimit-limit: 600, x-ratelimit-remaining: 599, x-ratelimit-reset: 1600854660000