{
  "openapi": "3.1.0",
  "info": {
    "title": "base64app HTTP API",
    "version": "1.2.0",
    "description": "Decode, repair, detect file types, and encode base64 over simple JSON HTTP endpoints.\n\nPrivacy: POST request bodies are sent to the server and processed in memory. Payloads are not stored in a database. The base64app website (base64app.com) runs entirely in the browser and does not upload user input. This API is for scripts and integrations that accept server-side processing. Full details: https://base64app.com/api/\n\nInteractive docs: https://base64app.com/api/swagger/\n\nThe base64app website never uploads what you paste into the decoder or encoder — processing stays in your browser. The HTTP API is different by design: when you POST to /api/analyze, /api/encode, and similar routes, the JSON body (your base64 string or text) is sent to api.base64app.com, processed on our server, and returned in the response. We do not store payloads in a database or use them for analytics. Each request is handled statelessly. Do not send secrets through the API unless you accept HTTPS transit and server-side processing. For maximum privacy, use the free web tool or run the same logic locally.",
    "contact": {
      "name": "base64app",
      "url": "https://base64app.com"
    }
  },
  "servers": [
    {
      "url": "https://api.base64app.com"
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    },
                    "version": {
                      "type": "string"
                    },
                    "changelog": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/decode": {
      "post": {
        "summary": "Decode base64 (alias of /api/analyze)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "Base64 string or data URI"
                  },
                  "autoRepair": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decode result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/analyze": {
      "post": {
        "summary": "Decode, repair, and detect file type",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "Base64 string or data URI"
                  },
                  "autoRepair": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decode result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/detect": {
      "post": {
        "summary": "Detect file type from base64",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "Base64 string or data URI"
                  },
                  "autoRepair": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Detection result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/to-file": {
      "post": {
        "summary": "Decode and return file download metadata",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "Base64 string or data URI"
                  },
                  "autoRepair": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decode result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/repair": {
      "post": {
        "summary": "Repair base64 without full type detection",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "Base64 string or data URI"
                  },
                  "autoRepair": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Repair result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/encode": {
      "post": {
        "summary": "Encode UTF-8 text or wrap existing base64",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string",
                    "description": "Raw base64 payload"
                  },
                  "mime": {
                    "type": "string",
                    "default": "text/plain"
                  },
                  "dataUri": {
                    "type": "boolean",
                    "default": false
                  },
                  "urlSafe": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Encoded output",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-max-body-bytes": 50331648
}