Edit group
Request description
Endpoint: /users/groups/:id/update
Method: PATCH
The following parameter must be passed through the URL:
id
: specifies the unique group identifier
Header
{
"Content-Type": "application/json",
"Authorization": "Bearer <accessToken>"
}
Note: the <accessToken>
is obtained as a result of the authentication
Payload
{
"name": "mock-group"
}
Payload structure
type EditUserPayloadType = {
name: string // group name
}
Responses
Correct response
Successful request
Describe the characteristics of a satisfactory response
200
Response structure:
{
// empty response
}
Wrong responses
Unauthorized request
Describe the characteristics of an unauthorized request
401
Response body
{
// empty body
}
Description: this error occurs when endpoint authorizers fail to validate the token sent in the request header.
Not found
Describe the characteristics of a not found request
404
Response body
{
// empty body
}
Description: this error occurs when a group not found.
Bad request
Describe the characteristics of a bad request
400
Response body
type EditUserResponseType = {
errorType: UPDATE_GROUP_ERROR_TYPE,
errorMessage?: string
}
enum Edit_USER_ERROR_TYPE {
GROUP_NAME_ALREADY_EXISTS= 'groupNameAlreadyExists',
REQUIRED_GROUP_NAME = 'requiredGroupName',
INVALID_GROUP_ID = 'invalidGroupId'
}