User PUT Resources
Update a user
PUT /users/:id
or for updating the current session user
PUT /users/me
Parameter | Type | Nullable | Required | Description |
---|---|---|---|---|
email |
string |
✗ | ✗ | max. 191 characters. |
unique_id |
string |
✓ | ✗ | max. 100 characters. |
firstname |
string |
✗ | ✗ | max. 50 characters. |
lastname |
string |
✗ | ✗ | max. 50 characters. |
language |
string (language code) |
✗ | ✗ | The interface langauge for the user. |
gender |
string |
✗ | ✗ | gender code (m = male, f = female, u = unspecified) |
location |
string |
✓ | ✗ | Location specific information (department, etc.). Max. 100 characters. |
about |
text |
✓ | ✗ | Text to describe the user. This information is showed in the user profile. Max. 100 characters. |
country |
string |
null | ✗ | Country code in ISO 3166-2 format like ch, de, us. |
company |
text |
null | ✗ | Company of the user. Max. 255 characters. |
department |
text |
null | ✗ | Department of the user. Max. 255 characters. |
position |
text |
null | ✗ | Position of the user. Max. 255 characters. |
employment_start |
datetime |
null | ✗ | The employment start date of the user in format yyyy-mm-dd. |
customfields |
object |
✓ | ✗ | An object specifying the users custom fields |
auth_type |
string |
✓ | ✗ | Specific Auth Type for the user. If not set, the network default Auth Type is selected. List of all Auth Types. |
is_hidden |
boolean |
false | ✗ | Whether the user is a hidden user or not |
is_system |
boolean |
false | ✗ | Whether the user is a system user or not |
Json Payload
{
"unique_id": "00.42",
"firstname": "Sherlock",
"lastname": "Holmes",
"email": "sherlock.holmes@example.com",
"auth_type": "simple",
"language": "en",
"gender": "m",
"country": "uk",
"about": "Detective",
"country": "uk",
"company": "Ward, Lock & Co",
"department": "Investigations",
"position": "Master Detective",
"location": "London",
"is_activated": true,
"customfields": { "occupation": "Detective" }
}
Be aware that if customfields
are sent, only the fields set in the request will remain on the user. Unspecified fields will be reset to null
.
Response
{
"id": 42,
"unique_id": "00.42",
"is_deleted": false,
"is_hidden": false,
"is_system": false,
"firstname": "Sherlock",
"lastname": "Holmes",
"email": "sherlock.holmes@example.com",
"auth_type": "simple",
"language": "en",
"gender": "m",
"location": "London",
"about": "Detective",
"country": "uk",
"company": "Ward, Lock & Co",
"department": "Investigations",
"position": "Master Detective",
"image": "http://appdata.starmind.local/static/user/default.jpg",
"first_seen": "2015-02-02T11:31:05.000Z",
"last_seen": "2015-08-09T11:31:05.000Z",
"customfields": { "occupation": "Detective" },
"score_level": null,
"score_points": null,
"disclaimer_agreement": null,
"event_tracking_id": "95543d35-255c-11e9-86c5-0242ac110007"
}
Restore a deleted user
PUT /users/:ID/restore
This request does not have a body, and in case of success, a HTTP 200 OK
without body will be sent.
Set initial tag relations
PUT /users/:id/tag-relations
An Admin can use this endpoint to create relations between the specified tags and the specified user. This is especially useful to create an initial know-how map for new users, so Starmind can already show them relevant content upon their first login. These relations are not guaranteed to be preserved forever, as the Starmind algorithm automatically strengthens and weakens different connections based on the user's actions.
The user-tag relations can be created with three different initial weights: low, medium and high. If the given tag does not exist, it will be created. Existing user-tag relations will be updated. If the same tag is specified for different weights (high, medium, low), then only the highest weight will be taken into account. Specifying the same tag with different capitalizations in a single request will cause a validation error.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
high_weight_tags |
array of tag labels |
- | ✗ | between 2 and 255 characters. |
medium_weight_tags |
array of tag labels |
- | ✗ | between 2 and 255 characters. |
low_weight_tags |
array of tag labels |
- | ✗ | between 2 and 255 characters. |
Json Payload
{
"high_weight_tags": ["Detective", "Crimes"],
"medium_weight_tags": ["Surveillance"],
"low_weight_tags": ["Archery"],
}
Response
The response contains all tags that have been updated.
{
"high_weight_tags": ["Detective", "Crimes"],
"medium_weight_tags": ["Surveillance"],
"low_weight_tags": ["Archery"],
}
Set initial tag relations for myself
PUT /users/my-tag-relations
Using this endpoint, any user can manually create a relation between himself and up to five tags.
In order to stop individual users from manipulation the algorithm, it is not possible to specify different weights for these relations and the number of relations is limited to five. If more than five tags are submitted, then only the first five are taken into account and included in the response. Duplicates are ignored. However, specifying the same tag with different capitalizations in a single request will cause a validation error.
If the same user uses this endpoint multiple times, then the earlier inputs are forgotten and only the tag relations from the last request to this endpoint are taken into account.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
tags |
array of tag labels |
- | ✗ | maximum five labels |
Json Payload
{
"tags": ["Detective", "Crimes"]
}
Response
The response contains all tags that have been updated.
{
"tags": ["Detective", "Crimes"]
}
Disclaimer agreement
Using this endpoint to set the disclaimer agreement with a user who has assigned the role communication_admin
.
PUT /users/:id/disclaimer-agreement
Disclaimer agreement me
Alternatively, use this endpoint to set the disclaimer agreement for the current session user.
PUT /users/me/disclaimer-agreement
When accepting the disclaimer for the first time, the time of the request will be used as agreement-time. Any further agreements won't change the time, preserving the current (earliest) value.
Payload
This request does not have a body.
Response
In case of success, a HTTP 200 OK
status code with the following body will be returned.
{
"disclaimer_agreement": "2017-05-29T09:52:00.000Z"
}
GDPR agreement me
A user must give his consent for the data processing terms of the EU General Data Protection Regulation (GDPR). Before the law is enforced (earliest May 2018) the agreement is optional. The user is given the chance to already agree with the GDPR terms to make sure his account won't be "frozen" on the date when the law is enforced.
PUT /users/me/gdpr
When accepting the GDPR for the first time, the time of the request will be used as agreement-time. Any further agreements won't change the time, preserving the current (earliest) value.
Payload
This request does not have a body.
Response
In case of success, a HTTP 200 OK
status code with the following body will be returned.
{
"gdpr_agreement": "2018-04-30T23:59:59.000Z"
}
Anonymize user
Use this endpoint to anonymize a user (delete his personal data) according to GDPR regulations. Requires the role user_admin
for the user that performs this action.
Additionally, the user to be anonymized needs to be already marked as deleted.
PUT /users/:id/anonymize
Payload
This request does not have a body.
Response
In case of success, a HTTP 200 OK
status code with the following body will be returned.
{
"deletion_date": "2017-05-29T09:52:00.000Z"
}