Create custom user status

Creates custom user status

URLRequires AuthHTTP Method

api/v1/custom-user-status.create

YES

POST

Headers

ArgumentExampleRequiredDescription

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)

ayload

ArgumentExampleRequiredDescription

name

vacay1

Required

The name of the custom status.

statusType

online

Required

The statusType of the custom status. Valid status type includes: Online, Busy, Away, Offline.

Example Call

curl --location 'http://localhost:3000/api/v1/custom-user-status.create' \
--header 'x-auth-token: Tkezshpjs9bi_kO09J4PcQM72UESdz9Dit6tT1uEzYMLnqzI' \
--header 'x-user-id: KDgshs2PcfJn8suegn69Mo' \
--header 'Content-Type: application/json' \
--data '{
    "name":"vacay1",
    "statusType":"online"
}'

Result

Success

{
    "customUserStatus": {
        "_id": "EscbQinc8jmeXbpt7",
        "name": "In a meeting",
        "statusType": "Busy",
        "_updatedAt": "2021-09-26T14:03:43.057Z"
    },
    "success": true
}

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

{
    "success": false,
    "error": "unauthorized"
}

Last updated

Rocket.Chat versions receive support for six months after release.