Request
To delete an existing user profile, send a POST request to:
https://<host>:<port>/ups/v2/user/userprofiles/{profileId}/actions/delete
The request will fail if:
-
The user profile that is in use is a child profile. A profile can only be deleted by a non-child user.
-
The profile to be deleted is the default profile.
-
The profile to be deleted is the profile that is in use.
By default the platform checks the parental PIN on this request. See Server-side PIN checks in PIN and parental control management.
The earlier version of this request, DELETE /ups/v1/user/userprofiles/{profileId}, is deprecated. It doesn't check the PIN.
Headers
-
Authorization– the client's access token, as a bearer token (Bearer <access token>). This is theaccess_tokenthat the client gets when it signs in – see Authentication token. This header is mandatory. -
Content-Type: application/json -
x-correlation-id– identifier for logging, to correlate messages across a call flow
Mandatory arguments
-
profileId(in URL) – the ID of the profile to be deleted
Other arguments
-
pin(in body) – the PIN that the user entered. Required when the platform checks the PIN (the default). Otherwise it is ignored.
Example
A request with this payload deletes the profile in the URL:
{
"pin": "1234"
}
Response
A successful request returns an HTTP 200 status, for example:
{
"matchedCount": 1,
"deletedCount": 1
}
A bad request returns an HTTP 400 status – for example:
-
"errorCode": 4106– a PIN is required but the request has nopin. -
"errorCode": 8125– the profile is the one in use. -
"errorCode": 8126– the profile is the default profile. -
"errorCode": 8127– the profile in use is a child profile.
An unauthorised request returns an HTTP 401 status ("errorCode": 1001) if the account has no PIN of the type that is checked.
A forbidden request returns an HTTP 403 status – for example, if the PIN is wrong ("errorCode": 4566), if the PIN is locked or only a limited number of attempts are left ("errorCode": 7123), or if the access token is missing, invalid, or has expired.
If the profile does not exist, the request returns an HTTP 404 status ("errorCode": 8128).
See also
For full details of this API, see the User Profiles Service (UPS) API documentation.