Changes a room’s access level between public and private. Only the room creator can change room access.
Authentication
Required. Include the authentication token in the Authorization header. Only the room creator can perform this action.
Path Parameters
Unique identifier of the room to update.
Request Body
The new access level for the room. Set to true to make the room private, or false to make it public.
Response
Returns 200 on successful access change.
Errors
400 - No is_private value provided
403 - User is not the room creator (guest users cannot change access)
500 - Internal server error
Example Request
curl -X PUT https://api.planttogether.com/room/550e8400-e29b-41d4-a716-446655440000/access \
-H "Authorization: YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_private": true
}'
Implementation Details
- Only the room creator can change a room’s access level
- Guest users cannot change room access
- Changing from public to private restricts access to only users with explicit permissions
- Changing from private to public makes the room accessible to anyone
Source: express/src/index.ts:135-152