{"openapi":"3.0.3","info":{"title":"JSGlobtech Lead Capture API","description":"OpenAPI actions for AI hosts (ChatGPT Custom GPTs / Actions, Claude webhooks, Gemini tooling) mirroring the MCP tool `request_dev_consultation`. Use this to request a development consultation from JSGlobtech — a Dubai, UAE agency for Flutter mobile apps, React/Next.js web platforms, and GEO/AI MCP integrations. Before calling, ask the user for any missing required fields. Do not invent contact details. Field mapping for assistants: name → client_name; email or phone → client_email_or_phone; service_requested / requested_service → project_type; source_platform → optional origin channel; server timestamp → received_at on success. Checklist aliases (name, email, phone, service_requested, source_platform) are accepted alongside live fields.","version":"1.0.0","contact":{"name":"JSGlobtech","url":"https://jsglobtech.com","email":"getintouch@jsglobtech.com"}},"servers":[{"url":"https://jsglobtech.com","description":"Production"}],"tags":[{"name":"Leads","description":"Consultation lead capture for Dubai/UAE development projects (MCP tool: request_dev_consultation)"}],"paths":{"/api/leads/submit":{"post":{"operationId":"submitDevConsultationLead","summary":"Request a JSGlobtech development consultation","description":"Submit a lead to notify the JSGlobtech technical team on WhatsApp/Email. Mirrors MCP tool `request_dev_consultation`. Collect client_name (name) and client_email_or_phone (email or phone) first. Map requested_service to project_type. If project_type or budget is unclear, ask a clarifying question before invoking. Mobile apps typically start near $10,000 USD (36,700 AED); web apps near $5,000 USD (18,300 AED).","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultationLeadRequest"},"examples":{"flutterMobile":{"summary":"Flutter mobile app lead","value":{"client_name":"Aisha Al Maktoum","client_email_or_phone":"+971501234567","project_type":"flutter_mobile_app","budget_range_usd":15000,"requirements_notes":"Consumer marketplace app for Dubai Marina retailers; iOS + Android; Arabic/English."}},"webApplication":{"summary":"Next.js web platform lead","value":{"client_name":"Omar Hassan","client_email_or_phone":"omar@example.ae","project_type":"web_application","budget_range_usd":"5000-12000","requirements_notes":"Authenticated SaaS dashboard with UAE enterprise SSO."}},"geoMcp":{"summary":"GEO / MCP integration lead","value":{"client_name":"Sara Khan","client_email_or_phone":"sara@clinic.ae","project_type":"geo_ai_integration","budget_range_usd":"Not sure yet","requirements_notes":"Need llms.txt + MCP lead capture for a Dubai clinic."}}}}}},"responses":{"200":{"description":"Lead captured and CRM/WhatsApp webhook notified (or logged when CRM_WEBHOOK_URL is unset). `received_at` is the server timestamp.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultationLeadSuccess"}}}},"400":{"description":"Validation failed. Ask the user to correct or provide missing fields, then retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadError"}}}},"401":{"description":"Missing X-API-Key when tenant API keys are required (LEADS_REQUIRE_API_KEY or CLIENT_API_KEY_*).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadError"}}}},"403":{"description":"X-API-Key present but does not match the resolved client_id / CLIENT_API_KEY mapping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadError"}}}},"429":{"description":"Rate limit exceeded (10 requests per minute per IP). Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadError"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadError"}}}},"502":{"description":"Lead validated but upstream CRM webhook failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadError"}}}}}}}},"components":{"schemas":{"ProjectType":{"type":"string","title":"Requested service","description":"Primary engagement / requested_service category. Choose flutter_mobile_app for iOS/Android Flutter work, web_application for React/Next.js platforms, and geo_ai_integration for GEO, MCP, or agentic AI work.","enum":["flutter_mobile_app","web_application","geo_ai_integration"]},"ConsultationLeadRequest":{"type":"object","title":"Consultation lead (request_dev_consultation)","additionalProperties":false,"required":["client_name","client_email_or_phone","project_type","budget_range_usd"],"properties":{"client_id":{"type":"string","title":"Client ID","description":"Optional client or tenant identifier for multi-tenant lead routing (defaults to 'default').","example":"client_dubai_retail"},"client_name":{"type":"string","minLength":2,"title":"Name","description":"Full name of the prospective client or decision-maker (maps from 'name'). Ask the user for this if missing. Do not invent a name.","example":"Aisha Al Maktoum"},"client_email_or_phone":{"type":"string","minLength":5,"title":"Email or phone","description":"Best follow-up channel: a valid email address OR a phone/WhatsApp number (maps from 'email' or 'phone'). For UAE contacts prefer E.164 with +971. Ask which channel they prefer if unclear. Never fabricate contact details.","example":"+971501234567"},"project_type":{"$ref":"#/components/schemas/ProjectType"},"budget_range_usd":{"title":"Budget (USD)","description":"Budget in USD as a number (e.g. 15000) or a short range/label string (e.g. '10000-25000' or 'Not sure yet'). If the user has not shared budget, ask once before calling. Reference starting prices: mobile from $10,000 / 36,700 AED; web from $5,000 / 18,300 AED.","oneOf":[{"type":"number","exclusiveMinimum":0,"example":15000},{"type":"string","minLength":1,"example":"10000-25000"}]},"requirements_notes":{"type":"string","maxLength":5000,"title":"Requirements notes","description":"Optional but recommended: goals, target platforms, timeline, DHA/DED or enterprise compliance needs, integrations, and success criteria. Ask a brief clarifying question if the user only said 'I need an app'.","example":"Need Flutter MVP in 12 weeks for Dubai Marina retail loyalty."},"name":{"type":"string","minLength":2,"title":"Name (alias)","description":"Checklist alias for client_name.","example":"Aisha Al Maktoum"},"email":{"type":"string","format":"email","title":"Email (alias)","description":"Checklist alias contributing to client_email_or_phone.","example":"aisha@example.ae"},"phone":{"type":"string","title":"Phone (alias)","description":"Checklist alias contributing to client_email_or_phone.","example":"+971501234567"},"service_requested":{"type":"string","title":"Service requested (alias)","description":"Checklist alias for project_type.","enum":["flutter_mobile_app","web_application","geo_ai_integration"]},"source_platform":{"type":"string","maxLength":100,"title":"Source platform","description":"Originating AI host or channel (e.g. chatgpt_actions, claude, mcp). Optional; server also stamps source.","example":"chatgpt_actions"}}},"ConsultationLeadSuccess":{"type":"object","required":["ok","lead_id","message","received_at"],"properties":{"ok":{"type":"boolean","description":"True when the lead was accepted.","example":true},"lead_id":{"type":"string","description":"Server-generated lead identifier for follow-up reference.","example":"jsg-8f3c2a1b-4d5e-6789-abcd-ef0123456789"},"message":{"type":"string","description":"Human-readable confirmation to show the user.","example":"Success! JSGlobtech technical team notified. We will reach out on WhatsApp/Email within 1 hour."},"project_type":{"$ref":"#/components/schemas/ProjectType"},"received_at":{"type":"string","format":"date-time","title":"Timestamp","description":"ISO-8601 timestamp when the lead was recorded on the server (do not send this on request — it is generated server-side).","example":"2026-07-30T12:00:00.000Z"}}},"LeadError":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","description":"Machine-readable error code such as validation_error, rate_limit_exceeded, unauthorized, forbidden, webhook_error, or invalid_json."},"message":{"type":"string","description":"Explanation the assistant can relay while asking the user to fix missing or invalid fields."},"issues":{"type":"array","description":"Field-level validation issues when error is validation_error.","items":{"type":"object","properties":{"path":{"type":"string","description":"Dot-path of the invalid field."},"message":{"type":"string","description":"Validation message for that field."}}}}}}}}}