{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/power-bi/json-schema/power-bi-goal-schema.json",
  "title": "Goal",
  "description": "A Power BI goal",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/power-bi-goals-preview-api-openapi.yml#/components/schemas/Goal",
  "properties": {
    "id": {
      "description": "The goal ID",
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "description": "The goal name",
      "type": "string"
    },
    "scorecardId": {
      "description": "The scorecard ID",
      "type": "string",
      "format": "uuid"
    },
    "createdTime": {
      "description": "The UTC time at creation",
      "type": "string",
      "format": "date-time"
    },
    "lastModifiedTime": {
      "description": "The UTC time at last modification",
      "type": "string",
      "format": "date-time"
    },
    "startDate": {
      "description": "The UTC timestamp for the start date of the goal. The time portion of the timestamp is zero.",
      "type": "string",
      "format": "date-time"
    },
    "completionDate": {
      "description": "The UTC timestamp for the completion date of the goal. The time portion of the timestamp is zero.",
      "type": "string",
      "format": "date-time"
    },
    "parentId": {
      "description": "The ID of the parent goal, if defined.",
      "type": "string",
      "format": "uuid"
    },
    "notesCount": {
      "description": "notesCount",
      "type": "integer",
      "format": "int32"
    },
    "valuesFormatString": {
      "description": "valuesFormatString",
      "type": "string"
    },
    "datesFormatString": {
      "description": "datesFormatString",
      "type": "string"
    },
    "description": {
      "description": "The goal description",
      "type": "string"
    },
    "hasStatusRules": {
      "description": "Whether the goal has status rules defined",
      "type": "boolean"
    },
    "statusRules": {
      "description": "The goal status rules",
      "$ref": "#/$defs/Goals.Rules.GoalRulesContainer"
    },
    "permissions": {
      "description": "The goal permissions",
      "type": "string",
      "enum": [
        "None",
        "View",
        "UpdateCurrentValue",
        "UpdateTargetValue",
        "UpdateNotes",
        "UpdateStatus",
        "UpdateValues",
        "All",
        "11",
        "13",
        "15",
        "19",
        "21",
        "23",
        "25",
        "27",
        "29"
      ],
      "x-ms-enum": {
        "name": "GoalPermissions",
        "modelAsExtensible": true,
        "modelAsString": false,
        "values": [
          {
            "value": "None",
            "description": "No access.",
            "name": "None"
          },
          {
            "value": "View",
            "description": "View access only.",
            "name": "View"
          },
          {
            "value": "UpdateCurrentValue",
            "description": "Current value can be updated.",
            "name": "UpdateCurrentValue"
          },
          {
            "value": "UpdateTargetValue",
            "description": "Target value can be updated.",
            "name": "UpdateTargetValue"
          },
          {
            "value": "UpdateNotes",
            "description": "Notes can be updated.",
            "name": "UpdateNotes"
          },
          {
            "value": "UpdateStatus",
            "description": "Status can be updated.",
            "name": "UpdateStatus"
          },
          {
            "value": "UpdateValues",
            "description": "Current and target values can be updated.",
            "name": "UpdateValues"
          },
          {
            "value": "All",
            "description": "Values, notes, and status can be updated.",
            "name": "All"
          },
          {
            "value": "11",
            "description": "Current value and notes can be updated.",
            "name": "UpdateCurrentValueAndNotes"
          },
          {
            "value": "13",
            "description": "Target value and notes can be updated.",
            "name": "UpdateTargetValueAndNotes"
          },
          {
            "value": "15",
            "description": "Current value, target value, and notes can be updated.",
            "name": "UpdateCurrentValueAndTargetValueAndNotes"
          },
          {
            "value": "19",
            "description": "Current value and status can be updated.",
            "name": "UpdateCurrentValueAndStatus"
          },
          {
            "value": "21",
            "description": "Target value and status can be updated.",
            "name": "UpdateTargetValueAndStatus"
          },
          {
            "value": "23",
            "description": "Current value, target value, and status can be updated.",
            "name": "UpdateCurrentValueAndTargetValueAndStatus"
          },
          {
            "value": "25",
            "description": "Notes and status can be updated.",
            "name": "UpdateNotesAndStatus"
          },
          {
            "value": "27",
            "description": "Current value, notes, and status can be updated.",
            "name": "UpdateCurrentValueAndNotesAndStatus"
          },
          {
            "value": "29",
            "description": "Target value, notes, and status can be updated.",
            "name": "UpdateTargetValueAndNotesAndStatus"
          }
        ]
      }
    },
    "level": {
      "description": "The nested level of the goal in the parent-child hierarchy of scorecard goals",
      "type": "integer",
      "format": "int32"
    },
    "rank": {
      "description": "The rank of the goal within the ordered set of sibling goals",
      "type": "integer",
      "format": "int64"
    },
    "goalValues": {
      "description": "The list of goal value check-ins",
      "type": "array",
      "items": {
        "$ref": "#/$defs/GoalValue"
      }
    },
    "aggregations": {
      "description": "The list of aggregated properties of the goal",
      "type": "array",
      "items": {
        "$ref": "#/$defs/GoalAggregation"
      }
    }
  },
  "$defs": {
    "GoalAggregation": {
      "description": "An entry describing the state of various Power BI goal properties at a specific time (normally current time)",
      "required": [
        "id",
        "timestamp",
        "calculationTime",
        "scorecardId",
        "goalId",
        "value",
        "type",
        "maxLastModifiedTime"
      ],
      "properties": {
        "id": {
          "description": "The aggregation ID",
          "type": "string"
        },
        "timestamp": {
          "description": "The UTC timestamp associated with the aggregated property. The time portion of the timestamp is zero.",
          "type": "string",
          "format": "date-time"
        },
        "calculationTime": {
          "description": "The UTC timestamp of the aggregation calculation",
          "type": "string",
          "format": "date-time"
        },
        "scorecardId": {
          "description": "The scorecard ID",
          "type": "string",
          "format": "uuid"
        },
        "goalId": {
          "description": "The goal ID",
          "type": "string",
          "format": "uuid"
        },
        "value": {
          "description": "The numeric value of the aggregated property",
          "type": "number",
          "format": "double"
        },
        "valueDisplayString": {
          "description": "Optional. The alternative text representation of the aggregated property value.",
          "type": "string"
        },
        "type": {
          "description": "The type of the aggregated property",
          "type": "string",
          "enum": [
            "Value",
            "Target",
            "Status",
            "Sparkline",
            "Change"
          ],
          "x-ms-enum": {
            "name": "GoalAggregationType",
            "modelAsExtensible": true,
            "modelAsString": false,
            "values": [
              {
                "value": "Value",
                "description": "Information about the current value of the goal",
                "name": "Value"
              },
              {
                "value": "Target",
                "description": "Information about the target value of the goal",
                "name": "Target"
              },
              {
                "value": "Status",
                "description": "Information about the status of the goal",
                "name": "Status"
              },
              {
                "value": "Sparkline",
                "description": "Information about the sparkline",
                "name": "Sparkline"
              },
              {
                "value": "Change",
                "description": "Information about the change",
                "name": "Change"
              }
            ]
          }
        },
        "maxLastModifiedTime": {
          "description": "The UTC timestamp of the latest modification to the aggregated property",
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "GoalNote": {
      "description": "A Power BI goal value check-in note",
      "properties": {
        "id": {
          "description": "The goal value check-in note ID",
          "type": "string",
          "format": "uuid"
        },
        "valueTimestamp": {
          "description": "The UTC timestamp of the goal value check-in that this note belongs to. The time portion of the timestamp is zero.",
          "type": "string",
          "format": "date-time"
        },
        "goalId": {
          "description": "The goal ID",
          "type": "string",
          "format": "uuid"
        },
        "scorecardId": {
          "description": "The scorecard ID",
          "type": "string",
          "format": "uuid"
        },
        "lastModifiedTime": {
          "description": "The UTC time at last modification",
          "type": "string",
          "format": "date-time"
        },
        "content": {
          "description": "The content of this note in special format",
          "type": "string"
        },
        "createdTime": {
          "description": "The UTC time at creation",
          "type": "string",
          "format": "date-time"
        },
        "body": {
          "description": "The note text",
          "type": "string"
        }
      }
    },
    "GoalValue": {
      "description": "A Power BI goal value check-in",
      "properties": {
        "timestamp": {
          "description": "The UTC timestamp of the goal value check-in. The time portion of the timestamp is zero.",
          "type": "string",
          "format": "date-time"
        },
        "goalId": {
          "description": "The goal ID",
          "type": "string",
          "format": "uuid"
        },
        "scorecardId": {
          "description": "The scorecard ID",
          "type": "string",
          "format": "uuid"
        },
        "createdTime": {
          "description": "The UTC time at creation",
          "type": "string",
          "format": "date-time"
        },
        "lastModifiedTime": {
          "description": "The UTC time at last modification",
          "type": "string",
          "format": "date-time"
        },
        "value": {
          "description": "The goal current value",
          "type": "number",
          "format": "double"
        },
        "target": {
          "description": "The goal target value",
          "type": "number",
          "format": "double"
        },
        "valueDisplayString": {
          "description": "The textual representation of the current goal value",
          "type": "string"
        },
        "targetDisplayString": {
          "description": "The textual representation of the goal target",
          "type": "string"
        },
        "trend": {
          "description": "The goal value trend",
          "type": "integer",
          "format": "int32"
        },
        "forecast": {
          "description": "The goal value trend forecast",
          "type": "number",
          "format": "double"
        },
        "status": {
          "description": "The ID of the goal status\n\n| ID | Description |\n|-|-|\n| 0 | Not started |\n| 1 | On track |\n| 2 | At risk |\n| 3 | Behind |\n| 4 | Overdue |\n| 5 | Completed |",
          "type": "integer",
          "format": "int32"
        },
        "notes": {
          "description": "The notes for the goal",
          "type": "array",
          "items": {
            "$ref": "#/$defs/GoalNote"
          }
        }
      }
    },
    "Goals.Rules.GoalRulesContainer": {
      "description": "A container for JSON definitions of status rules on a Power BI goal",
      "properties": {
        "scorecardObjectId": {
          "description": "The scorecard ID",
          "type": "string",
          "format": "uuid"
        },
        "goalObjectId": {
          "description": "The goal ID",
          "type": "string",
          "format": "uuid"
        },
        "lastModifiedTime": {
          "description": "The UTC time at last modification",
          "type": "string",
          "format": "date-time"
        },
        "rules": {
          "description": "The list of rules",
          "type": "string"
        }
      }
    }
  }
}