{
  "openapi": "3.1.0",
  "info": {
    "title": "Ministerstwo IT API",
    "description": "API for accessing Ministerstwo IT services, case studies, and consultation requests. Professional managed IT services - Linux administration, cloud infrastructure (AWS/GCP), security, and High Availability solutions.",
    "version": "1.0.0",
    "contact": {
      "name": "Ministerstwo IT",
      "email": "hello@ministerstwo.it",
      "url": "https://ministerstwo.it"
    }
  },
  "servers": [
    {
      "url": "https://ministerstwo.it/api",
      "description": "Production API"
    }
  ],
  "paths": {
    "/services": {
      "get": {
        "operationId": "listServices",
        "summary": "List available IT services",
        "description": "Returns a list of all managed IT services offered by Ministerstwo IT, including system administration, security, cloud, networking, and DevOps.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "description": "Filter services by category",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["administration", "security", "cloud", "network", "devops", "all"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of services",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "services": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Service"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "headers": {
              "Retry-After": {
                "schema": { "type": "integer" },
                "description": "Seconds to wait before retrying"
              },
              "X-RateLimit-Limit": {
                "schema": { "type": "integer" },
                "description": "Maximum requests per minute"
              }
            }
          }
        }
      }
    },
    "/case-studies": {
      "get": {
        "operationId": "listCaseStudies",
        "summary": "List case studies",
        "description": "Returns detailed case studies demonstrating Ministerstwo IT expertise across e-commerce, fintech, legal, NGO, media, and software development sectors.",
        "parameters": [
          {
            "name": "sector",
            "in": "query",
            "description": "Filter by industry sector",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["ecommerce", "fintech", "legal", "ngo", "media", "software", "all"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of case studies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "caseStudies": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CaseStudy"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/consultation": {
      "post": {
        "operationId": "requestConsultation",
        "summary": "Request a free consultation",
        "description": "Submit a request for a free initial IT infrastructure consultation. Ministerstwo IT will respond within 1 business day.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsultationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Consultation request submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsultationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Get pricing information",
        "description": "Returns available service tiers and pricing structure for Ministerstwo IT managed services.",
        "responses": {
          "200": {
            "description": "Pricing information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricing"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Service": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string" },
          "description": { "type": "string" },
          "technologies": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["id", "name", "description"]
      },
      "CaseStudy": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "client": { "type": "string" },
          "sector": { "type": "string" },
          "challenge": { "type": "string" },
          "solution": { "type": "string" },
          "result": { "type": "string" },
          "technologies": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["id", "client", "challenge", "result"]
      },
      "ConsultationRequest": {
        "type": "object",
        "properties": {
          "name": { "type": "string", "description": "Contact person name" },
          "email": { "type": "string", "format": "email", "description": "Contact email" },
          "company": { "type": "string", "description": "Company name" },
          "topic": { "type": "string", "description": "Brief description of IT needs" },
          "urgency": {
            "type": "string",
            "enum": ["low", "medium", "high", "emergency"],
            "description": "How urgent is the request"
          }
        },
        "required": ["email", "topic"]
      },
      "ConsultationResponse": {
        "type": "object",
        "properties": {
          "requestId": { "type": "string" },
          "status": { "type": "string" },
          "message": { "type": "string" },
          "estimatedResponse": { "type": "string", "description": "Expected response time" }
        }
      },
      "Pricing": {
        "type": "object",
        "properties": {
          "tiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "description": { "type": "string" },
                "features": {
                  "type": "array",
                  "items": { "type": "string" }
                }
              }
            }
          },
          "freeConsultation": { "type": "boolean" },
          "contactEmail": { "type": "string" }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": { "type": "string" },
          "message": { "type": "string" },
          "code": { "type": "integer" }
        },
        "required": ["error", "message", "code"]
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key for authenticated access. Contact hello@ministerstwo.it to obtain credentials."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth 2.0 authentication for agent access",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://ministerstwo.it/oauth/token",
            "scopes": {
              "read:services": "Read service listings",
              "read:case-studies": "Read case studies",
              "read:pricing": "Read pricing information",
              "write:consultation": "Submit consultation requests"
            }
          }
        }
      }
    }
  },
  "security": [
    { "apiKey": [] },
    { "oauth2": ["read:services"] }
  ]
}
