OpenAPI Schema

Pull the complete API contract into your toolchain.

The published contract

The API publishes its full contract as an OpenAPI 3.0.3 document at GET /api/v1/openapi.json. It declares every endpoint — including all per-conversion routes — plus authentication, request bodies, and response schemas. Each conversion's input schema is published as a named component (e.g. HtmlToPdfInput), so clients can validate form fields and generate typed SDKs at build time.

Fetch the specbash
curl https://api.fileswitch.co/api/v1/openapi.json > openapi.json

Using the schema

  • Open the spec in Swagger Editor for an interactive, browsable reference.
  • Import the URL into Postman (File → Import → Link) to generate a collection with every endpoint preconfigured.
  • Import into Insomnia (Create → Import → URL) the same way.
  • Generate typed clients with openapi-generator or openapi-typescript from the same URL.

Conversion endpoint shape

A conversion endpoint is declared with a multipart/form-data request body: a required filefield plus the option properties from the conversion's input schema:

Excerpt of /api/v1/openapi.jsonjson
"/converter/html-to-pdf": {
  "post": {
    "operationId": "convertHtmlToPdf",
    "requestBody": {
      "content": {
        "multipart/form-data": {
          "schema": {
            "type": "object",
            "required": ["file"],
            "properties": {
              "file": { "type": "string", "format": "binary" },
              "pageSize": { "type": "string", "enum": ["A0", "A4", "Letter", "Legal", "Ledger"], "default": "A4" },
              "headerHtml": { "type": "string", "default": "" },
              "pageRange": { "type": "string", "default": "" }
            }
          }
        }
      }
    }
  }
}