{"openapi":"3.1.0","info":{"title":"VPSLY Mail API","version":"1.0.0","description":"Use a domain-scoped VPSLY Mail API key to list mailboxes, read messages, download attachments and send or reply to email."},"servers":[{"url":"\/api","description":"Current VPSLY panel"}],"security":[{"bearerAuth":[]}],"paths":{"\/mail\/v1\/mailboxes":{"get":{"summary":"List mailboxes available to this Mail API key","description":"A mailbox-scoped key returns one mailbox. A domain-wide key returns every active mailbox in its domain.","responses":{"200":{"description":"Available mailboxes"},"401":{"description":"Invalid or expired Mail API key"}}}},"\/mail\/v1\/folders":{"get":{"summary":"List IMAP folders for a mailbox","parameters":[{"in":"query","name":"mailbox_id","schema":{"type":"integer"}}],"responses":{"200":{"description":"Mail folders and message counts"},"422":{"description":"mailbox_id is required for a multi-mailbox domain key"}}}},"\/mail\/v1\/messages":{"get":{"summary":"Retrieve messages from a mailbox folder","parameters":[{"in":"query","name":"mailbox_id","schema":{"type":"integer"}},{"in":"query","name":"folder","schema":{"type":"string","default":"INBOX"}},{"in":"query","name":"page","schema":{"type":"integer","minimum":1}},{"in":"query","name":"search","schema":{"type":"string","maxLength":120}},{"in":"query","name":"sort","schema":{"type":"string","enum":["date_desc","date_asc"]}},{"in":"query","name":"filter","schema":{"type":"string","enum":["all","unread","read","flagged"]}},{"in":"query","name":"per_page","schema":{"type":"integer","enum":[10,25,50,100]}}],"responses":{"200":{"description":"Paginated message summaries"},"403":{"description":"This key does not grant mail:read"}}}},"\/mail\/v1\/messages\/{uid}":{"parameters":[{"in":"path","name":"uid","required":true,"schema":{"type":"integer"}}],"get":{"summary":"Read one message including text, HTML, headers and attachment metadata","parameters":[{"in":"query","name":"mailbox_id","schema":{"type":"integer"}},{"in":"query","name":"folder","schema":{"type":"string","default":"INBOX"}},{"in":"query","name":"mark_read","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Complete message content"}}}},"\/mail\/v1\/messages\/{uid}\/attachments\/{index}":{"parameters":[{"in":"path","name":"uid","required":true,"schema":{"type":"integer"}},{"in":"path","name":"index","required":true,"schema":{"type":"integer"}},{"in":"query","name":"mailbox_id","schema":{"type":"integer"}},{"in":"query","name":"folder","schema":{"type":"string","default":"INBOX"}}],"get":{"summary":"Download a message attachment","responses":{"200":{"description":"Attachment binary"}}}},"\/mail\/v1\/messages\/send":{"post":{"summary":"Send a message or reply through a scoped mailbox","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["to","subject","body"],"properties":{"mailbox_id":{"type":"integer"},"to":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","format":"email"}},"cc":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}},"bcc":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}},"subject":{"type":"string","maxLength":255},"body":{"type":"string","maxLength":500000,"description":"HTML message body"},"reply_to_message_id":{"type":"string","maxLength":998},"include_signature":{"type":"boolean","default":true}}}}}},"responses":{"202":{"description":"Message accepted for SMTP delivery"},"403":{"description":"This key does not grant mail:send"},"503":{"description":"The mail submission service is unavailable"}}}},"\/agent\/mail\/{token}\/mcp":{"parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"The secret agent token generated in a domain's Agents tab. Never publish this URL."}],"post":{"summary":"MCP Streamable HTTP endpoint for email agents","description":"JSON-RPC 2.0 endpoint exposing list_mailboxes, list_messages, read_message and send_message tools.","security":[],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"nullable":true},"method":{"type":"string","example":"tools\/list"},"params":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"JSON-RPC MCP response"},"202":{"description":"MCP notification accepted"},"401":{"description":"Agent URL is invalid, expired or revoked"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"parameters":{"WebsiteId":{"in":"path","name":"website","required":true,"schema":{"type":"integer"}},"FirewallRuleId":{"in":"path","name":"rule","required":true,"schema":{"type":"integer"}},"MalwareScanId":{"in":"path","name":"scan","required":true,"schema":{"type":"integer"}},"MalwareFindingId":{"in":"path","name":"finding","required":true,"schema":{"type":"integer"}},"DomainId":{"in":"path","name":"domain","required":true,"schema":{"type":"integer"}},"RecordId":{"in":"path","name":"record","required":true,"schema":{"type":"integer"}},"MailboxId":{"in":"path","name":"mailbox","required":true,"schema":{"type":"integer"}}},"schemas":{"WebsiteInput":{"type":"object","required":["domain_id","name"],"properties":{"domain_id":{"type":"integer"},"name":{"type":"string","maxLength":100},"application_type":{"type":"string","enum":["static","php","laravel","wordpress","node","docker"]},"runtime":{"type":"string","enum":["static","php","node"]},"php_version":{"type":"string","enum":["8.3","8.4","8.5","8.6"]},"document_root":{"type":"string","default":"public"},"node_start_command":{"type":"string","default":"npm start"},"php_settings":{"type":"object","additionalProperties":true},"wordpress_plugins":{"type":"array","maxItems":20,"description":"WordPress.org plugin slugs installed and activated immediately after core WordPress setup.","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"}},"wordpress_migration":{"type":"object","description":"Import a complete existing WordPress site. Credentials are used only for the migration and are not returned by the API.","required":["source_url","admin_username","admin_password"],"properties":{"source_url":{"type":"string","format":"uri","maxLength":2048,"example":"https:\/\/old-website.example"},"admin_username":{"type":"string","maxLength":100},"admin_password":{"type":"string","format":"password","maxLength":255}}},"wordpress_theme":{"type":"object","description":"Installed and activated after fresh WordPress core setup.","required":["type"],"properties":{"type":{"type":"string","enum":["library","custom"]},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,99}$"},"upload_token":{"type":"string","pattern":"^[a-z0-9]{48}$"}}},"github_deployment":{"type":"object","description":"Optionally configure and immediately deploy a GitHub branch after the website is created.","required":["repository","branch"],"properties":{"repository":{"type":"string","example":"owner\/repository"},"branch":{"type":"string","example":"main"},"token":{"type":"string","format":"password","nullable":true},"auto_deploy":{"type":"boolean","default":false},"document_root":{"type":"string","example":"public"},"docker_internal_port":{"type":"integer","minimum":1,"maximum":65535},"post_deploy_steps":{"type":"array","maxItems":5,"items":{"type":"string","enum":["composer_install","artisan_migrate","npm_install","npm_build","node_restart"]}}}},"git_deployment":{"type":"object","description":"Clone a public HTTP(S) Git repository and detect the application type, document root and required dependency steps from the checkout. This does not require a connected GitHub account.","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"example":"https:\/\/github.com\/owner\/repository.git","description":"Public clone URL without embedded credentials."},"branch":{"type":"string","maxLength":100,"example":"main","description":"Optional branch. The remote default branch is used when omitted."}}},"aliases":{"type":"array","maxItems":10,"items":{"type":"string"}},"ssl_enabled":{"type":"boolean","default":true}}},"MailApiKeyInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100,"example":"Application mail sender"},"mailbox_id":{"type":"integer","nullable":true,"description":"Restrict the key to one mailbox. Omit to allow every active mailbox in the domain."},"abilities":{"type":"array","minItems":1,"items":{"type":"string","enum":["mail:read","mail:send"]}},"expires_in_days":{"type":"integer","minimum":1,"maximum":3650,"nullable":true}}},"MailAgentInput":{"allOf":[{"$ref":"#\/components\/schemas\/MailApiKeyInput"},{"type":"object","required":["provider"],"properties":{"provider":{"type":"string","enum":["chatgpt","claude","deepseek","custom"]},"instructions":{"type":"string","maxLength":2000}}}]},"WebsiteAnalytics":{"type":"object","required":["days","from","summary","daily","countries","cities","pages","pages_meta","referrers","devices","browsers","recent","recent_meta","geoip_ready","attribution"],"properties":{"days":{"type":"integer","minimum":1,"maximum":365},"from":{"type":"string","format":"date-time"},"summary":{"type":"object","required":["pageviews","visitors","bandwidth","blocked"],"properties":{"pageviews":{"type":"integer"},"visitors":{"type":"integer","description":"Unique keyed visitor hashes"},"bandwidth":{"type":"integer","description":"Response bytes"},"blocked":{"type":"integer","description":"Requests returning HTTP 403"}}},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string","format":"date"},"pageviews":{"type":"integer"},"visitors":{"type":"integer"}}}},"countries":{"type":"array","items":{"type":"object","properties":{"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"visits":{"type":"integer"}}}},"cities":{"type":"array","items":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"visits":{"type":"integer"}}}},"pages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"visits":{"type":"integer"}}}},"pages_meta":{"type":"object","required":["current_page","last_page","per_page","total","filter"],"properties":{"current_page":{"type":"integer"},"last_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"filter":{"type":"string","enum":["all","pages","files"]}}},"referrers":{"type":"array","items":{"type":"object","properties":{"referrer":{"type":"string"},"visits":{"type":"integer"}}}},"devices":{"type":"array","items":{"type":"object","properties":{"device_type":{"type":"string","nullable":true},"visits":{"type":"integer"}}}},"browsers":{"type":"array","items":{"type":"object","properties":{"browser":{"type":"string","nullable":true},"visits":{"type":"integer"}}}},"recent":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"integer"},"ip_address":{"type":"string"},"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"region":{"type":"string","nullable":true},"path":{"type":"string"},"status":{"type":"integer"},"device_type":{"type":"string","nullable":true},"browser":{"type":"string","nullable":true},"operating_system":{"type":"string","nullable":true},"visited_at":{"type":"string","format":"date-time"}}}},"recent_meta":{"type":"object","required":["current_page","last_page","per_page","total","sort","direction","search"],"properties":{"current_page":{"type":"integer"},"last_page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"sort":{"type":"string","enum":["visited_at","ip_address","path","status"]},"direction":{"type":"string","enum":["asc","desc"]},"search":{"type":"string"}}},"geoip_ready":{"type":"boolean"},"attribution":{"type":"string","example":"IP geolocation by DB-IP (CC BY 4.0)"}}},"FirewallRuleInput":{"type":"object","required":["type","value"],"properties":{"type":{"type":"string","enum":["ip","cidr","country"]},"value":{"type":"string","maxLength":100,"description":"IPv4\/IPv6 address, CIDR range, or two-letter ISO country code, depending on type.","examples":["192.0.2.44","203.0.113.0\/24","2001:db8::\/32","NL"]},"label":{"type":"string","maxLength":255,"nullable":true}}},"FirewallRule":{"type":"object","required":["id","type","value","active"],"properties":{"id":{"type":"integer"},"type":{"type":"string","enum":["ip","cidr","country"]},"value":{"type":"string"},"label":{"type":"string","nullable":true},"active":{"type":"boolean"},"created_by":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"FirewallBlockedRequest":{"type":"object","required":["ip_address","path","visited_at"],"properties":{"ip_address":{"type":"string"},"country_code":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"path":{"type":"string"},"visited_at":{"type":"string","format":"date-time"}}},"MonitorInput":{"type":"object","required":["website_id","alert_email"],"properties":{"website_id":{"type":"integer"},"alert_email":{"type":"string","format":"email"},"path":{"type":"string","default":"\/"},"interval_minutes":{"type":"integer","enum":[1,5,10,15,30,60],"default":5},"alert_after_failures":{"type":"integer","minimum":1,"maximum":10,"default":2},"enabled":{"type":"boolean","default":true},"public_visible":{"type":"boolean","default":true}}},"DnsRecordInput":{"type":"object","required":["type","host","value"],"properties":{"type":{"type":"string","enum":["A","AAAA","CAA","CNAME","MX","NS","SRV","TXT"]},"host":{"type":"string"},"value":{"type":"string"},"priority":{"type":"integer","nullable":true},"ttl":{"type":"integer","minimum":60,"maximum":604800},"description":{"type":"string","nullable":true}}},"MailboxInput":{"type":"object","required":["domain_id","local_part","display_name","password","quota_mb"],"properties":{"domain_id":{"type":"integer"},"local_part":{"type":"string"},"display_name":{"type":"string"},"password":{"type":"string","minLength":10},"quota_mb":{"type":"integer","minimum":100,"maximum":102400}}},"AliasInput":{"type":"object","required":["domain_id","source","destination"],"properties":{"domain_id":{"type":"integer"},"source":{"type":"string"},"destination":{"type":"string","format":"email"},"description":{"type":"string","nullable":true}}}}},"x-vpsly-access-scope":"mail","x-vpsly-public-docs":true,"x-vpsly-live-testing":false}