{"openapi":"3.1.0","info":{"title":"AnyFile REST API","version":"1.0.0","description":"Public REST API for AnyFile: upload, download and organize owned files in folders, manage share links and file requests, inspect submissions, and read share analytics. Authenticate with an AnyFile API key or OAuth 2.0 bearer token and request only the scopes required for the task."},"servers":[{"url":"https://www.useanyfile.com/api/v1"}],"externalDocs":{"description":"AnyFile developer resources","url":"https://www.useanyfile.com/developers"},"paths":{"/":{"get":{"operationId":"getApiIndex","summary":"Get AnyFile API capabilities","security":[],"responses":{"200":{"description":"API capability index","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/files":{"get":{"operationId":"files_list","summary":"List file metadata","x-required-scope":"files:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"query","in":"query","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":128}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"folderId","in":"query","description":"Return resources assigned to this owned folder.","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"A page of file metadata","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"post":{"operationId":"files_upload","summary":"Prepare one or more file uploads","description":"Creates short-lived upload intents for direct-to-Blob transfer. Use each returned pathname, handleUploadUrl, and clientPayload with @vercel/blob/client. The clientPayload contains an intent-scoped secret for the Blob handshake, so the long-lived API credential is not sent to Blob. Poll statusUrl with the AnyFile bearer credential until the resulting file ID is available.","x-required-scope":"files:write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files"],"additionalProperties":false,"properties":{"files":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["name","type","size"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"type":{"type":"string","minLength":1,"maxLength":255},"size":{"type":"integer","minimum":1}}}},"folderId":{"description":"Owned folder ID. Pass null on update to move the resource back to root.","type":["string","null"],"minLength":1,"maxLength":100}}}}}},"responses":{"201":{"description":"Short-lived direct upload grants","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["uploads"],"properties":{"uploads":{"type":"array","items":{"type":"object","required":["intentId","name","contentType","size","pathname","handleUploadUrl","statusUrl","clientPayload","expiresAt"],"properties":{"intentId":{"type":"string"},"name":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"integer"},"pathname":{"type":"string"},"handleUploadUrl":{"type":"string","format":"uri"},"statusUrl":{"type":"string","format":"uri"},"clientPayload":{"type":"object","required":["intentId","name","grant"],"additionalProperties":false,"description":"Short-lived presigned payload for the Blob token handshake. Pass it exactly as returned and do not log or persist the grant secret.","properties":{"intentId":{"type":"string"},"name":{"type":"string"},"grant":{"type":"string","minLength":32}}},"expiresAt":{"type":"string","format":"date-time"}}}}}}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"delete":{"operationId":"files_delete_bulk","summary":"Delete one or more files","x-required-scope":"files:write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fileIds"],"additionalProperties":false,"properties":{"fileIds":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":128}}}}}}},"responses":{"200":{"description":"Deleted file IDs","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["deletedIds"],"properties":{"deletedIds":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/files/{fileId}":{"get":{"operationId":"files_get","summary":"Get file metadata","x-required-scope":"files:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"File metadata","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/File"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"patch":{"operationId":"files_update","summary":"Update file metadata","description":"Rename and/or move an owned file. Set folderId to null to move it back to root.","x-required-scope":"files:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"folderId":{"description":"Owned folder ID. Pass null on update to move the resource back to root.","type":["string","null"],"minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Updated file metadata","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/File"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"delete":{"operationId":"files_delete","summary":"Delete a file","x-required-scope":"files:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Deleted file","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/shares":{"get":{"operationId":"shares_list","summary":"List share links","x-required-scope":"shares:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":128}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"A page of share links","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ShareWithFile"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"post":{"operationId":"shares_create","summary":"Create or reactivate a share link","x-required-scope":"shares:write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareInput"}}}},"responses":{"201":{"description":"Share link created or reactivated","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Share"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/shares/{shareId}":{"get":{"operationId":"shares_get","summary":"Get a share link","x-required-scope":"shares:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"shareId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Share link","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ShareWithFile"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"patch":{"operationId":"shares_update","summary":"Update a share link","x-required-scope":"shares:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"shareId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateShareInput"}}}},"responses":{"200":{"description":"Updated share link","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Share"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/requests":{"get":{"operationId":"requests_list","summary":"List file requests","x-required-scope":"requests:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":128}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"folderId","in":"query","description":"Return resources assigned to this owned folder.","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"A page of file requests","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FileRequestWithCount"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"post":{"operationId":"requests_create","summary":"Create a file request","x-required-scope":"requests:write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"additionalProperties":false,"properties":{"title":{"type":"string","minLength":3,"maxLength":100},"description":{"type":"string","maxLength":500},"collectEmail":{"type":"boolean","default":true},"emailRequired":{"type":"boolean","default":true},"folderId":{"description":"Owned folder ID. Pass null on update to move the resource back to root.","type":["string","null"],"minLength":1,"maxLength":100}}}}}},"responses":{"201":{"description":"File request created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/FileRequest"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/requests/{requestId}":{"get":{"operationId":"requests_get","summary":"Get a file request","x-required-scope":"requests:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"File request","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/FileRequestWithCount"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"patch":{"operationId":"requests_update","summary":"Update a file request","x-required-scope":"requests:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"title":{"type":"string","minLength":3,"maxLength":100},"description":{"type":["string","null"],"maxLength":500},"collectEmail":{"type":"boolean"},"emailRequired":{"type":"boolean"},"isActive":{"type":"boolean"},"folderId":{"description":"Owned folder ID. Pass null on update to move the resource back to root.","type":["string","null"],"minLength":1,"maxLength":100}}}}}},"responses":{"200":{"description":"Updated file request","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/FileRequest"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/requests/{requestId}/submissions":{"get":{"operationId":"request_submissions_list","summary":"List submissions for a file request","description":"Returns submitter-provided name, email, and message when present, plus safe file metadata. Private storage URLs are never exposed.","x-required-scope":"requests:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"requestId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":128}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"A page of request submissions","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Submission"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/analytics":{"get":{"operationId":"analytics_get","summary":"Get aggregate or per-share analytics","x-required-scope":"analytics:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"shareId","in":"query","description":"When provided, returns analytics for this owned share only.","schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Share analytics","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"oneOf":[{"$ref":"#/components/schemas/ShareAnalytics"},{"$ref":"#/components/schemas/AggregateAnalytics"}]}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/files/uploads/{intentId}":{"get":{"operationId":"files_upload_status","summary":"Get file upload status","description":"Poll after the direct Blob transfer until status is complete. The complete response returns the created AnyFile file ID.","x-required-scope":"files:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"intentId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Upload status","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"oneOf":[{"type":"object","required":["status","phase"],"properties":{"status":{"const":"pending"},"phase":{"enum":["uploading","processing"]}}},{"type":"object","required":["status","result"],"properties":{"status":{"const":"complete"},"result":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}},{"type":"object","required":["status","error"],"properties":{"status":{"const":"error"},"error":{"type":"string"}}}]}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/files/{fileId}/download":{"get":{"operationId":"files_download","summary":"Download a file","x-required-scope":"files:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"fileId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"disposition","in":"query","schema":{"type":"string","enum":["attachment","inline"]}}],"responses":{"200":{"description":"File contents","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/folders":{"get":{"operationId":"folders_list","summary":"List folders","x-required-scope":"folders:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":128}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"A page of folders","content":{"application/json":{"schema":{"type":"object","required":["data","pagination"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"post":{"operationId":"folders_create","summary":"Create a folder","x-required-scope":"folders:write","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"responses":{"201":{"description":"Folder created","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Folder"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}},"/folders/{folderId}":{"get":{"operationId":"folders_get","summary":"Get a folder","x-required-scope":"folders:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Folder","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Folder"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"patch":{"operationId":"folders_update","summary":"Rename a folder","x-required-scope":"folders:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"responses":{"200":{"description":"Updated folder","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Folder"}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}},"delete":{"operationId":"folders_delete","summary":"Delete a folder","description":"Deletes the folder only. Files and file requests in it are retained and moved back to root.","x-required-scope":"folders:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Folder deleted","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/ApiError"},"401":{"$ref":"#/components/responses/ApiError"},"403":{"$ref":"#/components/responses/ApiError"},"404":{"$ref":"#/components/responses/ApiError"},"409":{"$ref":"#/components/responses/ApiError"},"429":{"$ref":"#/components/responses/ApiError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"AnyFile API key or OAuth 2.0 access token","description":"Send an AnyFile API key or OAuth 2.0 access token in Authorization: Bearer. OAuth tokens must target https://www.useanyfile.com/api/v1."}},"responses":{"ApiError":{"description":"Structured AnyFile API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","hint"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"}}}}},"Pagination":{"type":"object","required":["nextCursor"],"properties":{"nextCursor":{"type":["string","null"]}}},"FileSummary":{"type":"object","required":["id","name","contentType","size"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"integer","minimum":0}}},"FileShareSummary":{"type":["object","null"],"properties":{"id":{"type":"string"},"publicId":{"type":"string"},"publicUrl":{"type":"string","format":"uri"},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"],"format":"date-time"},"viewCount":{"type":"integer","minimum":0},"downloadCount":{"type":"integer","minimum":0}}},"File":{"allOf":[{"allOf":[{"$ref":"#/components/schemas/FileSummary"},{"type":"object","required":["createdAt","share"],"properties":{"createdAt":{"type":"string","format":"date-time"},"share":{"$ref":"#/components/schemas/FileShareSummary"}}}]},{"type":"object","required":["folderId","folder"],"properties":{"folderId":{"type":["string","null"],"minLength":1,"maxLength":100},"folder":{"anyOf":[{"$ref":"#/components/schemas/Folder"},{"type":"null"}]}}}]},"Share":{"type":"object","required":["id","isActive","expiresAt","viewCount","downloadCount","createdAt","publicUrl"],"properties":{"id":{"type":"string"},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"],"format":"date-time"},"viewCount":{"type":"integer","minimum":0},"downloadCount":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"publicUrl":{"type":"string","format":"uri"}}},"ShareWithFile":{"allOf":[{"$ref":"#/components/schemas/Share"},{"type":"object","required":["file"],"properties":{"file":{"type":"object","required":["name","contentType","size"],"properties":{"name":{"type":"string"},"contentType":{"type":"string"},"size":{"type":"integer","minimum":0}}}}}]},"FileRequest":{"allOf":[{"type":"object","required":["id","title","description","collectEmail","emailRequired","isActive","createdAt","publicUrl"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"collectEmail":{"type":"boolean"},"emailRequired":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"publicUrl":{"type":"string","format":"uri"}}},{"type":"object","required":["folderId","folder"],"properties":{"folderId":{"type":["string","null"],"minLength":1,"maxLength":100},"folder":{"anyOf":[{"$ref":"#/components/schemas/Folder"},{"type":"null"}]}}}]},"FileRequestWithCount":{"allOf":[{"$ref":"#/components/schemas/FileRequest"},{"type":"object","required":["submissionCount"],"properties":{"submissionCount":{"type":"integer","minimum":0}}}]},"Submission":{"type":"object","required":["submitterName","submitterEmail","message","createdAt","file"],"properties":{"submitterName":{"type":["string","null"]},"submitterEmail":{"type":["string","null"],"format":"email"},"message":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"file":{"$ref":"#/components/schemas/FileSummary"}}},"CreateShareInput":{"type":"object","required":["fileId"],"properties":{"fileId":{"type":"string","minLength":1,"maxLength":128},"expiresAt":{"type":["string","null"],"format":"date-time"}}},"UpdateShareInput":{"type":"object","minProperties":1,"properties":{"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"],"format":"date-time"}}},"CreateRequestInput":{"type":"object","required":["title"],"properties":{"title":{"type":"string","minLength":3,"maxLength":100},"description":{"type":"string","maxLength":500},"collectEmail":{"type":"boolean","default":true},"emailRequired":{"type":"boolean","default":true}}},"UpdateRequestInput":{"type":"object","minProperties":1,"properties":{"title":{"type":"string","minLength":3,"maxLength":100},"description":{"type":["string","null"],"maxLength":500},"collectEmail":{"type":"boolean"},"emailRequired":{"type":"boolean"},"isActive":{"type":"boolean"}}},"ShareAnalytics":{"type":"object","required":["shareId","views","downloads","isActive","expiresAt"],"properties":{"shareId":{"type":"string"},"views":{"type":"integer","minimum":0},"downloads":{"type":"integer","minimum":0},"isActive":{"type":"boolean"},"expiresAt":{"type":["string","null"],"format":"date-time"}}},"AggregateAnalytics":{"type":"object","required":["shares","activeShares","activeRequests","views","downloads"],"properties":{"shares":{"type":"integer","minimum":0},"activeShares":{"type":"integer","minimum":0},"activeRequests":{"type":"integer","minimum":0},"views":{"type":"integer","minimum":0},"downloads":{"type":"integer","minimum":0}}},"Folder":{"type":"object","required":["id","name","fileCount","requestCount"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"fileCount":{"type":"integer","minimum":0},"requestCount":{"type":"integer","minimum":0}}}}}}