{
  "openapi": "3.1.0",
  "info": {
    "title": "Oh my AI API & Machine Protocol",
    "version": "1.0.0",
    "description": "Production REST API endpoints and Model Context Protocol (MCP) integrations for Oh my AI B.V.",
    "contact": {
      "name": "Oh my AI Engineering Team",
      "email": "info@ohmyai.nl",
      "url": "https://ohmyai.nl"
    },
    "license": {
      "name": "Proprietary / Commercial"
    },
    "x-versioning": {
      "strategy": "URL path versioning (/v1) with semantic versioning",
      "currentVersion": "v1",
      "supportedVersions": ["v1"],
      "deprecationPolicy": "Endpoints are supported for a minimum of 12 months after formal deprecation notification via Deprecation (RFC 8594) and Sunset response headers."
    }
  },
  "servers": [
    {
      "url": "https://ohmyai.nl",
      "description": "Production Edge Server"
    },
    {
      "url": "https://ohmyai.nl/api/v1",
      "description": "Versioned v1 API Gateway"
    }
  ],
  "paths": {
    "/api/intake": {
      "get": {
        "summary": "Check Intake API Service Status and Schema",
        "description": "Returns operational status, versioning information, and guidance for automated agents.",
        "operationId": "getIntakeStatus",
        "responses": {
          "200": {
            "description": "Intake API status and capability metadata",
            "headers": {
              "RateLimit-Limit": { "description": "Max requests allowed per window", "schema": { "type": "integer", "example": 60 } },
              "RateLimit-Remaining": { "description": "Remaining requests allowed in window", "schema": { "type": "integer", "example": 59 } },
              "RateLimit-Reset": { "description": "Seconds until quota reset", "schema": { "type": "integer", "example": 60 } }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStatusResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit quota exceeded",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Submit consultation intake or automation scoping request",
        "description": "Programmatically submit project requirements, automation scoping requests, or consultation inquiries directly to Oh my AI engineering team.",
        "operationId": "submitIntakeInquiry",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Unique UUID or token to ensure idempotency across automated retry attempts",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntakeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry accepted successfully",
            "headers": {
              "RateLimit-Limit": {
                "description": "Max requests allowed per time window",
                "schema": { "type": "integer", "example": 60 }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed in window",
                "schema": { "type": "integer", "example": 59 }
              },
              "RateLimit-Reset": {
                "description": "Seconds until rate limit quota resets",
                "schema": { "type": "integer", "example": 60 }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload or missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "HTTP method not allowed (use POST)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit quota exceeded",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Upstream proxy or delivery gateway error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/intake": {
      "get": {
        "summary": "Check Intake API Service Status and Schema (v1)",
        "description": "Versioned v1 endpoint returning operational status, versioning information, and guidance for automated agents.",
        "operationId": "getIntakeStatusV1",
        "responses": {
          "200": {
            "description": "Intake API status and capability metadata",
            "headers": {
              "RateLimit-Limit": { "description": "Max requests allowed per window", "schema": { "type": "integer", "example": 60 } },
              "RateLimit-Remaining": { "description": "Remaining requests allowed in window", "schema": { "type": "integer", "example": 59 } },
              "RateLimit-Reset": { "description": "Seconds until quota reset", "schema": { "type": "integer", "example": 60 } }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStatusResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit quota exceeded",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Submit consultation intake or automation scoping request (v1)",
        "description": "Versioned v1 endpoint to programmatically submit project requirements, automation scoping requests, or consultation inquiries directly to Oh my AI engineering team.",
        "operationId": "submitIntakeInquiryV1",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Unique UUID or token to ensure idempotency across automated retry attempts",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntakeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry accepted successfully",
            "headers": {
              "RateLimit-Limit": {
                "description": "Max requests allowed per time window",
                "schema": { "type": "integer", "example": 60 }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed in window",
                "schema": { "type": "integer", "example": 59 }
              },
              "RateLimit-Reset": {
                "description": "Seconds until rate limit quota resets",
                "schema": { "type": "integer", "example": 60 }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload or missing required parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "HTTP method not allowed (use POST)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit quota exceeded",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Upstream proxy or delivery gateway error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/mcp": {
      "get": {
        "summary": "MCP Server Card Discovery",
        "description": "Retrieve the Model Context Protocol server-card discovery manifest as per SEP-1649.",
        "operationId": "getMcpServerCardDiscovery",
        "responses": {
          "200": {
            "description": "Discovery card with Streamable HTTP transport information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerCard"
                }
              }
            }
          },
          "404": {
            "description": "Manifest not found",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      },
      "post": {
        "summary": "MCP Streamable HTTP JSON-RPC Handshake",
        "description": "Execute JSON-RPC 2.0 MCP protocol requests including initialize, ping, tools/list, and tools/call.",
        "operationId": "postMcpHandshake",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON-RPC request",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "summary": "MCP Server Card Endpoint",
        "description": "Alternative endpoint for MCP server discovery manifest.",
        "operationId": "getMcpEndpointInfo",
        "responses": {
          "200": {
            "description": "MCP server discovery manifest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpServerCard"
                }
              }
            }
          },
          "404": {
            "description": "Manifest not found",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      },
      "post": {
        "summary": "MCP JSON-RPC Endpoint",
        "description": "Execute MCP tools (get_services, estimate_timeline, submit_inquiry) via JSON-RPC 2.0.",
        "operationId": "postMcpEndpoint",
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON-RPC request",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ProblemDetails" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiStatusResponse": {
        "type": "object",
        "required": ["status", "service", "version"],
        "properties": {
          "status": { "type": "string", "example": "operational" },
          "service": { "type": "string", "example": "Oh my AI Consultation Intake API" },
          "version": { "type": "string", "example": "1.0.0" },
          "endpoints": {
            "type": "object",
            "properties": {
              "submit": { "type": "string", "example": "POST /api/intake" },
              "docs": { "type": "string", "example": "https://ohmyai.nl/openapi.json" },
              "portal": { "type": "string", "example": "https://ohmyai.nl/developers" }
            }
          },
          "rateLimit": {
            "type": "object",
            "properties": {
              "limit": { "type": "integer", "example": 60 },
              "window": { "type": "string", "example": "60s" }
            }
          }
        }
      },
      "IntakeRequest": {
        "type": "object",
        "required": ["process", "email", "name"],
        "properties": {
          "name": {
            "type": "string",
            "description": "Contact person name",
            "example": "Jan de Vries"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Business email address",
            "example": "jan@example.nl"
          },
          "company": {
            "type": "string",
            "description": "Company or organisation name",
            "example": "Enterprise BV"
          },
          "type": {
            "type": ["string", "integer"],
            "description": "Type of AI system: 0 (agent), 1 (gpt), 2 (automation), 3 (integration)",
            "example": "agent"
          },
          "process": {
            "type": "string",
            "description": "Detailed description of the manual or repetitive workflow to automate",
            "example": "Automate processing customer inquiries from inbox into CRM ticket"
          },
          "timing": {
            "type": "string",
            "description": "Target start timeframe",
            "example": "As soon as possible"
          },
          "consent": {
            "type": "boolean",
            "description": "Consent to privacy policy for inquiry processing",
            "default": true
          }
        }
      },
      "IntakeResponse": {
        "type": "object",
        "required": ["success", "message"],
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "message": {
            "type": "string",
            "example": "Inquiry submitted successfully with device and geo telemetry"
          },
          "data": {
            "type": "object",
            "description": "Downstream submission acknowledgement"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "example": "BAD_REQUEST"
              },
              "message": {
                "type": "string",
                "example": "Missing required field: email"
              },
              "hint": {
                "type": "string",
                "example": "Provide a valid business email address"
              }
            }
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "description": "RFC 9457 Problem Details for HTTP APIs",
        "required": ["type", "title", "status"],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "example": "https://ohmyai.nl/errors/bad-request"
          },
          "title": {
            "type": "string",
            "example": "Bad Request"
          },
          "status": {
            "type": "integer",
            "example": 400
          },
          "detail": {
            "type": "string",
            "example": "Invalid request body or parameters"
          },
          "instance": {
            "type": "string",
            "example": "/api/intake"
          }
        }
      },
      "McpServerCard": {
        "type": "object",
        "properties": {
          "mcpVersion": { "type": "string", "example": "2024-11-05" },
          "serverInfo": {
            "type": "object",
            "properties": {
              "name": { "type": "string", "example": "oh-my-ai" },
              "version": { "type": "string", "example": "1.0.0" },
              "description": { "type": "string" }
            }
          },
          "transport": {
            "type": "object",
            "properties": {
              "type": { "type": "string", "example": "streamable-http" },
              "endpoint": { "type": "string", "example": "/api/mcp" }
            }
          }
        }
      },
      "JsonRpcRequest": {
        "type": "object",
        "required": ["jsonrpc", "method", "id"],
        "properties": {
          "jsonrpc": { "type": "string", "enum": ["2.0"] },
          "id": { "type": ["string", "number"] },
          "method": { "type": "string", "example": "initialize" },
          "params": { "type": "object" }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": ["jsonrpc", "id"],
        "properties": {
          "jsonrpc": { "type": "string", "enum": ["2.0"] },
          "id": { "type": ["string", "number"] },
          "result": { "type": "object" },
          "error": { "type": "object" }
        }
      }
    }
  }
}
