Post
/api/v1/custom-user-status.create
Create a custom user status. Permission required: manage-user-status
Changelog
Version | Description |
---|---|
2.4.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example
{
"name": "caught up",
"statusType": "busy"
}
object
name
string Required
The name of the custom status.
statusType
string Required
The statusType
of the custom status. Valid status type includes: Online
, Busy
, Away
, Offline
.
Responses
200
OK
Success Example
{
"customUserStatus": {
"_id": "65462e97a2f73c7460e18f84",
"name": "caught up",
"statusType": "busy",
"_updatedAt": "2023-11-04T11:44:23.366Z"
},
"success": true
}
object
customUserStatus
object
_id
string
name
string
statusType
string
_updatedAt
string
success
boolean
400
Bad Request
Missing Name Param
{
"success": false,
"error": "The field Name is required [error-the-field-is-required]",
"errorType": "error-the-field-is-required",
"details": {
"method": "insertOrUpdateUserStatus",
"field": "Name"
}
}
Status name already in use
{
"success": false,
"error": "The custom user status name is already in use [Custom_User_Status_Error_Name_Already_In_Use]",
"errorType": "Custom_User_Status_Error_Name_Already_In_Use",
"details": {
"method": "insertOrUpdateUserStatus"
}
}
Invalid Status Type
{
"success": false,
"error": "Offline is not a valid status type [error-input-is-not-a-valid-field]",
"errorType": "error-input-is-not-a-valid-field",
"details": {
"method": "insertOrUpdateUserStatus",
"input": "Offline",
"field": "StatusType"
}
}
object
success
boolean
error
string
errorType
string
details
object
method
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string