Team rooms

Last Update: 12/5/2016

api-version = 1.0

If you haven't already, look at the information on getting started with these APIs.

Get a list of rooms

GET https://{instance}/DefaultCollection/_apis/chat/rooms?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
Query
api-version string Version of the API to use.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms?api-version=1.0

Sample response

Status code: 200
{
  "count": 4,
  "value": [
    {
      "id": 305,
      "name": "Fabrikam-Fiber-Git Team Room",
      "description": "",
      "lastActivity": "2014-10-07T22:17:31.723Z",
      "createdBy": {
        "id": "47d25e84-de54-49ce-8f3d-351c77422775",
        "displayName": "[DefaultCollection]\\Project Collection Service Accounts",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/47d25e84-de54-49ce-8f3d-351c77422775",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=47d25e84-de54-49ce-8f3d-351c77422775"
      },
      "createdDate": "2014-01-24T19:19:00.21Z",
      "hasAdminPermissions": true,
      "hasReadWritePermissions": false
    },
    {
      "id": 306,
      "name": "Fabrikam-Fiber-TFVC Team Room",
      "description": "",
      "lastActivity": "2014-01-24T19:20:37.41Z",
      "createdBy": {
        "id": "47d25e84-de54-49ce-8f3d-351c77422775",
        "displayName": "[DefaultCollection]\\Project Collection Service Accounts",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/47d25e84-de54-49ce-8f3d-351c77422775",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=47d25e84-de54-49ce-8f3d-351c77422775"
      },
      "createdDate": "2014-01-24T19:20:37.41Z",
      "hasAdminPermissions": true,
      "hasReadWritePermissions": false
    },
    {
      "id": 307,
      "name": "Quality assurance Room",
      "description": "",
      "lastActivity": "2014-01-27T23:03:55.663Z",
      "createdBy": {
        "id": "47d25e84-de54-49ce-8f3d-351c77422775",
        "displayName": "[DefaultCollection]\\Project Collection Service Accounts",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/47d25e84-de54-49ce-8f3d-351c77422775",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=47d25e84-de54-49ce-8f3d-351c77422775"
      },
      "createdDate": "2014-01-27T23:03:55.663Z",
      "hasAdminPermissions": true,
      "hasReadWritePermissions": false
    },
    {
      "id": 2686,
      "name": "TestGit Team Room",
      "description": "",
      "lastActivity": "2014-05-15T14:00:36.443Z",
      "createdBy": {
        "id": "47d25e84-de54-49ce-8f3d-351c77422775",
        "displayName": "[DefaultCollection]\\Project Collection Service Accounts",
        "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/47d25e84-de54-49ce-8f3d-351c77422775",
        "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=47d25e84-de54-49ce-8f3d-351c77422775"
      },
      "createdDate": "2014-05-15T14:00:36.443Z",
      "hasAdminPermissions": true,
      "hasReadWritePermissions": false
    }
  ]
}

Get a room

GET https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the room to update.
Query
api-version string Version of the API to use.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/12797?api-version=1.0

Sample response

Status code: 200
{
  "id": 12797,
  "name": "renamedRoom",
  "description": "updated room description",
  "lastActivity": "2014-10-27T16:32:36.553Z",
  "createdBy": {
    "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
    "displayName": "Normal Paulk",
    "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
    "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
  },
  "createdDate": "2014-10-27T16:32:36.553Z",
  "hasAdminPermissions": true,
  "hasReadWritePermissions": true
}

Create a room

POST https://{instance}/DefaultCollection/_apis/chat/rooms?api-version={version}
Content-Type: application/json
{
  name: {name},
  description: {description}
}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
Query
api-version string Version of the API to use.
Body
Name string Name of the new room.
Description string Description of the new room.

Sample request

POST https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms?api-version=1.0
Content-Type: application/json
{
  "name": "newCreatedRoom",
  "description": "used for API doc generation"
}

Sample response

Status code: 201
{
  "id": 12797,
  "name": "newCreatedRoom",
  "description": "used for API doc generation",
  "lastActivity": "2014-10-27T16:32:36.553Z",
  "createdBy": {
    "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
    "displayName": "Normal Paulk",
    "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
    "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
  },
  "createdDate": "2014-10-27T16:32:36.553Z",
  "hasAdminPermissions": true,
  "hasReadWritePermissions": true
}

Update room

PATCH https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}?api-version={version}
Content-Type: application/json
{
  [name: {name},]
  [description: {description}]
}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the room to update.
Query
api-version string Version of the API to use.
Body
Name string New name of the room.
Description string Updated description of the room.

Sample request

PATCH https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/12797?api-version=1.0
Content-Type: application/json
{
  "name": "renamedRoom",
  "description": "updated room description"
}

Sample response

Status code: 200
{
  "id": 12797,
  "name": "renamedRoom",
  "description": "updated room description",
  "lastActivity": "2014-10-27T16:32:36.553Z",
  "createdBy": {
    "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
    "displayName": "Normal Paulk",
    "url": "https://fabrikam-fiber-inc.vssps.visualstudio.com/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
    "imageUrl": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
  },
  "createdDate": "2014-10-27T16:32:36.553Z",
  "hasAdminPermissions": true,
  "hasReadWritePermissions": true
}

Delete room

DELETE https://{instance}/DefaultCollection/_apis/chat/rooms/{roomId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
roomId int ID of the room to update.
Query
api-version string Version of the API to use.

Sample request

DELETE https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/chat/rooms/12797?api-version=1.0

Sample response

Status code: 200