Azure DevOps Build Definitions API

Operations for managing build pipeline definitions

Operations 5

GET /build/definitions Azure DevOps List build definitions #
POST /build/definitions Azure DevOps Create a build definition #
GET /build/definitions/{definitionId} Azure DevOps Get a build definition #
PUT /build/definitions/{definitionId} Azure DevOps Update a build definition #
DELETE /build/definitions/{definitionId} Azure DevOps Delete a build definition #

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-devops-build-definitions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-devops-build-definitions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure DevOps Builds Build Definitions API
  description: 'REST API for managing build definitions (pipelines), queuing builds, monitoring build status, accessing build logs, timelines, and artifacts. Supports the full lifecycle of continuous integration builds in Azure DevOps.

    '
  version: '7.1'
  contact:
    name: Microsoft Azure DevOps
    url: https://learn.microsoft.com/en-us/rest/api/azure/devops/build/
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://dev.azure.com/{organization}/{project}/_apis
  description: Azure DevOps Build API
  variables:
    organization:
      description: Azure DevOps organization name or ID
      default: myorganization
    project:
      description: Azure DevOps project name or ID
      default: myproject
security:
- bearerAuth: []
- basicAuth: []
tags:
- name: Build Definitions
  description: Operations for managing build pipeline definitions
paths:
  /build/definitions:
    get:
      operationId: definitions_list
      summary: Azure DevOps List build definitions
      description: 'Returns a list of build definitions (pipelines) in the project. Supports filtering by name and path, and returns summary information for each definition.

        '
      tags:
      - Build Definitions
      parameters:
      - $ref: '#/components/parameters/ApiVersion'
      - name: name
        in: query
        required: false
        description: Filter definitions by name (supports wildcards with *)
        schema:
          type: string
      - name: path
        in: query
        required: false
        description: Filter definitions by folder path
        schema:
          type: string
      - name: builtAfter
        in: query
        required: false
        description: Return definitions that were built after this date
        schema:
          type: string
          format: date-time
      - name: $top
        in: query
        required: false
        description: Maximum number of definitions to return
        schema:
          type: integer
      - name: continuationToken
        in: query
        required: false
        description: Continuation token for paginated results
        schema:
          type: string
      responses:
        '200':
          description: List of build definitions returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                  value:
                    type: array
                    items:
                      $ref: '#/components/schemas/BuildDefinition'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
    post:
      operationId: definitions_create
      summary: Azure DevOps Create a build definition
      description: 'Creates a new build definition (pipeline) in the project. The definition specifies the build steps, triggers, variables, and agent requirements.

        '
      tags:
      - Build Definitions
      parameters:
      - $ref: '#/components/parameters/ApiVersion'
      - name: definitionToCloneId
        in: query
        required: false
        description: ID of an existing definition to clone
        schema:
          type: integer
      - name: definitionToCloneRevision
        in: query
        required: false
        description: Revision number of the definition to clone
        schema:
          type: integer
      requestBody:
        required: true
        description: Build definition to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildDefinitionCreateRequest'
      responses:
        '200':
          description: Build definition created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildDefinition'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
  /build/definitions/{definitionId}:
    get:
      operationId: definitions_get
      summary: Azure DevOps Get a build definition
      description: 'Returns detailed information about a specific build definition, including all steps, triggers, variables, and configuration. You can also request a specific revision of the definition.

        '
      tags:
      - Build Definitions
      parameters:
      - $ref: '#/components/parameters/ApiVersion'
      - name: definitionId
        in: path
        required: true
        description: Numeric ID of the build definition
        schema:
          type: integer
      - name: revision
        in: query
        required: false
        description: Specific revision number to retrieve
        schema:
          type: integer
      - name: minMetricsTime
        in: query
        required: false
        description: Minimum date for including build metrics
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Build definition returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildDefinition'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: definitions_update
      summary: Azure DevOps Update a build definition
      description: 'Replaces an existing build definition with the provided definition. The revision number in the body must match the current revision to prevent concurrent modification conflicts.

        '
      tags:
      - Build Definitions
      parameters:
      - $ref: '#/components/parameters/ApiVersion'
      - name: definitionId
        in: path
        required: true
        description: Numeric ID of the build definition to update
        schema:
          type: integer
      - name: secretsSourceDefinitionId
        in: query
        required: false
        description: ID of the definition to clone secrets from
        schema:
          type: integer
      - name: secretsSourceDefinitionRevision
        in: query
        required: false
        description: Revision number to clone secrets from
        schema:
          type: integer
      requestBody:
        required: true
        description: Updated build definition
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildDefinition'
      responses:
        '200':
          description: Build definition updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuildDefinition'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: definitions_delete
      summary: Azure DevOps Delete a build definition
      description: 'Deletes a build definition. All associated builds must be deleted first, or you must specify deleteBuilds=true to cascade delete all associated builds.

        '
      tags:
      - Build Definitions
      parameters:
      - $ref: '#/components/parameters/ApiVersion'
      - name: definitionId
        in: path
        required: true
        description: Numeric ID of the build definition to delete
        schema:
          type: integer
      responses:
        '204':
          description: Build definition deleted successfully
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    BadRequest:
      description: Bad request - invalid parameters or request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    NotFound:
      description: Not found - the requested resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Forbidden:
      description: Forbidden - insufficient permissions to perform this operation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    Unauthorized:
      description: Unauthorized - missing or invalid authentication credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    IdentityRef:
      type: object
      description: Reference to an Azure DevOps user identity
      properties:
        id:
          type: string
          format: uuid
        displayName:
          type: string
          example: John Doe
        uniqueName:
          type: string
          example: john.doe@example.com
        url:
          type: string
          format: uri
        imageUrl:
          type: string
          format: uri
        descriptor:
          type: string
    BuildDefinition:
      type: object
      description: A build pipeline definition in Azure DevOps
      properties:
        id:
          type: integer
          description: Unique numeric identifier of the definition
          example: 5
        name:
          type: string
          description: Display name of the build definition
          example: CI-Pipeline
        path:
          type: string
          description: Folder path for organizing definitions
          example: \MyFolder
        type:
          type: string
          description: Type of build definition
          enum:
          - xaml
          - build
        revision:
          type: integer
          description: Current revision number of the definition
        quality:
          type: string
          description: Quality of the definition
          enum:
          - definition
          - draft
        authoredBy:
          $ref: '#/components/schemas/IdentityRef'
        queue:
          type: object
          description: Default agent queue for this definition
          properties:
            id:
              type: integer
            name:
              type: string
            pool:
              type: object
              properties:
                id:
                  type: integer
                name:
                  type: string
                isHosted:
                  type: boolean
        project:
          $ref: '#/components/schemas/TeamProjectReference'
        url:
          type: string
          format: uri
        uri:
          type: string
        createdDate:
          type: string
          format: date-time
        queueStatus:
          type: string
          description: Whether new builds can be queued against this definition
          enum:
          - enabled
          - paused
          - disabled
        variables:
          type: object
          description: Map of variable names to variable definitions
          additionalProperties:
            type: object
            properties:
              value:
                type: string
              allowOverride:
                type: boolean
              isSecret:
                type: boolean
        triggers:
          type: array
          description: Triggers that automatically start this build
          items:
            type: object
            properties:
              triggerType:
                type: string
                enum:
                - none
                - continuousIntegration
                - batchedContinuousIntegration
                - schedule
                - gatedCheckIn
                - buildCompletion
                - pullRequest
        repository:
          $ref: '#/components/schemas/BuildRepository'
        process:
          type: object
          description: Build process definition (YAML or designer)
          properties:
            yamlFilename:
              type: string
              description: Path to the YAML pipeline file
            type:
              type: integer
              description: 1 = designer, 2 = YAML
    ApiError:
      type: object
      description: Error response from the Azure DevOps API
      properties:
        id:
          type: string
          format: uuid
        message:
          type: string
        typeName:
          type: string
        typeKey:
          type: string
        errorCode:
          type: integer
        eventId:
          type: integer
    TeamProjectReference:
      type: object
      description: Reference to an Azure DevOps project
      properties:
        id:
          type: string
          format: uuid
          description: Project ID
        name:
          type: string
          description: Project name
        description:
          type: string
        url:
          type: string
          format: uri
        state:
          type: string
          enum:
          - deleting
          - new
          - wellFormed
          - createPending
          - all
          - unchanged
          - deleted
        visibility:
          type: string
          enum:
          - private
          - public
        revision:
          type: integer
    BuildRepository:
      type: object
      description: Repository configuration for a build
      properties:
        id:
          type: string
          description: Repository ID (GUID for Git, name for TFVC)
        name:
          type: string
          description: Repository name
        type:
          type: string
          description: Repository type
          enum:
          - TfsGit
          - TfsVersionControl
          - GitHub
          - Bitbucket
          - GitHubEnterprise
        url:
          type: string
          format: uri
          description: URL of the repository
        defaultBranch:
          type: string
          description: Default branch for this repository
          example: refs/heads/main
        checkoutSubmodules:
          type: boolean
          description: Whether to checkout Git submodules
        clean:
          type: string
          description: Whether to clean the working directory before each build
          enum:
          - 'true'
          - 'false'
          - null
        properties:
          type: object
          additionalProperties: true
    BuildDefinitionCreateRequest:
      type: object
      description: Request to create a new build definition
      required:
      - name
      - repository
      - process
      - queue
      properties:
        name:
          type: string
          description: Display name of the build definition
        path:
          type: string
          description: Folder path for the definition
          default: \
        type:
          type: string
          enum:
          - xaml
          - build
          default: build
        repository:
          $ref: '#/components/schemas/BuildRepository'
        process:
          type: object
          description: Build process configuration
          properties:
            yamlFilename:
              type: string
            type:
              type: integer
        queue:
          type: object
          properties:
            id:
              type: integer
        variables:
          type: object
          additionalProperties:
            type: object
            properties:
              value:
                type: string
              isSecret:
                type: boolean
        triggers:
          type: array
          items:
            type: object
  parameters:
    ApiVersion:
      name: api-version
      in: query
      required: true
      description: Azure DevOps REST API version. Use 7.1 for the latest stable version.
      schema:
        type: string
        default: '7.1'
        enum:
        - '7.1'
        - '7.0'
        - '6.0'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Azure AD OAuth 2.0 bearer token
    basicAuth:
      type: http
      scheme: basic
      description: Basic authentication using a Personal Access Token (PAT). Use any string as the username and the PAT as the password, then base64-encode the result.