> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Add Rooms to a Team > Add existing rooms to a team. Permission required: `move-room-to-team` Rooms moved into the team lose their ABAC attributes. Each removal is recorded in the ABAC audit log as an `abac.object.attributes.removed` event for the room, with `reason` `api` and `change` `all-deleted`. If a room has attributes, you also need the `abac-management` and `manage-abac-admin-rooms` permissions or `edit-room-abac-attributes` in that room. Otherwise the request fails with `error-abac-not-authorized-to-modify-room` before anything changes. If you are not a member of a private room in `rooms`, the request fails with `invalid-room` and no room is moved, even with administrator permissions. ### Changelog | Version | Description | | ------- | ----------- | | 9.0.0 | Moving a room into a team removes its ABAC attributes. | ## OpenAPI ````json POST /api/v1/teams.addRooms { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Rooms" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Channels" }, { "name": "Directory" }, { "name": "Groups" }, { "name": "Rooms" }, { "name": "Teams" }, { "name": "Room Invites" }, { "name": "Subscriptions" }, { "name": "ABAC" } ], "paths": { "/api/v1/teams.addRooms": { "post": { "tags": [ "Teams" ], "summary": "Add Rooms to a Team", "description": "Add existing rooms to a team.\n\nPermission required: `move-room-to-team`\n\nRooms moved into the team lose their ABAC attributes. Each removal is recorded in the ABAC audit log as an `abac.object.attributes.removed` event for the room, with `reason` `api` and `change` `all-deleted`. If a room has attributes, you also need the `abac-management` and `manage-abac-admin-rooms` permissions or `edit-room-abac-attributes` in that room. Otherwise the request fails with `error-abac-not-authorized-to-modify-room` before anything changes.\nIf you are not a member of a private room in `rooms`, the request fails with `invalid-room` and no room is moved, even with administrator permissions.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 9.0.0 | Moving a room into a team removes its ABAC attributes. |", "operationId": "post-api-v1-teams.addRooms", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "teamId": { "type": "string", "description": "Enter the team ID to which you want to add the rooms. Alternatively, enter the `teamName` parameter and provide the team's name as the value." }, "rooms": { "type": "array", "description": "The IDs of the rooms to be added to the team.", "items": { "type": "string" } } }, "required": [ "teamId", "rooms" ] }, "examples": { "Example": { "value": { "teamId": "607e0d9b49d493189836bfac", "rooms": [ "8Z7eRsibvD5AANfmK" ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "rooms": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "fname": { "type": "string" }, "customFields": { "type": "object" }, "description": { "type": "string" }, "broadcast": { "type": "boolean" }, "encrypted": { "type": "boolean" }, "federated": { "type": "boolean" }, "name": { "type": "string" }, "t": { "type": "string" }, "msgs": { "type": "integer" }, "usersCount": { "type": "integer" }, "u": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" } } }, "ts": { "type": "string" }, "ro": { "type": "boolean" }, "default": { "type": "boolean" }, "sysMes": { "type": "boolean" }, "_updatedAt": { "type": "string" }, "lm": { "type": "string" }, "lastMessage": { "type": "object", "properties": { "_id": { "type": "string" }, "t": { "type": "string" }, "msg": { "type": "string" }, "groupable": { "type": "boolean" }, "blocks": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "blockId": { "type": "string" }, "callId": { "type": "string" }, "appId": { "type": "string" } } } }, "ts": { "type": "string" }, "u": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "name": { "type": "string" } } }, "rid": { "type": "string" }, "_updatedAt": { "type": "string" }, "urls": { "type": "array", "items": { "type": "object" } }, "mentions": { "type": "array", "items": { "type": "object" } }, "channels": { "type": "array", "items": { "type": "object" } } } }, "teamId": { "type": "string" } } } }, "success": { "type": "boolean" } } }, "examples": { "Success": { "value": { "rooms": [ { "_id": "JKa7R9zu2DinBhBN9", "fname": "Livestream", "customFields": {}, "description": "", "broadcast": false, "encrypted": false, "federated": false, "name": "Livestream", "t": "c", "msgs": 15, "usersCount": 3, "u": { "_id": "rbAXPnMktTFbNpwtJ", "username": "roxie" }, "ts": "2023-02-22T17:15:26.989Z", "ro": false, "default": false, "sysMes": true, "_updatedAt": "2023-09-26T01:05:39.641Z", "lm": "2023-09-14T12:06:00.594Z", "lastMessage": { "_id": "rtf5JoPLQup3X7Aof", "t": "videoconf", "msg": "", "groupable": false, "blocks": [ { "type": "video_conf", "blockId": "6502f728a2f73c7460df6f71", "callId": "6502f728a2f73c7460df6f71", "appId": "videoconf-core" } ], "ts": "2023-09-14T12:06:00.594Z", "u": { "_id": "rbAXPnMktTFbNpwtJ", "username": "test.test", "name": "test test" }, "rid": "JKa7R9zu2DinBhBN9", "_updatedAt": "2023-09-14T12:06:00.685Z", "urls": [], "mentions": [], "channels": [] }, "teamId": "63f3efc4b000b6b6d86704b2" } ], "success": true } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Room not accessible": { "value": { "success": false, "error": "invalid-room" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" } }, "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "success": false, "error": "You must be logged in to do this." } } } } } } } } } ````