{
  "openapi": "3.0.3",
  "info": {
    "title": "Transmify API",
    "description": "Free, public, unauthenticated REST API that wraps the same conversion engine the web app uses. No API key, no rate limiting yet — see API.md in the repo for the honest limitations list.",
    "version": "0.1.0",
    "license": {
      "name": "See repository for license"
    }
  },
  "servers": [
    {
      "url": "https://transmify.dev",
      "description": "Production"
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "summary": "List all supported conversion endpoints",
        "operationId": "listEndpoints",
        "responses": {
          "200": {
            "description": "Live list of every registered conversion pair",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInfo"
                }
              }
            }
          }
        }
      }
    },
    "/api/convert/{from}-to-{to}": {
      "post": {
        "summary": "Convert data from one format to another",
        "operationId": "convert",
        "parameters": [
          {
            "name": "from",
            "in": "path",
            "required": true,
            "description": "Source format",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "tsv",
                "xml",
                "yaml",
                "excel",
                "sql",
                "string",
                "text",
                "base64",
                "markdown",
                "html",
                "toml",
                "jwt"
              ]
            }
          },
          {
            "name": "to",
            "in": "path",
            "required": true,
            "description": "Target format",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "tsv",
                "xml",
                "yaml",
                "excel",
                "sql",
                "string",
                "text",
                "base64",
                "markdown",
                "html",
                "toml",
                "jwt"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              },
              "example": "[{\"id\":1,\"name\":\"Ada\"},{\"id\":2,\"name\":\"Grace\"}]"
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConvertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Conversion succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Bad request (empty body, unreadable body, or unknown format name)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertError"
                }
              }
            }
          },
          "404": {
            "description": "No converter registered for that pair, or unknown route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertError"
                }
              }
            }
          },
          "422": {
            "description": "Conversion ran but the input didn't validate (e.g. malformed JSON/XML/YAML)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertError"
                }
              }
            }
          },
          "500": {
            "description": "The converter itself threw at runtime",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConvertError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ConvertRequest": {
        "type": "object",
        "properties": {
          "input": {
            "type": "string",
            "description": "The data to convert"
          },
          "pretty": {
            "type": "boolean",
            "description": "Pretty-print the output where applicable",
            "default": true
          }
        },
        "required": [
          "input"
        ]
      },
      "ConvertSuccess": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "example": true
          },
          "output": {
            "type": "string"
          },
          "binaryBase64": {
            "type": "boolean",
            "description": "Set when output is binary data (e.g. Excel) encoded as base64"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ConvertError": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string"
          },
          "line": {
            "type": "integer",
            "description": "Line number of the error, when known"
          }
        }
      },
      "ApiInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "free": {
            "type": "boolean"
          },
          "auth": {
            "type": "string"
          },
          "usage": {
            "type": "string"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "method": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "from": {
                  "type": "string"
                },
                "to": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}