{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-approval-request-schema.json",
  "title": "ApprovalRequest",
  "description": "A request to approve content before it can air.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-approvals-api-openapi.yml#/components/schemas/ApprovalRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Approval request id."
    },
    "contentKind": {
      "type": "string",
      "description": "`playlist`, `schedule`, `creative`, `layout`, `creative-override`, `media`, `app`, …"
    },
    "contentId": {
      "type": "string"
    },
    "contentName": {
      "type": "string"
    },
    "thumbnailUrl": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "nodeId": {
      "type": "string",
      "description": "The content's home location; empty string for the workspace root."
    },
    "nodeName": {
      "type": "string"
    },
    "requestedByName": {
      "type": "string"
    },
    "requestedAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "changes": {
      "type": "array",
      "items": {},
      "description": "What changed since the last approved version: `{kind, label, detail, thumbnailUrl?}` items for kinds the server diffs; for other kinds, whatever the requester sent."
    },
    "state": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "rejected",
        "withdrawn"
      ]
    },
    "requestedById": {
      "type": "string",
      "description": "User id, or `apikey:<id>` for a key."
    },
    "levels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "nodeId": {
            "type": "string"
          },
          "nodeName": {
            "type": "string"
          },
          "approverIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "approverNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "nodeId",
          "nodeName",
          "approverIds",
          "approverNames"
        ]
      },
      "description": "The approval chain, one entry per tier."
    },
    "currentLevel": {
      "type": "integer",
      "description": "Index into `levels` awaiting a decision while pending."
    },
    "decisions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "level": {
            "type": "integer"
          },
          "decidedById": {
            "type": "string"
          },
          "decidedByName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "decidedAt": {
            "type": "string",
            "description": "ISO-8601 timestamp (UTC)."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "level",
          "decidedById",
          "decidedByName",
          "decidedAt",
          "note"
        ]
      }
    },
    "decidedByName": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "decidedAt": {
      "anyOf": [
        {
          "type": "string",
          "description": "ISO-8601 timestamp (UTC)."
        },
        {
          "type": "null"
        }
      ]
    },
    "decisionNote": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "canDecide": {
      "description": "On the list and single reads: whether the caller may approve or reject the request at its current level (a named approver, or the kind's approve permission there). False once it is decided.",
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "contentKind",
    "contentId",
    "contentName",
    "thumbnailUrl",
    "nodeId",
    "nodeName",
    "requestedByName",
    "requestedAt",
    "note",
    "changes",
    "state",
    "requestedById",
    "levels",
    "currentLevel",
    "decisions",
    "decidedByName",
    "decidedAt",
    "decisionNote"
  ]
}