{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-devops/json-schema/microsoft-azure-devops-build-definition-schema.json",
  "title": "BuildDefinition",
  "description": "A build pipeline definition in Azure DevOps",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-devops-build-definitions-api-openapi.yml#/components/schemas/BuildDefinition",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique numeric identifier of the definition"
    },
    "name": {
      "type": "string",
      "description": "Display name of the build definition"
    },
    "path": {
      "type": "string",
      "description": "Folder path for organizing definitions"
    },
    "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": "#/$defs/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": "#/$defs/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": "#/$defs/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"
        }
      }
    }
  },
  "$defs": {
    "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"
        },
        "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
        }
      }
    },
    "IdentityRef": {
      "type": "object",
      "description": "Reference to an Azure DevOps user identity",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "displayName": {
          "type": "string"
        },
        "uniqueName": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "imageUrl": {
          "type": "string",
          "format": "uri"
        },
        "descriptor": {
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    }
  }
}