{
  "openapi": "3.1.1",
  "info": {
    "title": "Aduvo Public Website API",
    "version": "1.0.0",
    "description": "Read-only documentation of public Aduvo marketing content and website discovery. Public reads require no authentication. Customer accounts, borrower records, campaign operations, and private WordPress operations are outside this specification. WordPress permissions remain unchanged.",
    "contact": {
      "name": "Aduvo",
      "url": "https://aduvo.com/contact/"
    }
  },
  "servers": [
    {
      "url": "https://aduvo.com"
    }
  ],
  "externalDocs": {
    "description": "Aduvo developer documentation and authentication scope",
    "url": "https://aduvo.com/developers/"
  },
  "security": [],
  "paths": {
    "/": {
      "get": {
        "operationId": "getAduvoHomepage",
        "summary": "Read the Aduvo homepage as HTML or Markdown",
        "description": "Send Accept: text/markdown for Markdown or Accept: text/html for HTML. Supports quality values and wildcards; HTML is preferred on equal matches. HEAD returns the corresponding headers without a body.",
        "responses": {
          "200": {
            "description": "Public homepage",
            "headers": {
              "Vary": {
                "description": "Includes Accept.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string",
                  "minLength": 20
                }
              }
            }
          },
          "406": {
            "description": "Neither homepage representation is acceptable.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/": {
      "get": {
        "operationId": "discoverWebsiteRoutes",
        "summary": "Discover WordPress website routes",
        "description": "Route discovery does not grant authorization for private operations. Use the published read operations documented here.",
        "responses": {
          "200": {
            "description": "WordPress REST API index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "namespaces",
                    "routes"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "namespaces": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "routes": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "default": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/wp/v2/posts": {
      "get": {
        "operationId": "listPublicArticles",
        "summary": "List published Aduvo marketing articles",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page of results. Out-of-range nonempty collections return HTTP 400.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "description": "Filter by a single article slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published articles, newest first. Empty collections return an empty array.",
            "headers": {
              "X-WP-Total": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Total matching articles."
              },
              "X-WP-TotalPages": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Total pages."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Post"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/wp/v2/posts/{id}": {
      "get": {
        "operationId": "getPublicArticle",
        "summary": "Read one published Aduvo article",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published article. Rendered fields contain HTML. Additional WordPress/plugin fields may be present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "Structured WordPress error with recovery guidance. Existing error codes and validation details are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RenderedText": {
        "type": "object",
        "required": [
          "rendered"
        ],
        "properties": {
          "rendered": {
            "type": "string",
            "description": "HTML, not Markdown; sanitize before rendering."
          }
        },
        "additionalProperties": true
      },
      "Post": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "link",
          "title",
          "content",
          "excerpt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "slug": {
            "type": "string"
          },
          "link": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "$ref": "#/components/schemas/RenderedText"
          },
          "content": {
            "$ref": "#/components/schemas/RenderedText"
          },
          "excerpt": {
            "$ref": "#/components/schemas/RenderedText"
          }
        },
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message",
          "data",
          "hint",
          "documentation_url"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "type": "integer",
                "minimum": 400,
                "maximum": 599
              }
            },
            "additionalProperties": true
          },
          "hint": {
            "type": "string"
          },
          "documentation_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      }
    }
  }
}
