{"openapi":"3.1.0","info":{"title":"ASCII Art Converter API","description":"Convert images to ASCII art, manage webhooks, and interact via MCP. Part of the PlatPhorm News network (ascii.platphormnews.com). 130+ sites, MCP-powered, AI-ready. Central MCP Hub at mcp.platphormnews.com.","version":"2.1.0","contact":{"name":"Michael Barbine","email":"Michael@Barbineworldwide.com","url":"https://github.com/mbarbine"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://ascii.platphormnews.com","description":"Production"}],"tags":[{"name":"conversion","description":"Image to ASCII conversion"},{"name":"health","description":"Service health monitoring"},{"name":"mcp","description":"Model Context Protocol tools"},{"name":"webhooks","description":"Webhook management"},{"name":"docs","description":"API documentation"}],"paths":{"/api/convert":{"post":{"operationId":"convertImage","tags":["conversion"],"summary":"Convert image to ASCII art","description":"Accepts a base64-encoded image and returns ASCII art text with configurable options.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","description":"Base64-encoded image data (with or without data URI prefix)"},"resolution":{"type":"number","minimum":0.05,"maximum":0.3,"default":0.11,"description":"Scale factor for image resolution"},"charset":{"type":"string","enum":["standard","detailed","blocks","minimal","binary","matrix"],"default":"standard","description":"Character set for ASCII output"},"grayscale":{"type":"boolean","default":true,"description":"Whether to use grayscale mode"},"inverted":{"type":"boolean","default":false,"description":"Whether to invert brightness"}}}}}},"responses":{"200":{"description":"Successfully converted image","content":{"application/json":{"schema":{"type":"object","properties":{"ascii":{"type":"string","description":"ASCII art text output"},"width":{"type":"integer"},"height":{"type":"integer"},"charset":{"type":"string"},"resolution":{"type":"number"}}}}}},"400":{"description":"Bad request (missing image or invalid params)"},"500":{"description":"Server error"}}}},"/api/health":{"get":{"operationId":"getHealth","tags":["health"],"summary":"Health check","description":"Returns service status, version, uptime, and dependency health.","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"service":{"type":"string"},"version":{"type":"string"},"uptime_ms":{"type":"integer"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/api/webhooks":{"get":{"operationId":"listWebhooks","tags":["webhooks"],"summary":"List registered webhooks","description":"Returns all registered webhooks and available event types.","parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string"},"description":"Optional webhook ID to get a specific webhook"}],"responses":{"200":{"description":"List of webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"lastTriggered":{"type":"string","format":"date-time","nullable":true},"failureCount":{"type":"integer"}}}},"total":{"type":"integer"},"available_events":{"type":"array","items":{"type":"string"}}}}}}}}},"post":{"operationId":"registerWebhook","tags":["webhooks"],"summary":"Register a webhook","description":"Register a URL to receive HTTP POST notifications for specified events. Supports HMAC-SHA256 signature verification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"HTTPS URL to receive webhook payloads"},"events":{"type":"array","items":{"type":"string","enum":["conversion.started","conversion.completed","conversion.failed","health.degraded","health.restored"]},"description":"Events to subscribe to (defaults to all)"},"secret":{"type":"string","description":"Shared secret for HMAC-SHA256 signature verification"}}}}}},"responses":{"201":{"description":"Webhook registered successfully"},"400":{"description":"Invalid URL or event type"},"429":{"description":"Maximum webhook limit reached"}}},"delete":{"operationId":"deleteWebhook","tags":["webhooks"],"summary":"Delete a webhook","description":"Remove a registered webhook by ID.","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"Webhook ID to delete"}],"responses":{"200":{"description":"Webhook deleted"},"404":{"description":"Webhook not found"}}}},"/api/mcp":{"get":{"operationId":"listMcpTools","tags":["mcp"],"summary":"List MCP tools","description":"Returns the MCP tool manifest with inputSchema for each tool. Protocol version 2025-03-26.","responses":{"200":{"description":"MCP tool list with input schemas"}}},"post":{"operationId":"callMcpTool","tags":["mcp"],"summary":"Call an MCP tool","description":"JSON-RPC 2.0 style MCP tool invocation. Supports initialize, tools/list, and tools/call methods.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["method"],"properties":{"jsonrpc":{"type":"string","default":"2.0"},"id":{"type":["string","number","null"]},"method":{"type":"string","enum":["initialize","tools/list","tools/call"],"description":"JSON-RPC method"},"params":{"type":"object","properties":{"name":{"type":"string","description":"Tool name (for tools/call)","enum":["convert_image","get_health","get_info","list_charsets","subscribe_webhook","list_webhooks","save_as_png"]},"arguments":{"type":"object","description":"Tool arguments (for tools/call)"}}}}}}}},"responses":{"200":{"description":"JSON-RPC result"},"204":{"description":"Notification acknowledged"},"404":{"description":"Tool or method not found"}}}},"/api/docs":{"get":{"operationId":"getDocs","tags":["docs"],"summary":"API Documentation","description":"Returns this OpenAPI 3.1.0 specification.","responses":{"200":{"description":"OpenAPI spec"}}}}},"webhooks":{"conversionEvent":{"post":{"summary":"Conversion event notification","description":"Sent to registered webhook URLs when a conversion event occurs. Includes HMAC-SHA256 signature if secret is configured.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["conversion.started","conversion.completed","conversion.failed","health.degraded","health.restored"]},"timestamp":{"type":"string","format":"date-time"},"webhook_id":{"type":"string"},"payload":{"type":"object"}}}}}},"responses":{"200":{"description":"Webhook accepted"}}}}},"externalDocs":{"description":"PlatPhorm News Network — Central MCP Hub","url":"https://mcp.platphormnews.com/api/docs"},"x-mcp-hub":{"url":"https://mcp.platphormnews.com","docs":"https://mcp.platphormnews.com/api/docs","register":"https://mcp.platphormnews.com/api/register","description":"Central MCP registry for the PlatPhorm News network"}}