{
  "openapi": "3.1.1",
  "info": {
    "title": "SyS Publicidad Public API & Agent Interface",
    "version": "1.1.0",
    "description": "Public read-only JSON endpoints, RFC 9110 Markdown/HTML content negotiation, and agent instructions for SyS Publicidad (https://www.syspublicidad.com). Authentication: none required for public read endpoints."
  },
  "servers": [
    {
      "url": "https://www.syspublicidad.com"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getHomepageSpanish",
        "summary": "Spanish homepage (HTML or Markdown via Accept header)",
        "responses": {
          "200": {
            "description": "Homepage; selected using Accept. Vary: Accept. HTML wins equal quality preferences.",
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string"
                },
                "example": "Accept"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "406": {
            "description": "Neither HTML nor Markdown is acceptable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/en/": {
      "get": {
        "operationId": "getHomepageEnglish",
        "summary": "English homepage (HTML or Markdown via Accept header)",
        "responses": {
          "200": {
            "description": "Homepage; selected using Accept. Vary: Accept. HTML wins equal quality preferences.",
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string"
                },
                "example": "Accept"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "406": {
            "description": "Neither HTML nor Markdown is acceptable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/docs/": {
      "get": {
        "operationId": "getDocsSpanish",
        "summary": "Spanish API & Agent documentation (HTML or Markdown via Accept header)",
        "responses": {
          "200": {
            "description": "API and agent documentation in Spanish.",
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string"
                },
                "example": "Accept"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "406": {
            "description": "Neither HTML nor Markdown is acceptable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/en/docs/": {
      "get": {
        "operationId": "getDocsEnglish",
        "summary": "English API & Agent documentation (HTML or Markdown via Accept header)",
        "responses": {
          "200": {
            "description": "API and agent documentation in English.",
            "headers": {
              "Vary": {
                "schema": {
                  "type": "string"
                },
                "example": "Accept"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "406": {
            "description": "Neither HTML nor Markdown is acceptable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "Agent instructions and when-to-use capability guide",
        "responses": {
          "200": {
            "description": "LLMs.txt markdown guide with when-to-use instructions and endpoint links.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/services": {
      "get": {
        "operationId": "listServices",
        "summary": "List all B2B IT, software, MDM, cloud security, AI, and DevOps services",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Optional locale filter (es or en).",
            "schema": {
              "type": "string",
              "enum": [
                "es",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured JSON service catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/company": {
      "get": {
        "operationId": "getCompanyProfile",
        "summary": "Get company profile, contact channels, and discovery endpoints",
        "responses": {
          "200": {
            "description": "Structured JSON company metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/{path}": {
      "parameters": [
        {
          "name": "path",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "operationId": "unsupportedApiPath",
        "summary": "Unknown API route",
        "responses": {
          "404": {
            "description": "No API operation exists at this URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ServiceItem": {
        "type": "object",
        "required": [
          "slug",
          "lang",
          "title",
          "description",
          "details",
          "url"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "lang": {
            "type": "string",
            "enum": [
              "es",
              "en"
            ]
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "alternateSlug": {
            "type": "string"
          }
        }
      },
      "ServicesResponse": {
        "type": "object",
        "required": [
          "organization",
          "url",
          "documentation",
          "openapi",
          "llmsTxt"
        ],
        "properties": {
          "organization": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "llmsTxt": {
            "type": "string",
            "format": "uri"
          },
          "locale": {
            "type": "string"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceItem"
            }
          },
          "locales": {
            "type": "object",
            "properties": {
              "es": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ServiceItem"
                }
              },
              "en": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ServiceItem"
                }
              }
            }
          }
        }
      },
      "CompanyResponse": {
        "type": "object",
        "required": [
          "name",
          "url",
          "email",
          "locales",
          "authentication",
          "endpoints"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "region": {
            "type": "string"
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authentication": {
            "type": "string"
          },
          "endpoints": {
            "type": "object"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "hint"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
