Skip to main content
PUT
/
room
/
:room_id
/
access
Change Room Access
curl --request PUT \
  --url https://api.example.com/room/:room_id/access \
  --header 'Content-Type: application/json' \
  --data '
{
  "is_private": true
}
'
{
  "status": 123
}
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

room_id
string
required
Unique identifier of the room to update.

Request Body

is_private
boolean
required
The new access level for the room. Set to true to make the room private, or false to make it public.

Response

status
number
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

Build docs developers (and LLMs) love