{"openapi":"3.0.3","info":{"title":"Mrque API","version":"1.0.0","description":"Upload static projects and manage expiring preview links."},"servers":[{"url":"https://api.mrque.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"mk_…","description":"API key starting with `mk_`. Obtain one from Settings → Integrations."}},"schemas":{"Preview":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"name":{"type":"string"},"status":{"type":"string","enum":["active","expired","revoked"]},"expires_at":{"type":"string","format":"date-time","nullable":true},"views":{"type":"integer"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"upgrade_url":{"type":"string","format":"uri"}}}}},"security":[{"bearerAuth":[]}],"paths":{"/upload":{"post":{"summary":"Upload a project and create a preview","description":"Accepts a multipart/form-data body with a static-site ZIP or HTML file. Returns the created preview.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"ZIP or HTML file (max 50 MB on Pro, 200 MB on Agency)"},"name":{"type":"string","description":"Display name for the preview (defaults to filename)"},"password":{"type":"string","description":"Optional password to protect the preview"},"expiresIn":{"type":"integer","enum":[7,30,90],"description":"Days until the preview expires (default: 7)"}}}}}},"responses":{"201":{"description":"Preview created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preview"}}}},"400":{"description":"HTTPS required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan required or upload limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"File too large for your plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid file type or missing required field","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (100 requests/min)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/previews":{"get":{"summary":"List your previews","description":"Returns all previews for the authenticated user, ordered by creation date descending.","parameters":[{"name":"status","in":"query","description":"Filter by status","schema":{"type":"string","enum":["active","expired","revoked"]}},{"name":"limit","in":"query","description":"Maximum number of results (default: 20, max: 100)","schema":{"type":"integer","default":20}},{"name":"offset","in":"query","description":"Pagination offset (default: 0)","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"List of previews","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Preview"}}}}},"400":{"description":"HTTPS required"},"401":{"description":"Invalid or missing API key"},"403":{"description":"Plan does not have API access"},"429":{"description":"Rate limit exceeded"}}}},"/previews/{id}":{"get":{"summary":"Get a single preview","parameters":[{"name":"id","in":"path","required":true,"description":"Preview ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview details including comment count","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Preview"},{"type":"object","properties":{"comment_count":{"type":"integer"}}}]}}}},"401":{"description":"Invalid or missing API key"},"403":{"description":"Plan does not have API access"},"404":{"description":"Preview not found or does not belong to this key"},"429":{"description":"Rate limit exceeded"}}},"delete":{"summary":"Revoke a preview","description":"Sets the preview status to `revoked`. Revoked previews are no longer accessible to viewers.","parameters":[{"name":"id","in":"path","required":true,"description":"Preview ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Preview revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"401":{"description":"Invalid or missing API key"},"403":{"description":"Plan does not have API access"},"404":{"description":"Preview not found or does not belong to this key"},"429":{"description":"Rate limit exceeded"}}}}}}