> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure DevOps

> Azure DevOps Services REST API for an organization's repos, pull requests, work items (Boards), and pipelines (CI/CD).

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](https://learn.microsoft.com/en-us/rest/api/azure/devops/) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>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/\&#123;organization\&#125;/\&#123;project\&#125;/\_apis/\&#123;area\&#125;/\&#123;resource\&#125;?api-version=7.1](https://dev.azure.com/\&#123;organization\&#125;/\&#123;project\&#125;/_apis/\&#123;area\&#125;/\&#123;resource\&#125;?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/\&#123;organization\&#125;/\_apis/projects?api-version=7.1](https://dev.azure.com/\&#123;organization\&#125;/_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/](https://learn.microsoft.com/en-us/rest/api/azure/devops/) for the full reference. The endpoints below are curated examples.</Info>

## 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://dev.azure.com/{organization}/_apis/projects?api-version=7.1', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F_apis%2Fprojects%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List the Git repositories in a project.

**GET** `https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/git/repositories?api-version=7.1', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fgit%2Frepositories%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    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' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fgit%2Frepositories%2F%7BrepositoryId%7D%2Fpullrequests%3FsearchCriteria.status%3Dactive%26api-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Read a single work item by ID. Add &\$expand=all for fields, relations, and links.

**GET** `https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fwit%2Fworkitems%2F%7Bid%7D%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List the pipelines defined in a project.

**GET** `https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=7.1` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=7.1', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fpipelines%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/build/builds?statusFilter=completed&api-version=7.1', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fbuild%2Fbuilds%3FstatusFilter%3Dcompleted%26api-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    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"
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fwit%2Fwiql%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"query":"SELECT [System.Id], [System.Title], [System.State] FROM WorkItems WHERE [System.WorkItemType] = '\''Bug'\'' AND [System.State] <> '\''Closed'\'' ORDER BY [System.ChangedDate] DESC"}'
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    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."
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fgit%2Frepositories%2F%7BrepositoryId%7D%2Fpullrequests%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"sourceRefName":"refs/heads/feature/login","targetRefName":"refs/heads/main","title":"Add login flow","description":"Implements the login flow and tests."}'
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    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"
        }
      }
    }
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fpipelines%2F%7BpipelineId%7D%2Fruns%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"resources":{"repositories":{"self":{"refName":"refs/heads/main"}}}}'
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    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
    }
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PATCH "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fgit%2Frepositories%2F%7BrepositoryId%7D%2Fpullrequests%2F%7BpullRequestId%7D%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"status":"completed","completionOptions":{"deleteSourceBranch":true}}'
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    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."} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fwiki%2Fwikis%2F%7BwikiIdentifier%7D%2Fpages%3Fpath%3D%2FRelease%2520Notes%26api-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"content":"# Release Notes\n\nShipped the login flow."}'
    ```
  </Tab>
</Tabs>

### 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

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1', { method: 'DELETE', body: {} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fdev.azure.com%2F%7Borganization%7D%2F%7Bproject%7D%2F_apis%2Fwit%2Fworkitems%2F%7Bid%7D%3Fapi-version%3D7.1" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{}'
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
