{"openapi":"3.1.0","info":{"title":"IntelliPortal API","version":"1.0.0","description":"Omnichannel messaging API — send messages across WhatsApp, Instagram, Messenger, Email, SMS, and more through a single unified endpoint.","contact":{"email":"support@intelliportal.io"}},"servers":[{"url":"https://api.intelliportal.io/v1","description":"Production"},{"url":"https://sandbox.intelliportal.io/v1","description":"Sandbox"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key prefixed with ik_test_ or ik_live_"}},"schemas":{"SendMessageRequest":{"type":"object","required":["client_ref","to","type"],"properties":{"client_ref":{"type":"string","description":"Your internal client reference"},"to":{"type":"string","description":"Recipient phone number or identifier"},"type":{"type":"string","enum":["text","template","media"]},"text":{"type":"object","properties":{"body":{"type":"string"}}},"media":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"caption":{"type":"string"}}}}},"SendTemplateRequest":{"type":"object","required":["client_ref","to","template"],"properties":{"client_ref":{"type":"string"},"to":{"type":"string"},"template":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"language":{"type":"object","properties":{"code":{"type":"string","default":"en"}}},"parameters":{"type":"array","items":{"type":"string"}}}}}},"MessageResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sent","delivered","read","failed"]},"channel":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"ClientSignupRequest":{"type":"object","required":["business_name","phone_number_id"],"properties":{"business_name":{"type":"string"},"phone_number_id":{"type":"string"},"waba_id":{"type":"string"},"callback_url":{"type":"string","format":"uri"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"}}}}}}},"paths":{"/messages/send":{"post":{"operationId":"sendMessage","summary":"Send a message","description":"Send a text or media message to a recipient across any supported channel.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Message queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Invalid or missing API key"},"429":{"description":"Rate limit exceeded"}}}},"/messages/send-template":{"post":{"operationId":"sendTemplateMessage","summary":"Send a template message","description":"Send a pre-approved template message to a recipient.","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTemplateRequest"}}}},"responses":{"200":{"description":"Message queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Validation error"},"404":{"description":"Template not found"},"429":{"description":"Rate limit exceeded"}}}},"/clients/signup":{"post":{"operationId":"onboardClient","summary":"Onboard a new client","description":"Register a new client via the embedded signup flow.","tags":["Clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSignupRequest"}}}},"responses":{"201":{"description":"Client onboarded"},"400":{"description":"Validation error"},"409":{"description":"Client already exists"}}}},"/clients":{"get":{"operationId":"listClients","summary":"List clients","description":"Retrieve all onboarded clients for your partner account.","tags":["Clients"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":20}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"List of clients"}}}},"/webhooks":{"get":{"operationId":"getWebhookConfig","summary":"Get webhook configuration","tags":["Webhooks"],"responses":{"200":{"description":"Webhook configuration"}}},"put":{"operationId":"updateWebhookConfig","summary":"Update webhook configuration","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Webhook updated"},"400":{"description":"Invalid URL"}}}}}}