{
  "openapi": "3.1.0",
  "info": {
    "title": "Metadata Cleaner API (DOCX and PDF)",
    "version": "1.0.0",
    "description": "Remove metadata, comments, tracked changes, hidden text, custom XML, PDF Info, XMP, annotations, attachments and scripts from Word and PDF files. Sold on RapidAPI; one billed unit per started MB of the file sent; scans free.",
    "contact": {
      "name": "Myworkingmemory LLC",
      "email": "support@myworkingmemory.ai",
      "url": "https://www.myworkingmemory.ai/metadata-cleaner-api.html"
    },
    "termsOfService": "https://www.myworkingmemory.ai/metadata-cleaner-office-terms.html"
  },
  "servers": [
    {
      "url": "https://metadata-cleaner-for-docx-and-pdf.p.rapidapi.com",
      "description": "RapidAPI gateway (X-RapidAPI-Key and X-RapidAPI-Host headers)"
    }
  ],
  "paths": {
    "/clean": {
      "post": {
        "summary": "Clean a document (DOCX or PDF)",
        "operationId": "cleanDocument",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "File name when the body is raw bytes, e.g. contract.docx"
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "file",
                "json"
              ]
            },
            "description": "file (default) returns the cleaned file; json returns a report with the file as base64"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "base64"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cleaned file (Content-Disposition attachment, X-Clean-Report header) or JSON report with base64 file",
            "headers": {
              "X-Clean-Report": {
                "schema": {
                  "type": "string"
                },
                "description": "JSON: kind, verifiedClean, removedCount, categories, remaining"
              }
            }
          },
          "400": {
            "description": "NO_FILE"
          },
          "413": {
            "description": "TOO_LARGE (over 4 MB)"
          },
          "415": {
            "description": "UNSUPPORTED (not .docx or PDF)"
          },
          "422": {
            "description": "LOCKED (password, encrypted, legacy .doc) or CORRUPTED"
          }
        }
      }
    },
    "/scan": {
      "post": {
        "summary": "Scan a document (free): what it leaks",
        "operationId": "scanDocument",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON findings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "docx",
                        "pdf"
                      ]
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "removableCount": {
                      "type": "integer"
                    },
                    "findings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "category": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "risk": {
                            "type": "string"
                          },
                          "removable": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "incomplete": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "rapidapiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-RapidAPI-Key"
      }
    }
  },
  "security": [
    {
      "rapidapiKey": []
    }
  ]
}