{
  "openapi": "3.1.1",
  "info": {
    "title": "AppPortal Public Pages API",
    "version": "unversioned",
    "description": "Two existing anonymous read operations for published application pages. Authoring, review and publication remain authenticated Dashboard workflows. This source reference does not establish a deployed host or release."
  },
  "servers": [
    {
      "url": "https://pages.appportal.io",
      "description": "The owning public Pages origin; source generation does not verify deployment."
    }
  ],
  "security": [],
  "x-appportal-source": {
    "owningRoutes": "src/AppPortal.Pages.Api/Program.cs",
    "ingress": "src/AppPortal.Contracts/FrontendIngressContracts.cs:Pages",
    "browserTransforms": [
      "src/AppPortal.AppHost/AppHost.cs:pagesSite YARP removes /api/pages",
      "frontend/pages/vite.config.ts:development proxy removes /api/pages"
    ],
    "responseContracts": [
      "src/AppPortal.Contracts/Pages/PublicPage.cs",
      "src/AppPortal.Contracts/Pages/PageKind.cs"
    ],
    "representedRelease": null,
    "deployedRelease": null,
    "deploymentVerification": "unverified"
  },
  "paths": {
    "/api/pages/public/{appSlug}": {
      "get": {
        "operationId": "listPublishedPageKinds",
        "summary": "List the published page kinds for an app slug",
        "x-appportal-owning-service-path": "/public/{appSlug}",
        "security": [],
        "parameters": [
          {
            "name": "appSlug",
            "in": "path",
            "required": true,
            "description": "The public application slug, lowercased invariantly by the owning store before lookup. It selects published content, not account or management authority.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Browser ingress removes /api/pages before forwarding to the owning native /public route. Returns distinct Published-state kinds ordered by their PageKind value. The catalog does not require publishedAt, while the page read does. An unknown app slug or an app with no published kinds returns 200 and an empty array. This public read neither lists drafts nor grants authoring access. No account cookie, SDK credential or CSRF token is required.",
        "responses": {
          "200": {
            "description": "Published kind names using the actual PageKind JSON converter; the array can be empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublishedPageKinds"
                }
              }
            }
          }
        }
      }
    },
    "/api/pages/public/{appSlug}/{kind}": {
      "get": {
        "operationId": "getPublishedPage",
        "summary": "Read one published app page",
        "x-appportal-owning-service-path": "/public/{appSlug}/{kind}",
        "security": [],
        "parameters": [
          {
            "name": "appSlug",
            "in": "path",
            "required": true,
            "description": "The public application slug, lowercased invariantly by the owning store before lookup. It selects published content, not account or management authority.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "description": "PageKind parsed case-insensitively by Enum.TryParse and checked with Enum.IsDefined. Named values and defined numeric forms are accepted; unsupported names/numbers return 404. Response JSON always uses the enum's named string form.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "named": {
                "value": "landing"
              },
              "definedNumeric": {
                "value": "0"
              }
            }
          }
        ],
        "description": "Reads a published page. Missing apps, unknown kinds and unpublished pages return the same 404. The response is empty unless the client explicitly requests problem JSON.",
        "responses": {
          "200": {
            "description": "The existing PublicPage DTO, with its native field names, enum spelling and explicit nullable metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPage"
                }
              }
            }
          },
          "404": {
            "description": "No matching published page. Request application/problem+json for an error code and support reference.",
            "x-appportal-body-may-be-absent": true,
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPageProblem"
                }
              }
            },
            "headers": {
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              },
              "Cache-Control": {
                "$ref": "#/components/headers/ManagementProblemCacheControl"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PublicPage": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "appSlug": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "Landing",
              "Privacy",
              "Terms",
              "Support",
              "Beta"
            ]
          },
          "title": {
            "type": "string"
          },
          "heroTagline": {
            "type": [
              "string",
              "null"
            ]
          },
          "bodyMarkdown": {
            "type": "string"
          },
          "contactEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "storeBadges": {
            "type": "boolean"
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "appSlug",
          "kind",
          "title",
          "heroTagline",
          "bodyMarkdown",
          "contactEmail",
          "storeBadges",
          "publishedAt"
        ],
        "description": "The exact published public projection. Nullable heroTagline and contactEmail remain explicit JSON null when absent. Internal account/app IDs, author, review state and draft timestamps are not exposed. bodyMarkdown is content, not trusted HTML; render it with the consumer's normal safe Markdown policy."
      },
      "PageKind": {
        "enum": [
          "Landing",
          "Privacy",
          "Terms",
          "Support",
          "Beta"
        ]
      },
      "PublishedPageKinds": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "enum": [
            "Landing",
            "Privacy",
            "Terms",
            "Support",
            "Beta"
          ]
        }
      },
      "PublicPageProblem": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "instance": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "traceId": {
            "type": "string"
          },
          "code": {
            "const": "public_page_unavailable"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "message",
          "error",
          "traceId"
        ]
      }
    },
    "headers": {
      "ManagementProblemTraceId": {
        "description": "Opaque error correlation; matches the shared problem body's traceId.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        }
      },
      "ManagementProblemCacheControl": {
        "description": "Includes no-store for shared management problems; additional directives may be present. Browser JSON and bodyless failures retain their native behavior.",
        "schema": {
          "type": "string"
        }
      }
    }
  },
  "x-appportal-reference-source": "8bda8e8302d4ea5bd005ef1132f7267e82e6337c"
}
