Teams
Discussion
Starting with the release of Stack Overflow For Teams, the Stack Exchange API exposes read-only access to data stored in private Teams. In order to access Teams, you must do the following:
-
Obtain an
access_tokenwith theaccess_team|team-namescope (see Authentication for more details)team-nameis the root url of the Team, and must be obtained from the user- For example, a Team for pickled cucumber enthusiasts might have a
team-nameofstackoverflow.com/c/pickles
-
Send this
access_tokenin theX-API-Access-Tokenheader on all requests to the API- For security reasons passing
access_tokenas a query parameter is not supported when accessing Team data - Any
access_tokenpassed as a query parameter while trying to access team data will be invalidated
- For security reasons passing
-
Add the
?team=team-namequery parameter to all requests to the API?site=site-nameis still required for all methods that are site-specific, even when accessing Team data
In addition to all write methods, the following methods (and their /me equivalents) are not supported when specifying a Team with ?team=:
- /events
- /users/{id}/network-activity
- /users/{id}/notifications
- /users/{id}/notifications/unread
- /users/{id}/inbox
- /users/{id}/inbox/unread
- /inbox
- /inbox/unread
- /notifications
- /notifications/unread
- /sites
- /users/{ids}/associated
- /users/{ids}/merges
An access_token obtained with an access_team|team-name scope cannot be used to access public Stack Overflow data. An access_token
for public Stack Overflow can be obtained by using the /access-tokens/exchange method with exchange_type=team_for_public. The obtained access_token
will have the same scopes and expiration as the original access_token except for the access_team scope.