{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/policyforge-co/json-schema/policyforge-co-policy-response-schema.json",
  "title": "PolicyResponse",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/policyforge-co-openapi.json#/components/schemas/PolicyResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique policy identifier"
    },
    "type": {
      "type": "string",
      "description": "Policy type (privacy, terms, cookies, refund)"
    },
    "policy_type": {
      "type": "string",
      "description": "Alias of `type` (same value), for naming consistency with the list endpoint"
    },
    "title": {
      "type": "string",
      "description": "Generated policy title"
    },
    "content": {
      "type": "string",
      "description": "Full policy content in HTML format"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "published",
        "archived"
      ],
      "description": "Policy publication status"
    },
    "hosting_enabled": {
      "type": "boolean"
    },
    "hosted_url": {
      "type": "string",
      "format": "uri",
      "description": "Public URL where the policy is hosted (if hosting is enabled)"
    },
    "url_slug": {
      "type": "string",
      "description": "URL slug for the hosted policy"
    },
    "metadata": {
      "type": "object",
      "description": "Generation metadata (word count, compliance level, etc.)"
    },
    "subscription_info": {
      "$ref": "#/$defs/SubscriptionInfo"
    }
  },
  "$defs": {
    "SubscriptionInfo": {
      "type": "object",
      "properties": {
        "tier": {
          "type": "string",
          "enum": [
            "free",
            "pro",
            "enterprise"
          ]
        },
        "can_create_more": {
          "type": "boolean"
        },
        "remaining_policies": {
          "type": "integer"
        }
      }
    }
  }
}