Skip to the content
  1. Docs
  2. Connect your users

Disconnect and erase a user

Core + Managed TransfersGuide · 1 min
Delete a connected user when your own user deletes their account. What gets erased, what stays, and why the call needs your Client Secret.

When one of your users deletes their account, or disconnects a music service in your app, delete the connected user in MusicAPI too. One call from your backend does it.

curl
curl -X DELETE "https://api.musicapi.com/public/integrations/user/3f0b8c1e-6a4d-4c7a-9a55-2f1e7d9b0c11" \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET"

Answers

StatusMeaning
204The user is erased. No body.
400The uuid is not a valid UUID.
401The request has no credential.
403The credential is not your Client Secret.
404Your account has no connected user with this uuid.

The call is idempotent: a second delete of the same user answers 204 again, so you can retry it safely.

What gets erased

  • The music-service access and refresh tokens. MusicAPI can no longer act for this user.
  • The user's name, email and profile image.
  • The copy of the user's library that Managed Transfers keeps.

What stays

MusicAPI keeps the uuid, the service's own user id and the country code, so your usage numbers and transfer history stay correct. None of them names a person on its own.

If the same person connects the same music account again later, they get the same integrationUserUUID back.

At the music service

Deleting the user in MusicAPI does not remove the permission at the music service. The user can remove the app in the "connected apps" settings of their music account.