{
  "openapi": "3.1.0",
  "info": {
    "title": "dcmcapital.fi public read API",
    "version": "1.4.0",
    "summary": "Public, unauthenticated read access to Neuvottelija podcast episodes and site content.",
    "description": "Operated by DCM Capital Oy. No authentication is required and no endpoint accepts writes. Content usage preferences are declared in /robots.txt via Content-Signal (search=yes, ai-input=yes, ai-train=yes). See /auth.md.",
    "contact": {
      "name": "DCM Capital Oy",
      "email": "sami.miettinen@dcmcapital.fi",
      "url": "https://dcmcapital.fi/yhteystiedot/"
    }
  },
  "servers": [
    {
      "url": "https://dcmcapital.fi",
      "description": "Production"
    }
  ],
  "paths": {
    "/wp-json/dcm/v1/episodes": {
      "get": {
        "operationId": "listEpisodes",
        "summary": "List or search Neuvottelija podcast episodes",
        "description": "Returns published episodes, newest first. Full-text search covers episode titles and descriptions, so guest names and topics both work as search terms.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Free-text search terms, e.g. a guest name or a topic.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of episodes.",
            "headers": {
              "X-WP-Total": {
                "description": "Total number of matching episodes.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-WP-TotalPages": {
                "description": "Total number of pages available.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Episode"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/wp/v2/pages": {
      "get": {
        "operationId": "listPages",
        "summary": "List site pages (WordPress REST API)",
        "parameters": [
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "_fields",
            "in": "query",
            "required": false,
            "description": "Comma-separated field whitelist; use it to keep responses small.",
            "schema": {
              "type": "string",
              "example": "id,slug,link,title"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of site pages.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wp-json/wp/v2/posts": {
      "get": {
        "operationId": "listPosts",
        "summary": "List blog posts (WordPress REST API)",
        "responses": {
          "200": {
            "description": "A page of posts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/company.json": {
      "get": {
        "operationId": "getPublicCompany",
        "summary": "Public DCM Capital company and contact information",
        "responses": {
          "200": {
            "description": "Public company facts and source URLs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/content-index.json": {
      "get": {
        "operationId": "getPublicContentIndex",
        "summary": "Reviewed public page summaries and paginated episode metadata",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Items, episode_total, episode_pages and next_page; page summaries are on page 1",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "publicMcp",
        "summary": "Public read-only MCP JSON-RPC endpoint",
        "description": "Streamable HTTP with JSON responses. Supported tools: search_content, read_content, get_company, get_catalogue_status. Protocol versions 2025-11-25, 2025-06-18, 2025-03-26.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "202": {
            "description": "Notification accepted; empty body"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Invalid origin"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Content-Type must be application/json"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Episode": {
        "type": "object",
        "required": [
          "id",
          "title",
          "link",
          "date"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "description": "WordPress post ID."
          },
          "title": {
            "type": "string",
            "description": "Episode title, plain text."
          },
          "link": {
            "type": "string",
            "format": "uri",
            "description": "Canonical episode URL — cite this."
          },
          "date": {
            "type": "string",
            "format": "date-time",
            "description": "Publication date, site timezone."
          },
          "excerpt": {
            "type": "string",
            "description": "Short description, plain text."
          },
          "video": {
            "type": "string",
            "format": "uri",
            "description": "Source YouTube video of the episode, if known."
          },
          "neuvottelija_url": {
            "type": "string",
            "description": "Matching episode page on www.neuvottelija.fi (transcript, guest data), or empty."
          }
        }
      }
    }
  }
}
