Fuselage
Create custom user status
Creates custom user status
URL
Requires Auth
HTTP Method
api/v1/custom-user-status.create
YES
POST

Headers

Argument
Example
Required
Description
X-User-Id
myuser-name
Required
Your username hash (returned after you log in through the API)
X-Auth-Token
myauth-token
Required
Your token (returned after you log in through the API)

Example Call

1
curl --location --request POST 'http://localhost:3000/api/v1/custom-user-status.create\
2
--header 'X-Auth-Token: myauth-token' \
3
--header 'X-User-Id: myuser-name'
4
-d "name=In a meeting$statusType:"
Copied!

Result

Success

1
{
2
"customUserStatus": {
3
"_id": "EscbQinc8jmeXbpt7",
4
"name": "In a meeting",
5
"statusType": "Busy",
6
"_updatedAt": "2021-09-26T14:03:43.057Z"
7
},
8
"success": true
9
}
Copied!

Errors

Any of the following errors can occur upon the endpoint.
  • Authorization: Requires an authentication token for the request to be made.
  • Name pram empty: Requires a custom user status Name.
  • The Status name already in use: Requires a unique custom user status Name.
  • Invalid status type: Requires a valid StatusType e.g. Online Busy Away Offline
Authorization
Name pram
Status name already in use
Invalid status type
1
{
2
"success": false,
3
"error": "unauthorized"
4
}
Copied!
1
{
2
"success": false,
3
"error": "The field Name is required [error-the-field-is-required]",
4
"errorType": "error-the-field-is-required",
5
"details": {
6
"method": "insertOrUpdateUserStatus",
7
"field": "Name"
8
}
9
}
Copied!
1
{
2
"success": false,
3
"error": "The custom user status name is already in use [Custom_User_Status_Error_Name_Already_In_Use]",
4
"errorType": "Custom_User_Status_Error_Name_Already_In_Use",
5
"details": {
6
"method": "insertOrUpdateUserStatus"
7
}
8
}
Copied!
1
{
2
"success": false,
3
"error": "Offline is not a valid status type [error-input-is-not-a-valid-field]",
4
"errorType": "error-input-is-not-a-valid-field",
5
"details": {
6
"method": "insertOrUpdateUserStatus",
7
"input": "Offline",
8
"field": "StatusType"
9
}
10
}
Copied!
Export as PDF
Copy link
Edit on GitHub