REST API Overview for Visual Studio Team Services and Team Foundation Server

Last Update: 8/23/2017

The Visual Studio Team Services and Team Foundation Server APIs are based on REST, OAuth, Json and service hooks - all standard web technologies broadly supported in the industry.

If you're new to REST APIs, take a look at the information on getting started with these APIs, if you haven't already seen it.

Common REST APIs and Usage

What's your goal? APIs to use:
  • Access user accounts or profiles
Accounts and Profiles
  • Automatically kick off a build
  • Get details from a completed build
  • Add a tag to a build
Build (2.0)
  • Add a widget to a dashboard
  • Get Git repositories
  • Add status to a commit
  • Get details/status for a pull request
  • Create a file (push)
  • Create a project
  • Get a list of projects
Projects and Teams
  • Get a list of work items
  • Create a work item
  • Update a work item
  • Add a link to a work item
Work Item Tracking (WIT)

Full list of REST APIs

If you didn't find what you were looking for in the table above, or if you're just doing some research, below is the full list of APIs:

API Description Common Uses
Accounts and profiles Each person using Visual Studio Team Services has a profile and access to one or more accounts. This API gives the developer access to these profiles and accounts.
  • Get the authenticated user's profile
  • Get the list of accounts the user has access to
Build (1.0) In Team Services and TFS, a build request uses a build definition to add a new build to a build queue, and completed builds are assigned a build quality. With the Build (1.0) API, you can access each of these components. --NOTE:-- Build (2.0) is the updated and preferred API for these capabilities.
  • Start a build
  • Get a build
  • Set build quality
Build (2.0) The Build (2.0) APIs provide numerous ways to utilize builds from Team Services or TFS in your extensions. Whether you're kicking a build off, retreiving a build, or just adding a tag, you'll find what you need here.
  • Start a build
  • Get a build
  • Tag a build
Cloud load test The Cloud Load Test API provides access to test infrastructure in the cloud to execute web load tests at high scale and reliability.
  • Start a test run
  • Monitor run progress
Code policy Team Services and TFS offer code policy functionality to automatically ensure steps are being taken before pull requests are completed. This API gives you access to define policies for your projects.
  • Get a list of policy configurations
Dashboards and widgets You can utilize the Dashboards and Widgets API to add a widget or access a widget on a dashboard. This is helpful if your extension or integration could benefit from having a physical representation.
  • Create a new dashboard
  • Add a widget to a dashboard
Git With the Git API, you have access to commits, pull requests, repositories, etc.
  • Get, add, or delete team repositories
  • Get recent changes
  • See who pushed commits to a team repository
Graph Manage users and groups within Visual Studio Team Services.
  • Add AAD and MSA users and groups to an account.
  • Create VSTS groups and manage their membership.
Packaging Packages are bundles of DLLs, resources, and other software components combined with metadata. Common package formats include: NuGet, npm, and Maven. Feeds contain packages and enforce permissions about who can access the packages. This API gives you accesss to feeds, packages, and permissions.
  • Get a list of feeds
  • Create a feed
Projects and teams Team Services accounts host projects, and each project has one or more teams that contibute to it. Get access to both with the Projects and Teams API.
  • Get a list of team projects
  • Get a project's source control provider
  • Get the teams in a team project
  • Create a team project
Queues An agent queue provides access to a pool of agents. When you create a build or release definition, you specify which queue it uses. Queues are scoped to your team project collection, so you can share them across build and release definitions in multiple team projects.
  • Get a list of queues
  • Get a single queue
Release (preview) Releases reference release definitions to deploy an application compromising of one or more artifacts. Access releases, release definitions, and approvals with the Release API.
  • Create a release definition
  • Start a release
  • Get release details
Security Use the Security API to set, revoke and evaluate permissions.
  • Get a list of security namespaces
  • Get, add, or delete access control lists (ACLs)
  • Update access control entries (ACEs)
  • Evaluate permissions
Service endpoints Service endpoints are a way for Team Services to connect to external systems or services. They are a bundle of properties securely stored by Team Services. With the Service Endpoints API, you can access these endpoints along with their permissions.
  • Get a list of service endpoints
  • Get a single service endpoint
  • Create a service endpoint
Service hooks Utilize service hooks to create subscriptions to events, and take actions based on those events.
  • Set up a subscription
  • Get a list of publishers
Team rooms This API gives you access to team rooms. Team rooms are effectively chat rooms where users can post messages to one another.
  • Get a list of team rooms
  • Create a room
  • Join a room
  • Post a message to a room
Test management Get access to your test cases, test suites, and test plans. Also get results from a test run.
  • Create a test plan
  • Create a test suite with test cases
  • Get results from a test run
Version control This API is straight-forward and gives you access to the items and types related to version control within Team Services and TFS.
  • Get recent changes
  • Download a file
  • Get item metadata
Work (Agile) Use the Work API to access all sort of different fields and items related to agile development.
  • Add a column to a board
  • Update board row settings
  • Update team settings
Work item tracking Work item tracking and management is a large part of a successful DevOps platform. with the Work Item Tracking (WIT) API, you have full access to the work items that your team uses every day.
  • Get work items using a query
  • Update work items' fields
  • Link two work items
  • Attach a file to a work item

Note: If you're looking for API contracts, take a look at the REST API Contracts Index