The users data endpoint allows you to delete user data either for one user, or for multiple users.
Important Note: Any data changed by calling this API will not be available in real time: processing time can be requires. See this section for more info.
The custom data API exposes two DELETE endpoints:
https://api.batch.com/1.0/BATCH_API_KEY/data/users/YOUR_USER_IDfor a single delete
https://api.batch.com/1.0/BATCH_API_KEY/data/usersfor bulk deletes
Bulk delete allow you to remove custom data for multiple users with one API call.
Here are two valid cURL examples.
curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X DELETE "https://api.batch.com/1.0/BATCH_API_KEY/data/users/YOUR_USER_ID"
curl -H "Content-Type: application/json" -H "X-Authorization: BATCH_REST_API_KEY" -X DELETE -d "@payload.json" "https://api.batch.com/1.0/BATCH_API_KEY/data/users"
BATCH_API_KEY value is either your Live or Dev Batch API key from the settings page of your app within the dashboard (Settings → General).
In order to authenticate with the API, you need to provide your company REST API Key as the value of the
For a single delete, there is no payload. You only need to provide the user id in the route.
For bulk deletes, you need to provide a valid JSON payload containing the list of user ids for whom to remove the custom data.
Here is a how a complete JSON payload looks like:
[ "user1", "user2", "user3" ]
NOTE: there is a limit of 10000 user ids per API call.
If the DELETE to the API endpoint is successful you will receive an HTTP 200 confirmation and a unique token reprensenting the transaction.
Please keep this token: it will be useful for upcoming features, and it will also help in getting faster support.
If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at email@example.com if you need further support.
AUTHENTICATION_INVALID(Http status code: 401, Error code: 10)
ROUTE_NOT_FOUND(Http status code: 404, Error code: 20)
MISSING_PARAMETER(Http status code: 400, Error code: 30)
MALFORMED_PARAMETER(Http status code: 400, Error code: 31)
MALFORMED_JSON_BODY(Http status code: 400, Error code: 32)
SERVER_ERROR(Http status code: 500, Error code: 1)
MAINTENANCE_ERROR(Http status code: 503, Error code: 2)