{
  "openapi": "3.1.0",
  "info": {
    "title": "josesoto.ai — Public Content API",
    "version": "1.0.0",
    "description": "API pública de sólo-lectura para acceder al contenido publicado en josesoto.ai: ensayos, manifiesto y bio de Jose Soto. Pensada para consumo por agentes, LLMs y crawlers.",
    "contact": {
      "name": "Jose Soto",
      "email": "jose@josesoto.ai",
      "url": "https://josesoto.ai/contacto"
    },
    "license": {
      "name": "Contenido con atribución (CC BY 4.0)",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "termsOfService": "https://josesoto.ai/terminos"
  },
  "servers": [
    {
      "url": "https://josesoto.ai",
      "description": "Producción"
    }
  ],
  "externalDocs": {
    "description": "llms.txt — índice para LLMs",
    "url": "https://josesoto.ai/llms.txt"
  },
  "tags": [
    {
      "name": "content",
      "description": "Contenido editorial (ensayos, manifiesto)."
    },
    {
      "name": "identity",
      "description": "Datos públicos del autor."
    },
    {
      "name": "actions",
      "description": "Acciones del sitio (newsletter, contacto)."
    }
  ],
  "paths": {
    "/api/essays": {
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Lista todos los ensayos publicados.",
        "operationId": "listEssays",
        "responses": {
          "200": {
            "description": "Listado de ensayos con metadatos.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EssayList"
                }
              }
            }
          }
        }
      }
    },
    "/api/essays/{slug}": {
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Obtiene un ensayo específico en markdown.",
        "operationId": "getEssay",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Slug URL-safe del ensayo."
          }
        ],
        "responses": {
          "200": {
            "description": "Ensayo con cuerpo en markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Essay"
                }
              }
            }
          },
          "404": {
            "description": "Ensayo no encontrado."
          }
        }
      }
    },
    "/api/manifesto": {
      "get": {
        "tags": [
          "content"
        ],
        "summary": "Manifiesto completo de Jose Soto en markdown.",
        "operationId": "getManifesto",
        "responses": {
          "200": {
            "description": "Manifiesto en markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Manifesto"
                }
              }
            }
          }
        }
      }
    },
    "/api/bio": {
      "get": {
        "tags": [
          "identity"
        ],
        "summary": "Bio pública y datos de contacto de Jose Soto.",
        "operationId": "getBio",
        "responses": {
          "200": {
            "description": "Datos públicos.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bio"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscribe": {
      "post": {
        "tags": [
          "actions"
        ],
        "summary": "Suscribe un email al newsletter.",
        "operationId": "subscribeNewsletter",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "source": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "Redirección a /gracias."
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "tags": [
          "actions"
        ],
        "summary": "Envía un mensaje de contacto.",
        "operationId": "sendContact",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "company": {
                    "type": "string"
                  },
                  "motive": {
                    "type": "string",
                    "enum": [
                      "Consultoría FortIA",
                      "Speaking / Ponencias",
                      "Medios / Prensa",
                      "Otro"
                    ]
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "303": {
            "description": "Redirección a /gracias."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EssayMeta": {
        "type": "object",
        "required": [
          "slug",
          "title",
          "date",
          "category",
          "excerpt",
          "url"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "category": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "EssayList": {
        "type": "object",
        "required": [
          "count",
          "items"
        ],
        "properties": {
          "count": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EssayMeta"
            }
          }
        }
      },
      "Essay": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EssayMeta"
          },
          {
            "type": "object",
            "required": [
              "body",
              "format"
            ],
            "properties": {
              "body": {
                "type": "string"
              },
              "format": {
                "type": "string",
                "enum": [
                  "markdown"
                ]
              }
            }
          }
        ]
      },
      "Manifesto": {
        "type": "object",
        "required": [
          "title",
          "body",
          "format",
          "url"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "body": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "enum": [
              "markdown"
            ]
          },
          "author": {
            "type": "string"
          }
        }
      },
      "Bio": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "headline": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "location": {
            "type": "object",
            "properties": {
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string"
              }
            }
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "bio": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          },
          "knows_about": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}