{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-pipelines/json-schema/microsoft-azure-pipelines-run-schema.json",
  "title": "Run",
  "description": "A pipeline run representing a single execution of a YAML pipeline with its state, result, timing, resources, and parameters.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-pipelines-runs-api-openapi.yml#/components/schemas/Run",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique numeric identifier of the run"
    },
    "name": {
      "type": "string",
      "description": "Auto-generated run name using the build number format"
    },
    "state": {
      "type": "string",
      "description": "Current execution state of the run",
      "enum": [
        "unknown",
        "inProgress",
        "canceling",
        "completed"
      ]
    },
    "result": {
      "type": [
        "string",
        "null"
      ],
      "description": "Final result of the run (set when state is completed)",
      "enum": [
        "unknown",
        "succeeded",
        "failed",
        "canceled"
      ]
    },
    "createdDate": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 UTC timestamp when the run was created"
    },
    "finishedDate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "ISO 8601 UTC timestamp when the run finished"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "REST API URL for this run"
    },
    "pipeline": {
      "type": "object",
      "description": "Reference to the pipeline definition this run belongs to",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Pipeline definition ID"
        },
        "name": {
          "type": "string",
          "description": "Pipeline definition name"
        },
        "folder": {
          "type": "string",
          "description": "Pipeline folder path"
        },
        "revision": {
          "type": "integer",
          "description": "Pipeline definition revision"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "REST API URL for the pipeline definition"
        }
      }
    },
    "resources": {
      "type": "object",
      "description": "Resources consumed by this run",
      "properties": {
        "repositories": {
          "type": "object",
          "description": "Repository resources keyed by alias",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "refName": {
                "type": "string",
                "description": "Git ref checked out"
              },
              "version": {
                "type": "string",
                "description": "Commit SHA checked out"
              }
            }
          }
        },
        "pipelines": {
          "type": "object",
          "description": "Pipeline resources keyed by alias",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "description": "Upstream pipeline build number"
              }
            }
          }
        }
      }
    },
    "variables": {
      "type": "object",
      "description": "Variables used in this run",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "Variable value (null for secrets)"
          },
          "isSecret": {
            "type": "boolean",
            "description": "Whether the variable is secret"
          }
        }
      }
    },
    "templateParameters": {
      "type": "object",
      "description": "Template parameters used in this run",
      "additionalProperties": {
        "type": "string"
      }
    },
    "_links": {
      "$ref": "#/$defs/ReferenceLinks"
    }
  },
  "$defs": {
    "ReferenceLinks": {
      "type": "object",
      "description": "HAL links for navigating to related resources",
      "properties": {
        "self": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "web": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "pipeline": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "pipeline.web": {
          "type": "object",
          "properties": {
            "href": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    }
  }
}