Skip to content

Latest commit

 

History

History
346 lines (277 loc) · 11.3 KB

File metadata and controls

346 lines (277 loc) · 11.3 KB
title List teams
description List all teams in an organization.
author akhilkohlimicrosoft
ms.localizationpriority high
ms.subservice teams
doc_type apiPageType
ms.date 04/05/2024

List teams

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

List all teams in an organization.

[!INCLUDE national-cloud-support]

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

GET /teams

Optional query parameters

This method supports the $filter, $select, $top, $skiptoken, and $count OData query parameters to help customize the response.

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Accept application/json

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and collection of team objects in the response body.

Note

Currently, this API call returns all properties of a team object, but only populates the id, displayName, description, and visibility properties. All other properties are returned as null. To get all populated properties, use the Get team operation.

Examples

Example 1: Get a list of teams

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/teams

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#teams",
  "value": [
    {
      "id": "172b0cce-e65d-44ce-9a49-91d9f2e8493a",
      "createdDateTime": null,
      "displayName": "Contoso Team",
      "description": "This is a Contoso team, used to showcase the range of properties supported by this API",
      "internalId": null,
      "classification": null,
      "specialization": null,
      "visibility": "public",
      "webUrl": null,
      "isArchived": null,
      "isMembershipLimitedToOwners": null,
      "memberSettings": null,
      "guestSettings": null,
      "messagingSettings": null,
      "funSettings": null,
      "discoverySettings": null,
      "tagSettings": null,
      "summary": null
    },
    {
      "id": "890972b0cce-e65d-44ce-9a49-568hhsd7n",
      "createdDateTime": null,
      "displayName": "Contoso General Team",
      "description": "This is a general Contoso team",
      "internalId": null,
      "classification": null,
      "specialization": null,
      "visibility": "private",
      "webUrl": null,
      "isArchived": null,
      "isMembershipLimitedToOwners": null,
      "memberSettings": null,
      "guestSettings": null,
      "messagingSettings": null,
      "funSettings": null,
      "discoverySettings": null,
      "tagSettings": null,
      "summary": null
    }
  ]
}

Example 2: Use $filter and $top to get two teams with a display name that starts with 'A'

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/teams?$filter=startswith(displayName, 'A')&$top=2

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#teams",
  "value": [
    {
      "id": "172b0cce-e65d-44ce-9a49-91d9f2e8493a",
      "createdDateTime": null,
      "displayName": "A Contoso Team",
      "description": "This is a Contoso team, used to showcase the range of properties supported by this API",
      "internalId": null,
      "classification": null,
      "specialization": null,
      "visibility": "public",
      "webUrl": null,
      "isArchived": null,
      "isMembershipLimitedToOwners": null,
      "memberSettings": null,
      "guestSettings": null,
      "messagingSettings": null,
      "funSettings": null,
      "discoverySettings": null,
      "tagSettings": null,
      "summary": null
    },
    {
      "id": "890972b0cce-e65d-44ce-9a49-568hhsd7n",
      "createdDateTime": null,
      "displayName": "A Contoso Notification Team",
      "description": "This is a notification Contoso team",
      "internalId": null,
      "classification": null,
      "specialization": null,
      "visibility": "private",
      "webUrl": null,
      "isArchived": null,
      "isMembershipLimitedToOwners": null,
      "memberSettings": null,
      "guestSettings": null,
      "messagingSettings": null,
      "funSettings": null,
      "discoverySettings": null,
      "tagSettings": null,
      "summary": null
    }
  ]
}

Example 3: Use $filter and $select to get id and description for team with displayName equals "A Contoso Team"

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/teams?$filter=displayName eq 'A Contoso Team'&$select=id,description

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#teams(id,description)",
  "value": [
    {
      "id": "172b0cce-e65d-44ce-9a49-91d9f2e8493a",
      "description": "This is a Contoso team, used to showcase the range of properties supported by this API"
    }
  ]
}

Related content