{"openapi":"3.1.0","info":{"title":"Fileport API","version":"1.0.0","summary":"Upload large files from your code and get a link that works at once.","description":"Upload starts an upload and answers with its link and an uploadUrl for each file, on one of Fileport's upload servers. Send each file to its uploadUrl with PUT in parts of 100 MB (?part=1, ?part=2 and on, the last part the rest of the file), each with its Content-Length. A GET on an uploadUrl answers {\"size\", \"parts\", \"received\", \"done\"}, the parts that arrived. Upload addresses work for 7 days.","termsOfService":"https://fileport.io/terms","contact":{"name":"Fileport","url":"https://fileport.io/support"}},"externalDocs":{"description":"Docs with examples","url":"https://fileport.io/api"},"servers":[{"url":"https://api.fileport.io/v1"}],"security":[{"apiKey":[]}],"paths":{"/uploads":{"post":{"operationId":"upload","summary":"Upload","description":"Starts a Send upload or a photobook. Its link works at once, and downloads can start while files arrive. Needs Full Access or Upload Only.","parameters":[{"name":"Idempotency-Key","in":"header","description":"A call again with the same key gets the first answer, for a day","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadStart"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartedUpload"}}},"description":"The upload started"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"507":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"listUploads","summary":"List","description":"Your uploads, newest first, up to 100 at a time. Needs Full Access or Read Only.","parameters":[{"name":"product","in":"query","schema":{"type":"string","enum":["send","photobook"]}},{"name":"cursor","in":"query","description":"The next of the page before","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Uploads on the page","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadList"}}},"description":"A page of uploads"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/uploads/{id}":{"parameters":[{"$ref":"#/components/parameters/id"}],"get":{"operationId":"getUpload","summary":"Get","description":"An upload's details. A finished Send upload has a download link of the file, or a ZIP of every file, which counts as no download. Needs Full Access or Read Only.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}},"description":"The upload"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"editUpload","summary":"Edit","description":"Changes the fields the body names. Needs Full Access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadEdit"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}},"description":"The changed upload"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"deleteUpload","summary":"Delete","description":"Deletes an upload. Needs Full Access.","responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/uploads/{id}/files":{"parameters":[{"$ref":"#/components/parameters/id"}],"post":{"operationId":"addFiles","summary":"Add Files","description":"Adds files to an upload. Send each to its uploadUrl. Needs Full Access, or Upload Only on an upload the same key started.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","minItems":1,"maxItems":4000,"items":{"$ref":"#/components/schemas/FileParam"}}}}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddedFiles"}}},"description":"The files were added"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/uploads/{id}/files/{indices}":{"parameters":[{"$ref":"#/components/parameters/id"},{"name":"indices","in":"path","required":true,"description":"The index of each file, as Get lists them, joined by commas, like 2,5,9","schema":{"type":"string"}}],"delete":{"operationId":"removeFiles","summary":"Remove Files","description":"Removes files from an upload, which keeps one file at least. Needs Full Access.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}},"description":"The upload without the files"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/account":{"get":{"operationId":"getAccount","summary":"Account","description":"The account's plan, storage and uploads left today. Every key can call it.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"description":"The account"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from the API page in your Fileport account, as Authorization: Bearer fpk_…"}},"parameters":{"id":{"name":"id","in":"path","required":true,"description":"The upload's id","schema":{"type":"string"}}},"responses":{"Error":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"An error, its code one of the list on https://fileport.io/api#limits"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","examples":["upload.storageused"]},"message":{"type":"string"}}}}},"FileParam":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string","maxLength":250,"description":"The name, with its folders like photos/2026/beach.jpg"},"size":{"type":"integer","minimum":1,"description":"Bytes"},"modified":{"type":"integer","description":"When the file last changed, in milliseconds since 1970. The time of the call when left out"}}},"UploadStart":{"type":"object","required":["files"],"properties":{"product":{"type":"string","enum":["send","photobook"],"default":"send"},"name":{"type":"string","maxLength":250,"description":"The file's name for one file, else the folder the files share"},"files":{"type":"array","minItems":1,"maxItems":4000,"description":"Up to 2,000 files, or 4,000 in a photobook","items":{"$ref":"#/components/schemas/FileParam"}},"region":{"type":["string","null"],"enum":["us-west","us-central","us-east","latam-east","latam-west","eu-northwest","eu-central","asia-northeast","asia-southeast","asia-south","aus-southeast",null],"description":"Where the upload server is. Any region when left out"}}},"FileAddress":{"type":"object","required":["index","name","size","parts","uploadUrl"],"properties":{"index":{"type":"integer"},"name":{"type":"string"},"size":{"type":"integer"},"parts":{"type":"integer","description":"How many 100 MB parts the file goes in"},"uploadUrl":{"type":"string","format":"uri","description":"Where each part goes with PUT, as ?part=N"}}},"StartedUpload":{"type":"object","required":["id","product","name","link","expiresAt","files"],"properties":{"id":{"type":"string"},"product":{"type":"string","enum":["send","photobook"]},"name":{"type":"string"},"link":{"type":"string","format":"uri"},"expiresAt":{"type":["string","null"],"format":"date-time"},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileAddress"}}}},"AddedFiles":{"type":"object","required":["id","files"],"properties":{"id":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/FileAddress"}}}},"File":{"type":"object","required":["index","name","size","finished"],"properties":{"index":{"type":"integer"},"name":{"type":"string"},"size":{"type":"integer"},"finished":{"type":"boolean","description":"Whether every part arrived"}}},"AlbumSettings":{"type":"object","properties":{"order":{"type":"string","enum":["name-desc","name-asc","date-desc","date-asc"]},"layout":{"type":"string","enum":["dense","normal","sparse"]},"exif":{"type":"boolean","description":"Whether visitors see what the camera recorded"},"chapters":{"type":"boolean","description":"Whether the album shows its folders, else its days, as chapters"},"picks":{"type":"boolean","description":"Whether visitors can heart photos and send them as their picks"},"shared":{"type":"boolean","description":"Whether anyone with the link can add their photos"}}},"Upload":{"type":"object","required":["id","product","name","link","size","createdAt","expiresAt","expiry","password","finished","files"],"properties":{"id":{"type":"string"},"product":{"type":"string","enum":["send","photobook"]},"name":{"type":"string"},"description":{"type":"string"},"tags":{"type":"string"},"link":{"type":"string","format":"uri"},"size":{"type":"integer"},"createdAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"expiry":{"type":"string","enum":["1d","7d","30d","3m","6m","1y","noexpire"]},"password":{"type":"boolean"},"finished":{"type":"boolean","description":"Whether every file arrived"},"expireAfterDownload":{"type":"boolean","description":"Send uploads only"},"notifyAfterDownload":{"type":"boolean","description":"Send uploads only"},"downloads":{"type":"integer","description":"Send uploads only"},"downloadUrl":{"type":["string","null"],"format":"uri","description":"Send uploads only, once finished: the file, or a ZIP of every file. It counts as no download"},"downloadUrlExpiresAt":{"type":["string","null"],"format":"date-time"},"views":{"type":"integer","description":"Photobooks only"},"album":{"$ref":"#/components/schemas/AlbumSettings","description":"Photobooks only"},"files":{"type":"array","items":{"$ref":"#/components/schemas/File"}}}},"UploadListItem":{"type":"object","required":["id","product","name","link","size","fileCount","createdAt","expiresAt"],"properties":{"id":{"type":"string"},"product":{"type":"string","enum":["send","photobook"]},"name":{"type":"string"},"link":{"type":"string","format":"uri"},"size":{"type":"integer"},"fileCount":{"type":"integer"},"createdAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"downloads":{"type":"integer","description":"Send uploads only"},"views":{"type":"integer","description":"Photobooks only"}}},"UploadList":{"type":"object","required":["uploads","next"],"properties":{"uploads":{"type":"array","items":{"$ref":"#/components/schemas/UploadListItem"}},"next":{"type":["string","null"],"description":"The cursor of the next page, null on the last"}}},"UploadEdit":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":250},"description":{"type":"string","maxLength":250},"tags":{"type":"string","maxLength":250},"expiry":{"type":"string","enum":["1d","7d","30d","3m","6m","1y","noexpire"]},"password":{"type":"string","maxLength":250,"description":"An empty one removes the password"},"expireAfterDownload":{"type":"boolean","description":"Send uploads only"},"notifyAfterDownload":{"type":"boolean","description":"Send uploads only"},"album":{"$ref":"#/components/schemas/AlbumSettings","description":"Photobooks only"}}},"Account":{"type":"object","required":["plan","storage","maxUploadSize","uploadsLeft"],"properties":{"plan":{"type":"string"},"storage":{"type":"object","required":["used","limit"],"properties":{"used":{"type":"integer"},"limit":{"type":"integer"}}},"maxUploadSize":{"type":"integer"},"uploadsLeft":{"type":"integer","description":"Uploads left today"}}}}}}