{"openapi":"3.1.0","info":{"title":"freepages.dev API","version":"1.0.0","description":"Publish static websites. Authenticate with an API key from https://freepages.dev/ucet#api-klice (\"Authorization: Bearer <key>\"). For AI agents the MCP server at https://freepages.dev/mcp is usually easier."},"servers":[{"url":"https://freepages.dev/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key from the account page"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"}}},"Site":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"files":{"type":"integer"},"bytes":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}},"paths":{"/sites":{"post":{"summary":"Publish or update a site","description":"Multipart upload. Send one .zip (it is extracted unless unzip is \"0\"), or several files as pairs: a \"p\" field with the path, then an \"f\" file.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Site name (lowercase letters, digits, hyphens). A taken name gets a suffix unless overwrite=1."},"overwrite":{"type":"string","enum":["1"],"description":"Replace your existing site of that name."},"preview":{"type":"string","enum":["1"],"description":"Create a 5-minute preview instead."},"unzip":{"type":"string","enum":["0"],"description":"Keep a single uploaded .zip as a file instead of extracting it."},"p":{"type":"string","description":"Path of the next file, e.g. css/style.css"},"f":{"type":"string","format":"binary","description":"A file, or a single .zip"}},"required":["f"]}}}},"responses":{"200":{"description":"Published","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/whoami":{"get":{"summary":"Who is signed in: the account, the API key used and storage use","responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"blocked":{"type":"boolean","description":"Adding and editing sites is not allowed"},"signedInWith":{"type":"string","enum":["apiKey","session"]},"apiKey":{"type":["object","null"],"properties":{"name":{"type":"string"},"prefix":{"type":"string"}}},"siteCount":{"type":"integer"},"usage":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":["integer","null"]},"siteLimit":{"type":["integer","null"],"description":"null: no site limit (the admin account)"}}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/sites":{"get":{"summary":"The account's sites, newest change first, a page at a time","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Part of a site name"},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"next from the previous page"}],"responses":{"200":{"description":"Sites","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"next":{"type":["string","null"]},"total":{"type":"integer"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{name}/files":{"post":{"summary":"List the files of a site","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Site name"}],"responses":{"200":{"description":"Files"},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{name}/rename":{"post":{"summary":"Rename a site","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Site name"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Renamed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{name}/delete":{"post":{"summary":"Delete a site","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Site name"}],"responses":{"200":{"description":"Deleted"},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me/stats":{"get":{"summary":"Page views","parameters":[{"name":"range","in":"query","schema":{"type":"string","enum":["24h","7d","30d"]}},{"name":"site","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Views per hour or day"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}