Skip to main content
Azure DevOps Services REST API for an organization’s repos, pull requests, work items (Boards), and pipelines (CI/CD). Use when an agent needs to list projects and repositories, open or update pull requests, query and read work items via WIQL, or trigger and inspect pipeline runs and builds. Microsoft’s enterprise dev platform — the counterpart to GitHub for teams standardized on Azure DevOps; calls run under the connected user’s own ADO permissions. 12 example endpoints available through Lava’s AI Gateway. See the Azure DevOps API docs for full documentation.
This provider requires your own credentials — connect your API key or OAuth account before use.
This is a catch-all provider — any valid URL under https://dev.azure.com is supported. Azure DevOps Services REST API. Construct URLs as https://dev.azure.com/{organization}/{project}/_apis/{area}/{resource}?api-version=7.1 — the api-version query param is REQUIRED on every call (omitting it returns a 400/203). Org-level resources drop the {project} segment (e.g. https://dev.azure.com/{organization}/_apis/projects?api-version=7.1). Some resources live on subdomains: identities/profiles on vssps.dev.azure.com, Analytics OData on analytics.dev.azure.com, package feeds on feeds.dev.azure.com. Common areas: git/repositories, git/pullrequests, wit/workitems, wit/wiql, build/builds, pipelines, wiki/wikis. Non-GET calls require a JSON body — for DELETE send an empty object as body_json. NOTE: creating or updating work items uses the JSON Patch media type (application/json-patch+json), which this provider cannot send (it forces application/json); read, query (WIQL), and delete work items are supported, and pull requests / pipelines / wiki use plain JSON. See https://learn.microsoft.com/en-us/rest/api/azure/devops/ for the full reference. The endpoints below are curated examples.

Endpoints

List the projects in an organization. A cheap first call after connect to discover project names for later paths.

GET https://dev.azure.com/{organization}/_apis/projects?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/_apis/projects?api-version=7.1', { method: 'GET' });

List the Git repositories in a project.

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1', { method: 'GET' });

List pull requests in a repository. Filter with searchCriteria.status (active, completed, abandoned) and searchCriteria.targetRefName.

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?searchCriteria.status=active&api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?searchCriteria.status=active&api-version=7.1', { method: 'GET' });
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1', { method: 'GET' });

List the pipelines defined in a project.

GET https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=7.1', { method: 'GET' });

List builds in a project. Filter with definitions, statusFilter (inProgress, completed), and resultFilter (succeeded, failed).

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds?statusFilter=completed&api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/build/builds?statusFilter=completed&api-version=7.1', { method: 'GET' });

Run a WIQL query to find work items. Returns matching work item IDs (and references) — read full fields with the get-work-item endpoint. The workhorse for “find/list” questions over Boards.

POST https://dev.azure.com/{organization}/{project}/_apis/wit/wiql?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/wit/wiql?api-version=7.1', {
  body: {
"query": "SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = 'Bug' AND [System.State] <> 'Closed' ORDER BY [System.ChangedDate] DESC"
},
});

Open a pull request. sourceRefName and targetRefName are full ref names (refs/heads/{branch}).

POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?api-version=7.1', {
  body: {
"sourceRefName": "refs/heads/feature/login",
"targetRefName": "refs/heads/main",
"title": "Add login flow",
"description": "Implements the login flow and tests."
},
});

Queue a run of a pipeline. Optionally target a branch via resources.repositories.self.refName.

POST https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=7.1', {
  body: {
"resources": {
  "repositories": {
    "self": {
      "refName": "refs/heads/main"
    }
  }
}
},
});

Update a pull request — e.g. complete it, abandon it (status), or change its title/description.

PATCH https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests/{pullRequestId}?api-version=7.1', {
  method: 'PATCH',
  body: {
"status": "completed",
"completionOptions": {
  "deleteSourceBranch": true
}
},
});

Create or update a wiki page at the given path. To update an existing page, send the current version as the If-Match ETag.

PUT https://dev.azure.com/{organization}/{project}/_apis/wiki/wikis/{wikiIdentifier}/pages?path=/Release%20Notes&api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/wiki/wikis/{wikiIdentifier}/pages?path=/Release%20Notes&api-version=7.1', { method: 'PUT', body: {"content":"# Release Notes\n\nShipped the login flow."} });

Delete a work item (moves it to the project Recycle Bin). The gateway requires a JSON body on every non-GET call, so send an empty object as body_json.

DELETE https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1 — Free
const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1', { method: 'DELETE', body: {} });

Next Steps

All Providers

Browse all supported AI providers

Forward Proxy

Learn how to construct proxy URLs and authenticate requests