Stack Overflow for Teams API v2.3

This is the documentation for the Stack Overflow for Teams API v2.3.

This API is available for the following subscription tiers:

  • Basic - read only
  • Business - read/write

Requests

All requests to the API require:

  • A query string param team containing the slug of the team that will be target of the API call. For example, if your team lives in stackoverflowteams.com/c/my-team, the slug is my-team.
  • A header X-API-Access-Token with an access token. See authentication on how to get one.

Example request:

curl -X GET -H 'X-API-Access-Token: my-personal-access-token' 'https://api.stackoverflowteams.com/2.3/questions?team=my-team'

General

All API responses are JSON, we do support JSONP with the callback query parameter. Every response in the API is returned in a common "wrapper" object, for easier and more consistent parsing.

Additionally, all API responses are compressed. The Content-Encoding header is always set, but some proxies will strip this out. The proper way to decode API responses can be found here.

Developers can trim API responses down to just the fields they are interested in using custom filters. Many types have fields that are not normally returned (question bodies, for example) that can likewise be requested via a custom filter.

A number of methods in the Stack Overflow for Teams API accept dates as parameters and return dates as properties, the format of these dates is consistent and documented. All dates are in unix epoch time.

Unless otherwise noted, the maximum size of any page is 100, any {ids} parameter likewise is capped at 100 elements, all indexes start at 1.

If a parameter name is plural it accepts vectorized requests, otherwise a single value may be passed.

It is possible to compose reasonably complex queries against the sites using the min, max, fromdate, todate, and sort parameters. Most, but not all, methods accept some or all of these parameters, the documentation for individual methods will highlight which do. Most methods also have a common set of paging parameters.

Per-Site Methods

Answers

Get all answers on the site.

Get answers identified by a set of ids.

Casts an accept vote on the given answer.

Undoes an accept vote on the given answer.

Get comments on the answers identified by a set of ids.

Deletes the given answer.

Casts a downvote on the given answer.

Undoes a downvote on the given answer.

Edits the given answer.

Returns valid flag options for the given answer.

Casts a flag on the given answer.

Gets all questions the answers identified by ids are on.

Casts an upvote on the given answer.

Undoes an upvote on the given answer.

Creates a suggested edit on an existing answer.

Articles

Add/Edit/Delete Only available for Business Teams.

Get all articles on the site.

Get the articles identified by a set of ids.

Get comments on the articles identified by a set of ids.

Get the questions that are linked to the articles identified by a set of ids.

Deletes the given article.

Edits the given article.

Creates a new article.

Badges

Get all badges on the site, in alphabetical order.

Get the badges identified by ids.

Get all non-tagged-based badges in alphabetical order.

Get badges recently awarded on the site.

Get the recent recipients of the given badges.

Get all tagged-based badges in alphabetical order.

Comments

Get all comments on the site.

Get comments identified by a set of ids.

Delete a comment identified by its id.

Edit a comment identified by its id.

Casts a flag on the given comment.

Returns valid flag options for the given comment.

Casts an upvote on the given comment.

Undoes an upvote on the given comment.

Info

Get information about the entire site.

Posts

Get all posts (questions and answers) in the system.

Get all posts identified by a set of ids. Useful for when the type of post (question or answer) is not known.

Get comments on the posts (question or answer) identified by a set of ids.

Create a new comment on the post identified by id.

Renders a hypothetical comment on the given post.

Get revisions on the set of posts in ids.

Get suggested edits on the set of posts in ids.

Privileges

Get all the privileges available on the site.

Questions

Get all questions on the site.

Get the questions identified by a set of ids.

Get the answers to the questions identified by a set of ids.

Creates an answer on the given question.

Renders a hypothetical answer to a question.

Returns valid flag options which are also close reasons for the given question.

Get the comments on the questions identified by a set of ids.

Deletes the given question.

Casts a downvote on the given question.

Undoes a downvote on the given question.

Edits the given question.

Bookmarks the given question. (Previously known as "favoriting" a question)

Undoes bookmarking the given question. (Previously known as "favoriting" a question)

Casts a flag on the given question.

Returns valid flag options for the given question.

Get the questions that link to the questions identified by a set of ids.

Get the questions that are related to the questions identified by a set of ids.

Creates a suggested_edit on an existing question.

Get the timelines of the questions identified by a set of ids.

Casts an upvote on the given question.

Undoes an upvote on the given question.

Creates a new question.

Get all questions on the site with active bounties.

Get all questions on the site with no answers.

Renders a hypothetical question.

Get all questions the site considers unanswered.

Get questions the site considers unanswered within a user's favorite or interesting tags.

Revisions

Get all revisions identified by a set of ids.

Search

Search the site for questions meeting certain criteria.

Search the site for questions using most of the on-site search options.

Search the site based on similarity to a title.

Searches a site.

Suggested Edits

Get all the suggested edits on the site.

Get the suggested edits identified by a set of ids.

Tags

Get the tags on the site.

Get tags on the site by their names.

Get the tags on the site that only moderators can use.

Get the tags on the site that fulfill required tag constraints.

Get all the tag synonyms on the site.

Get frequently asked questions in a set of tags.

Get related tags, based on common tag pairings.

Get the synonyms for a specific set of tags.

Get the top answer posters in a specific tag, either in the last month or for all time.

Get the top question askers in a specific tag, either in the last month or for all time.

Get the wiki entries for a set of tags.

Users

Get all users on the site.

Get the users identified by a set of ids.

Get the answers posted by the users identified by a set of ids.

Get the badges earned by the users identified by a set of ids.

Get the comments posted by the users identified by a set of ids.

Get the comments posted by a set of users in reply to another user.

Get the questions bookmarked (previously known as "favorited") by users identified by a set of ids.

Get the comments that mention one of the users identified by a set of ids.

Get all posts (questions and answers) owned by a set of users.

Get the privileges the given user has on the site.

Get the questions asked by the users identified by a set of ids.

Get the questions on which a set of users, have active bounties.

Get the questions asked by a set of users, which have no answers.

Get the questions asked by a set of users, which have at least one answer but no accepted answer.

Get the questions asked by a set of users, which are not considered to be adequately answered.

Get a subset of the reputation changes experienced by the users identified by a set of ids.

Get a history of a user's reputation, excluding private events.

Get a full history of a user's reputation.

Get the suggested edits provided by users identified by a set of ids.

Get the tags that the users (identified by a set of ids) have been active in.

Get the top answers a user has posted on questions with a set of tags.

Get the top questions a user has posted with a set of tags.

Get a given user's tag preferences.

Get a subset of the actions of that have been taken by the users identified by a set of ids.

Get the top tags (by score) a single user has posted answers in.

Get the top tags (by score) a single user has asked questions in.

Get the top tags (by score) a single user has posted in.

Get the users who have moderation powers on the site.