Skip to content

Tutorial: Soft-delete a User

This tutorial shows how to soft-delete (deactivate) a user using the public API wrapper in People Cloud. The public endpoint performs a soft-delete only and will not permanently remove the user record.


Step 1: Make a POST Request to soft-delete a User

Send a POST request to the following public API endpoint (replace {id} with the user id):

POST /api/v1/user/{id}/soft-delete

Authorization

This endpoint requires authentication. Use a Bearer token from an authenticated user.

Request Headers

Authorization: Bearer <your_token_here>
Accept: application/json
Content-Type: application/json

Example cURL

curl -X POST "https://api.sbox2.peoplecloudpro.com/api/v1/user/15/soft-delete" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"

Step 2: Evaluate response

On success the API returns a concise JSON message such as {"message":"Successfully soft deleted this user"}.

Status Meaning Description
200 OK User soft-deleted successfully
401 Unauthorized The API token is invalid or missing
404 Not Found User id not found
422 Validation error Request was invalid
500 Server error Unexpected server-side error

Notes & Tips

  • This public API performs a soft-delete only, it will not permanently delete the user record.
  • The endpoint is protected by auth:api and isVerified middleware.
  • After soft-delete, the user record will typically be excluded from normal lists and treated as inactive by the platform.