{
    "openapi": "3.1.0",
    "info": {
        "title": "406 For Kids public content (read-only)",
        "version": "1.0.0",
        "description": "Read-only endpoints for the public content of 406forkids.org, the website of 406 For Kids, a 501(c)(3) nonprofit in Kalispell, Montana. Every operation is a GET that needs no sign-in. The JSON endpoints are the standard WordPress REST API, version wp/v2 in the path. There are no endpoints for donations, bookings, sign-ups or any other changes; send people to the matching web page instead (see /llms.txt).",
        "contact": {
            "name": "406 For Kids",
            "url": "https://406forkids.org/contact-us/",
            "email": "lori@406forkids.org"
        }
    },
    "servers": [
        {
            "url": "https://406forkids.org"
        }
    ],
    "tags": [
        {
            "name": "content",
            "description": "Pages and news posts as JSON"
        },
        {
            "name": "search",
            "description": "Site search"
        },
        {
            "name": "markdown",
            "description": "Plain-text guides and Markdown versions of pages"
        }
    ],
    "paths": {
        "/wp-json/wp/v2/pages": {
            "get": {
                "operationId": "listPages",
                "tags": [
                    "content"
                ],
                "summary": "List or search public pages",
                "description": "Returns published pages, such as About us, The Sunshine Factory and Make a donation. Filter with search or slug.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Only return items that match this search text.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Only return the item with this slug, e.g. about-us.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (1-100, default 10).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page of results (default 1).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "_fields",
                        "in": "query",
                        "description": "Comma-separated fields to return, e.g. id,title,link,excerpt.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A list of items",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ContentItem"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WPError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/wp/v2/pages/{id}": {
            "get": {
                "operationId": "getPage",
                "tags": [
                    "content"
                ],
                "summary": "Get one public page by ID",
                "description": "Returns a single published page, including its rendered HTML content.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric ID of the item.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContentItem"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WPError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/wp/v2/posts": {
            "get": {
                "operationId": "listPosts",
                "tags": [
                    "content"
                ],
                "summary": "List or search news posts",
                "description": "Returns published news and story posts, newest first. Filter with search or slug.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Only return items that match this search text.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Only return the item with this slug, e.g. about-us.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page (1-100, default 10).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page of results (default 1).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "_fields",
                        "in": "query",
                        "description": "Comma-separated fields to return, e.g. id,title,link,excerpt.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A list of items",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ContentItem"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WPError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/wp/v2/posts/{id}": {
            "get": {
                "operationId": "getPost",
                "tags": [
                    "content"
                ],
                "summary": "Get one news post by ID",
                "description": "Returns a single published post, including its rendered HTML content.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Numeric ID of the item.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContentItem"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WPError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp-json/wp/v2/search": {
            "get": {
                "operationId": "searchSite",
                "tags": [
                    "search"
                ],
                "summary": "Search the whole site",
                "description": "Searches published pages and posts and returns titles and URLs.",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": true,
                        "description": "Search text, e.g. volunteer.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "subtype",
                        "in": "query",
                        "description": "Content types to search. Use page,post for public pages and news posts.",
                        "schema": {
                            "type": "string",
                            "default": "page,post",
                            "enum": [
                                "page,post",
                                "page",
                                "post"
                            ]
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Results per page (1-100, default 10).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page of results (default 1).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Search results",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/SearchResult"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WPError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/llms.txt": {
            "get": {
                "operationId": "getSiteGuide",
                "tags": [
                    "markdown"
                ],
                "summary": "Site guide for AI agents",
                "description": "Who 406 For Kids is, when to point people to the site, and links to every important page.",
                "responses": {
                    "200": {
                        "description": "The site guide",
                        "content": {
                            "text/plain": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/index.md": {
            "get": {
                "operationId": "getHomepageMarkdown",
                "tags": [
                    "markdown"
                ],
                "summary": "Homepage as Markdown",
                "description": "The homepage content as Markdown, with a short summary of the organization.",
                "responses": {
                    "200": {
                        "description": "Markdown version of the page",
                        "content": {
                            "text/markdown": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/{pagePath}.md": {
            "get": {
                "operationId": "getPageMarkdown",
                "tags": [
                    "markdown"
                ],
                "summary": "Any public page as Markdown",
                "description": "Add .md to a page address to get it as Markdown, e.g. /about-us.md. For a child page use the full path, e.g. /about-us/community-impact.md. Requesting a normal page address with the header Accept: text/markdown returns the same Markdown.",
                "parameters": [
                    {
                        "name": "pagePath",
                        "in": "path",
                        "required": true,
                        "description": "The page path without the trailing slash, e.g. about-us or sunshine-factory.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Markdown version of the page",
                        "content": {
                            "text/markdown": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No public page at that address (Markdown explanation)",
                        "content": {
                            "text/markdown": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ContentItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "modified": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri"
                    },
                    "title": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string",
                                "description": "HTML"
                            }
                        }
                    },
                    "excerpt": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string",
                                "description": "HTML"
                            }
                        }
                    },
                    "content": {
                        "type": "object",
                        "properties": {
                            "rendered": {
                                "type": "string",
                                "description": "HTML"
                            }
                        }
                    }
                }
            },
            "SearchResult": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "type": {
                        "type": "string"
                    },
                    "subtype": {
                        "type": "string"
                    }
                }
            },
            "WPError": {
                "type": "object",
                "required": [
                    "code",
                    "message"
                ],
                "properties": {
                    "code": {
                        "type": "string",
                        "description": "Machine-readable error code, e.g. rest_post_invalid_id"
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable message"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "integer"
                            }
                        }
                    }
                }
            }
        }
    }
}
