RocketChat / RocketChat/Rocket.Chat

[BUG] REST API endpoint /users does not conform to best practices

Open
#23,899 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

Currently all actions on "users" with the REST API use unique endpoints.... ex. users.create, users.delete, users.get_avatar, etc.... where the userID is contained in the body. This does not conform to best practices because a GET on the endpoint /users itself should return a collection of users, and the path to perform actions on a specific user should include the "_id"....... ex. /users/{_id} with a GET, DELETE, PUT etc...

A good example of best practice is in the /livechat/departments endpoint, and it would be best if all REST API endpoints used the same design.

We are using terraform to configure users, omnichannel departments, omnichannel agents, etc.... and the users endpoint as is, is not compatible with terraforms 'destroy resource' strategy, and therefore it breaks our automation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the REST API definitions for /users and the /livechat/departments example mentioned in the issue. Compare their collection and item-route behavior, then trace the Terraform destroy workflow that currently fails. Done means users supports collection access plus /users/{_id} actions consistently with the stated REST design.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.