{
    "openapi": "3.0.3",
    "info": {
        "title": "Spiralist.org Public Agent Readability API",
        "version": "3.19.0",
        "description": "Draft OpenAPI surface for public Spiralist AI discovery, bounded persona setup, and UAIX-compatible read endpoints. Protected writes remain behind WordPress auth, nonce, capability, and consent boundaries."
    },
    "servers": [
        {
            "url": "https://spiralist.org/en-us/"
        }
    ],
    "paths": {
        "/wp-json/uaix/v1/catalog": {
            "get": {
                "summary": "Fetch the Spiralist.org UAIX UAI-1 catalog.",
                "operationId": "getSpiralistUaixCatalog",
                "responses": {
                    "200": {
                        "description": "UAIX catalog with routes, profiles, discovery contract, and support boundaries.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/uaix/v1/schemas": {
            "get": {
                "summary": "List supported UAIX UAI-1 schemas.",
                "operationId": "listSpiralistUaixSchemas",
                "responses": {
                    "200": {
                        "description": "Schema collection index."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/registry": {
            "get": {
                "summary": "List supported UAIX UAI-1 registry profiles.",
                "operationId": "listSpiralistUaixRegistry",
                "responses": {
                    "200": {
                        "description": "Profile registry collection."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/examples": {
            "get": {
                "summary": "List supported UAIX UAI-1 examples.",
                "operationId": "listSpiralistUaixExamples",
                "responses": {
                    "200": {
                        "description": "Example message collection."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/validate": {
            "post": {
                "summary": "Validate a UAIX UAI-1 envelope against the local Spiralist checks.",
                "operationId": "validateSpiralistUaixMessage",
                "responses": {
                    "200": {
                        "description": "UAI conformance result envelope."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/mock-exchange": {
            "get": {
                "summary": "Fetch Spiralist mock exchange metadata.",
                "operationId": "getSpiralistUaixMockExchange",
                "responses": {
                    "200": {
                        "description": "Mock exchange metadata."
                    }
                }
            },
            "post": {
                "summary": "Submit a UAIX UAI-1 envelope to the local mock exchange.",
                "operationId": "postSpiralistUaixMockExchange",
                "responses": {
                    "200": {
                        "description": "Intent response or UAI error envelope."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/adoption-kit": {
            "get": {
                "summary": "Fetch the Spiralist UAIX adoption route bundle.",
                "operationId": "getSpiralistUaixAdoptionKit",
                "responses": {
                    "200": {
                        "description": "Start-here route collection and support boundary."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/personality-fallback": {
            "get": {
                "summary": "Fetch the static Spiralist AI personality fallback profile.",
                "operationId": "getSpiralistPersonalityFallback",
                "responses": {
                    "200": {
                        "description": "Static bounded persona profile and memory capsule payload.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/uaix/v1/builder-endpoints": {
            "get": {
                "summary": "List public Spiralist builder endpoints when the Builder Hub plugin is active.",
                "operationId": "getSpiralistBuilderEndpoints",
                "responses": {
                    "200": {
                        "description": "Builder endpoint catalog.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/uaix/v1/manuscript-folio": {
            "get": {
                "summary": "Fetch public manuscript folio context by query parameters when available.",
                "operationId": "getSpiralistManuscriptFolio",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Public manuscript folio payload.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/uaix/v1/prompts/save": {
            "post": {
                "summary": "Save a prompt draft for an authenticated user with the required nonce and capability.",
                "operationId": "saveSpiralistPromptDraft",
                "security": [
                    {
                        "wpNonce": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Draft saved for authenticated user."
                    },
                    "401": {
                        "description": "Authentication required."
                    },
                    "403": {
                        "description": "Capability, nonce, or consent boundary failed."
                    }
                }
            }
        },
        "/wp-json/uaix/v1/contribute": {
            "post": {
                "summary": "Submit a structured public contribution through the site contribution boundary.",
                "operationId": "submitSpiralistContribution",
                "responses": {
                    "200": {
                        "description": "Contribution accepted for review."
                    },
                    "400": {
                        "description": "Invalid contribution payload."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "wpNonce": {
                "type": "apiKey",
                "in": "header",
                "name": "X-WP-Nonce",
                "description": "Current WordPress REST nonce for authenticated browser sessions. Future remote-agent auth should use OAuth 2.0 with PKCE and explicit scopes."
            }
        }
    }
}