{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure/json-schema/microsoft-azure-policy-token-response-schema.json",
  "title": "PolicyTokenResponse",
  "description": "The policy token response properties.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-providers-api-openapi.yml#/components/schemas/PolicyTokenResponse",
  "type": "object",
  "properties": {
    "result": {
      "$ref": "#/$defs/PolicyTokenResult",
      "description": "The result of the completed token acquisition operation. Possible values are Succeeded and Failed."
    },
    "requestDetails": {
      "$ref": "#/$defs/PolicyTokenEvaluatedRequestDetails",
      "description": "The external evaluation request details."
    },
    "message": {
      "type": "string",
      "description": "Status message with additional details about the token acquisition operation result."
    },
    "retryAfter": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time after which the client can try to acquire a token again in the case of retry-able failures."
    },
    "results": {
      "type": "array",
      "description": "An array of external evaluation endpoint invocation results.",
      "items": {
        "$ref": "#/$defs/ExternalEvaluationEndpointInvocationResult"
      },
      "x-ms-identifiers": []
    },
    "changeReference": {
      "type": "string",
      "description": "The change reference associated with the operation for which the token is acquired."
    },
    "token": {
      "type": "string",
      "description": "The issued policy token."
    },
    "tokenId": {
      "type": "string",
      "description": "The unique Id assigned to the policy token."
    },
    "expiration": {
      "type": "string",
      "format": "date-time",
      "description": "The expiration of the policy token."
    }
  },
  "$defs": {
    "ComplianceState": {
      "type": "string",
      "description": "The compliance state of the resource against the policy. Possible values are NotSpecified, NonCompliant, Partial, Conflict, NotApplicable, Compliant, Error, Unknown, Exempt, and Protected.",
      "enum": [
        "NotSpecified",
        "NonCompliant",
        "Partial",
        "Conflict",
        "NotApplicable",
        "Compliant",
        "Error",
        "Unknown",
        "Exempt",
        "Protected"
      ],
      "x-ms-enum": {
        "name": "ComplianceState",
        "modelAsString": true,
        "values": [
          {
            "name": "NotSpecified",
            "value": "NotSpecified",
            "description": "Indicates a policy evaluation result for which no specific value is set by the evaluator."
          },
          {
            "name": "NonCompliant",
            "value": "NonCompliant",
            "description": "Indicates a non-compliant policy evaluation."
          },
          {
            "name": "Partial",
            "value": "Partial",
            "description": "Indicates a partially completed policy evaluation."
          },
          {
            "name": "Conflict",
            "value": "Conflict",
            "description": "Indicates a policy evaluation result, where the Policy definitions conflicted so that the evaluation couldn't complete."
          },
          {
            "name": "NotApplicable",
            "value": "NotApplicable",
            "description": "Indicates a policy evaluation result, where the Policy is not applicable."
          },
          {
            "name": "Compliant",
            "value": "Compliant",
            "description": "Indicates a policy evaluation result, where the Policy is compliant."
          },
          {
            "name": "Error",
            "value": "Error",
            "description": "Indicates a policy evaluation result, where the Policy evaluation resulted in an error."
          },
          {
            "name": "Unknown",
            "value": "Unknown",
            "description": "Indicates a policy evaluation result that is unknown."
          },
          {
            "name": "Exempt",
            "value": "Exempt",
            "description": "Indicates a policy evaluation result, where the Policy is exempt."
          },
          {
            "name": "Protected",
            "value": "Protected",
            "description": "Indicates a policy evaluation result, where the resource is protected."
          }
        ]
      }
    },
    "ExternalEndpointResult": {
      "type": "string",
      "description": "The result of the external endpoint. Possible values are Succeeded and Failed.",
      "enum": [
        "Succeeded",
        "Failed"
      ],
      "x-ms-enum": {
        "name": "ExternalEndpointResult",
        "modelAsString": true,
        "values": [
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "The external endpoint succeeded."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "The external endpoint failed."
          }
        ]
      }
    },
    "ExternalEvaluationEndpointInvocationResult": {
      "type": "object",
      "description": "The external evaluation endpoint invocation results.",
      "properties": {
        "policyInfo": {
          "$ref": "#/$defs/PolicyLogInfo",
          "description": "The details of the policy requiring the external endpoint invocation."
        },
        "result": {
          "$ref": "#/$defs/ExternalEndpointResult",
          "description": "The result of the external endpoint. Possible values are Succeeded and Failed."
        },
        "endpointKind": {
          "type": "string",
          "description": "The external evaluation endpoint kind."
        },
        "message": {
          "type": "string",
          "description": "The status message with additional details about the invocation result."
        },
        "retryAfter": {
          "type": "string",
          "format": "date-time",
          "description": "The date and time after which a failed endpoint invocation can be retried."
        },
        "claims": {
          "description": "The set of claims that will be attached to the policy token as an attestation for the result of the endpoint invocation."
        },
        "policyAction": {
          "$ref": "#/$defs/PolicyAction",
          "description": "The effective outcome of the policy evaluation based on both the policy effect and evaluation result. Possible values are Unknown, Allow, Audit, Deny, Error."
        },
        "policyEvaluationDetails": {
          "description": "The evaluation details returned by the policy evaluation engine."
        },
        "additionalInfo": {
          "description": "The endpoint specific metadata."
        },
        "complianceState": {
          "$ref": "#/$defs/ComplianceState",
          "description": "The compliance state of the resource against the policy. Possible values are NotSpecified, NonCompliant, Conflict, NotApplicable, Compliant, Error, Unknown, and Exempt."
        },
        "expiration": {
          "type": "string",
          "format": "date-time",
          "description": "The expiration of the results."
        }
      }
    },
    "PolicyAction": {
      "type": "string",
      "description": "The effective outcome of the policy evaluation based on both the policy effect and evaluation result. Possible values are Unknown, Allow, Audit, Deny, Error.",
      "enum": [
        "Unknown",
        "Allow",
        "Audit",
        "Deny",
        "Error"
      ],
      "x-ms-enum": {
        "name": "PolicyAction",
        "modelAsString": true,
        "values": [
          {
            "name": "Unknown",
            "value": "Unknown",
            "description": "The effective outcome of policy evaluation is unknown."
          },
          {
            "name": "Allow",
            "value": "Allow",
            "description": "The effective outcome of policy evaluation is to allow the request."
          },
          {
            "name": "Audit",
            "value": "Audit",
            "description": "The effective outcome of policy evaluation is to audit the request."
          },
          {
            "name": "Deny",
            "value": "Deny",
            "description": "The effective outcome of policy evaluation is to deny the request."
          },
          {
            "name": "Error",
            "value": "Error",
            "description": "The policy evaluation resulted in an error."
          }
        ]
      }
    },
    "PolicyLogInfo": {
      "type": "object",
      "description": "The policy log info.",
      "properties": {
        "policyDefinitionId": {
          "type": "string",
          "description": "The policy definition Id."
        },
        "policySetDefinitionId": {
          "type": "string",
          "description": "The policy set definition Id."
        },
        "policyDefinitionReferenceId": {
          "type": "string",
          "description": "The policy definition instance Id inside a policy set."
        },
        "policySetDefinitionName": {
          "type": "string",
          "description": "The policy set definition name."
        },
        "policySetDefinitionVersion": {
          "type": "string",
          "description": "The policy set definition version."
        },
        "policyDefinitionName": {
          "type": "string",
          "description": "The policy definition name."
        },
        "policyDefinitionVersion": {
          "type": "string",
          "description": "The policy definition version."
        },
        "policyDefinitionEffect": {
          "type": "string",
          "description": "The policy definition action."
        },
        "policyAssignmentId": {
          "type": "string",
          "description": "The policy assignment Id."
        },
        "policyAssignmentName": {
          "type": "string",
          "description": "The policy assignment name."
        },
        "policyAssignmentVersion": {
          "type": "string",
          "description": "The policy assignment version."
        },
        "policyAssignmentScope": {
          "type": "string",
          "description": "The policy assignment scope."
        }
      }
    },
    "PolicyTokenEvaluatedRequestDetails": {
      "type": "object",
      "description": "The policy token evaluated request details.",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The request URI of the resource operation that is targeted by the issued token."
        },
        "resourceId": {
          "type": "string",
          "description": "The resource Id of the resource operation that is targeted by the issued token."
        },
        "apiVersion": {
          "type": "string",
          "description": "The api-version of the resource operation that is targeted by the issued token."
        },
        "authorizationAction": {
          "type": "string",
          "description": "The authorization action of the resource operation that is targeted by the issued token."
        },
        "httpMethod": {
          "type": "string",
          "description": "The http method of the resource operation that is targeted by the issued token."
        },
        "contentHash": {
          "type": "string",
          "description": "The hashed payload of the resource operation that is targeted by the issued token."
        }
      },
      "required": [
        "uri",
        "resourceId",
        "apiVersion",
        "authorizationAction",
        "httpMethod",
        "contentHash"
      ]
    },
    "PolicyTokenResult": {
      "type": "string",
      "description": "The result of the completed token acquisition operation. Possible values are Succeeded and Failed.",
      "enum": [
        "Succeeded",
        "Failed"
      ],
      "x-ms-enum": {
        "name": "PolicyTokenResult",
        "modelAsString": true,
        "values": [
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "The token acquisition succeeded."
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "The token acquisition failed."
          }
        ]
      }
    }
  }
}