-
Notifications
You must be signed in to change notification settings - Fork 4
PatchUser
Allows to update an existing User. Only allowed if the requestor is the same as the target User.
URLs:
/v1/users/me
/v1/users/{userId}
Method: PATCH
Path Parameters:
Parameter | Type | Description |
---|---|---|
userId | string | UUID of the User to update (notice that only requester ID is allowed). |
Query Parameters: None
Headers:
Authorization: Bearer {accessToken}
Content-Type: application/json
Content:
Field | Type | Description | Requirement Type |
---|---|---|---|
firstName | string | User first name. | Optional |
lastName | string | User last name. | Optional |
nickname | string | User nickname. | Optional |
pictureUrl | string | Valid URL of picture image file. | Optional |
bannerUrl | string | Valid URL of banner image file. | Optional |
websiteUrl | string | Valid URL of User personal website. | Optional |
twitterUrl | string | Valid URL of User Twitter account. | Optional |
instagramUrl | string | Valid URL of User Instagram account. | Optional |
location | string | User location. | Optional |
role | string | User role. | Optional |
genre | string | User genre. | Optional |
biography | string | User biography. | Optional |
companyName | string | Company name. | Oprional |
companyLogoUrl | string | Valid URL of company logo image. | Optional |
companyIpRights | boolean | Indicates if the IP rights belong to the company. | Optional |
walletAddress | string | User wallet address. | Optional |
string | Valid email address. | Optional | |
newPassword | string | Plaintext password. | Optional |
confirmPassword | string | Plaintext password confirmation. | Required ony if newPassword specified. |
currentPassword | string | Plaintext current password. | Required ony if newPassword specified. |
authCode | string | 2FA Code. | Required only if email specified. |
Content example:
{
"firstName": "John",
"lastName": "Doe",
"nickname": "Johnny"
"pictureUrl": "https://somewebsite/john-doe.png",
"role": "Producer",
"genre": "Pop",
"biography": "John is a leading Pop Music Producer",
"walletAddress": "addr123456789123456789",
"email": "[email protected]",
"newPassword": "abc1@23",
"confirmPassword": "abc@123",
"currentPassword": "wxy_743",
"authCode": "123456"
}
Code: 204 NO CONTENT
Headers: None
Code: 400 BAD REQUEST
Condition: If a mandatory content field is missing.
Headers:
Content-Type: application/json
Content example:
{
"code": 400,
"description": "Bad Request",
"cause": "Missing authCode"
}
Code: 401 UNAUTHORIZED
Condition: If {accessToken}
is invalid or expired.
Code: 403 FORBIDDEN
Condition: If 2FA failed because authCode
is invalid or if requestor is not the same as target User.
Headers:
Content-Type: application/json
Content example:
{
"code": 403,
"description": "Forbidden",
"cause": "2FA failed"
}
Code: 409 CONFLICT
Condition: If email
is already registered to another user.
Headers:
Content-Type: application/json
Content example:
{
"code": 409,
"description": "Conclict",
"cause": "Already exists: [email protected]"
}
Code: 422 UNPROCESSABLE ENTITY
Condition: If a content field is malformed or invalid.
Headers:
Content-Type: application/json
Content example:
{
"code": 422,
"description": "Unprocessable Entity",
"cause": "Invalid email: john.doe!gmail.com"
}