Migrate from the old to the new user properties
Staffbase constantly improves its platform and features to maximize value for its users. As a part of such an improvement, Staffbase has introduced changes to its user model to make it less complex and easier to understand. Staffbase will soon replace some existing user properties with new ones.
The following properties will be removed:
- From the request payload:
enabled
- From the response payload:
enabled
pending
verificationCode
Currently, the user object contains, among others, the following properties:
1{2 "enabled":true,3 "id":"64ba4d726c1c2406577e6582",4 "pending":true,5 "secret":{6 "expires":-1,7 "plain":"ehfFEGCQXK"8 },9 "emails":[10 {11 "value":"max.mustermann@staffbase.com",12 "primary":true,13 "providerID":"staffbase"14 }15 ],16 "status":"pending",17 "verificationCode":{18 "mail":"max.mustermann@staffbase.com",19 "value":"ehfFEGCQXK"20 }21}
With the removal of the properties enabled
and pending
from the response payload you can use the property status
to get the user's current status on the platform.
Old Properties | New Properties |
---|---|
apiResponse.enabled && apiResponse.pending | apiResponse.status=pending |
apiResponse.enabled && !apiResponse.pending | apiResponse.status=activated |
!apiResponse.enabled && !apiResponse.pending | apiResponse.status=deactivated |
With the removal of the property verificationCode
from the response payload, you can use the properties secret
and emails
to get the necessary information.
Old Properties | New Properties |
---|---|
apiResponse.verificationCode.mail | apiResponse.emails[primary=true].value |
apiResponse.verificationCode.value | apiResponse.secret.plain |
With the removal of the property enabled
from the request payload you can use the property status
to reactivate or deactivate a user in the platform.
Currently, to deactivate a user, you would send a PUT request with {"enabled": false}
.
The new approach to deactivate a user is to send a PUT request with {"status": "deactivated"}
.
For more information, see the offboarding guide.