Profile locking is used to permanently delete a Profile by clearing its data and preventing any further data inserts to the specified Profile. Normal delete will only wipe the profile contents, but will allow subsequent data inserts.


Whenever a profile exists, it's lock exists. This lock can either be true or false and is false by default. A lock is never created through the API because it is automatically created when the profile is created. The locked is never deleted from the API, it is automatically removed when the profile is removed.

A profile's lock shares the id of the profile. It can be retrieved or updated using the id of the profile. Locks can also be retrieved using the profile's merged ids if any exist. Lock id and profile id are synonyms from the perspective of profile locking.


There are some important points to remember while working with profile locks.

  • When a profile is locked, its sessions, attributes and services are removed. Unlocking a profile will essentially return an empty profile.
  • When a temporary profile is locked and then merged into a canonical profile, the canonical profile will be locked as well. The profile cannot be operated on neither through the temporary profile Id nor the canonical profile Id.
  • When the canonical profile is unlocked, then both the canonical profile id and the temporary profile id(s) can be used to operate on the profile.


Update a Profile Lock

Profile lock can be updated by making a PUT request to /v1/companies/:companyId/buckets/:bucketId/profile-locks/lockId where lockId is the id of the profile. The response if successful will return a status code of 200 OK and an entity with the updated representation of the resource.


Required permission profile.lock.update


Request Headers

Header

Required

Acceptable Value(s)

Description

Content-typeYesapplication/json
AcceptYesapplication/json, application/javascript, image/*Image response will return a 1x1 pixel result.
Content-encodingNogzipCaller can send a gzipped request to the API and set the Content-encoding as gzip.
Accept-encodingNogzip

Caller can request a gzipped response from the API and set the Accept-encoding as gzip.


Example: Updating a profile lock


Request Body
{
   "id":"<lockId>",
    "lock":<true|false>


Response body
{
    "profileLock":{
       "id":"<lockId>",
       "lock":"<true|false>"
   },
   "links":{
       "self":"<url>"
   }
}



Get a Profile Lock

Profile lock can be retrieved by making a GET request to /v1/companies/:companyId/buckets/:bucketId/profile-locks/lockId where lockId is the id of the profile. The response if successful will return a status code of 200 OK and an entity with the representation of the resource.


Required permission profile.lock.read


Request Headers

Header

Required

Acceptable Value(s)

Description

AcceptYesapplication/json, application/javascript, image/*Image response will return a 1x1 pixel result.
Accept-encodingNogzip

Caller can request a gzipped response from the API and set the Accept-encoding as gzip.


Example: Retrieve a profile lock


Response body
{
    "profileLock":{
       "id":"<lockId>",
      "lock":"<true|false>"
   },
   "links":{
       "self":"<url>"
   }
}

Getting a locked profile

Retrieving a locked profile will return a response with the status code 403 FORBIDDEN. Since there are multiple reasons for a 403 FORBIDDEN, therefore, if more detail about why the response was 403 FORBIDDEN is required, then the entity of the response body must be read. The entity contains, the "statusCode", "subStatusCode" and "message" fields. Sub status code for a locked profile will be 2.


Example: Forbidden profile response


Response body

   "statusCode":403,
   "subStatusCode":2,
   "message":"Profile with id <profileId> is locked"
}