{"openapi":"3.0.0","info":{"version":"6.10.0","title":"UploadThing REST API"},"servers":[{"url":"https://api.uploadthing.com","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-uploadthing-api-key"}},"schemas":{"ErrBadRequest":{"type":"object","properties":{"error":{"type":"string","description":"A stringified version of the error","example":"Invalid request input"},"data":{"nullable":true,"description":"Additional data related to the error","example":[{"code":"invalid_type","expected":"string","received":"undefined","path":["x-uploadthing-api-key"],"message":"You must provide an API key in the 'x-uploadthing-api-key' header"}]}},"required":["error"]},"ErrUnauthorized":{"type":"object","properties":{"error":{"type":"string","description":"A stringified version of the error","example":"Invalid request input"},"data":{"nullable":true,"description":"Additional data related to the error","example":[{"code":"invalid_type","expected":"string","received":"undefined","path":["x-uploadthing-api-key"],"message":"You must provide an API key in the 'x-uploadthing-api-key' header"}]}},"required":["error"]},"ErrInternalServerError":{"type":"object","properties":{"error":{"type":"string","description":"A stringified version of the error","example":"Invalid request input"},"data":{"nullable":true,"description":"Additional data related to the error","example":[{"code":"invalid_type","expected":"string","received":"undefined","path":["x-uploadthing-api-key"],"message":"You must provide an API key in the 'x-uploadthing-api-key' header"}]}},"required":["error"]},"PresignedPostURLs":{"type":"object","properties":{"key":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileUrl":{"type":"string"},"contentDisposition":{"type":"string","enum":["inline"]},"pollingJwt":{"type":"string"},"pollingUrl":{"type":"string"},"customId":{"type":"string","nullable":true},"url":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"string"}}},"required":["key","fileName","fileType","fileUrl","contentDisposition","pollingJwt","pollingUrl","customId","url","fields"]},"MultipartUploadURLs":{"type":"object","properties":{"key":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileUrl":{"type":"string"},"contentDisposition":{"type":"string","enum":["inline"]},"pollingJwt":{"type":"string"},"pollingUrl":{"type":"string"},"customId":{"type":"string","nullable":true},"urls":{"type":"array","items":{"type":"string"}},"uploadId":{"type":"string"},"chunkSize":{"type":"number"},"chunkCount":{"type":"number"}},"required":["key","fileName","fileType","fileUrl","contentDisposition","pollingJwt","pollingUrl","customId","urls","uploadId","chunkSize","chunkCount"]},"ErrForbidden":{"type":"object","properties":{"error":{"type":"string","description":"A stringified version of the error","example":"Invalid request input"},"data":{"nullable":true,"description":"Additional data related to the error","example":[{"code":"invalid_type","expected":"string","received":"undefined","path":["x-uploadthing-api-key"],"message":"You must provide an API key in the 'x-uploadthing-api-key' header"}]}},"required":["error"]},"RouteConfig":{"anyOf":[{"type":"array","items":{"anyOf":[{"type":"string","enum":["image","video","audio","pdf","text","blob"]},{"type":"string","enum":["application/andrew-inset"]}]}},{"type":"object","additionalProperties":{"type":"object","properties":{"maxFileSize":{"type":"string","description":"The maximum file size allowed for a given file type.","example":"4MB"},"maxFileCount":{"type":"number","description":"Maximum allowed files for a given file type.","example":1},"contentDisposition":{"type":"string","enum":["inline","attachment"],"default":"inline"},"acl":{"type":"string","enum":["public-read","private"]}}}}]}},"parameters":{}},"paths":{"/v6/pollUpload/:fileKey":{"get":{"description":"Poll for upload complete.","parameters":[{"schema":{"type":"string"},"required":true,"name":"fileKey","in":"path"}],"responses":{"200":{"description":"Poll for successful upload","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["still working","done"]},"fileData":{"type":"object","properties":{"fileKey":{"type":"string"},"fileName":{"type":"string"},"fileSize":{"type":"number"},"fileType":{"type":"string","nullable":true},"fileUrl":{"type":"string","nullable":true},"customId":{"type":"string","nullable":true},"callbackUrl":{"type":"string"},"callbackSlug":{"type":"string"}},"required":["fileKey","fileName","fileSize","fileType","fileUrl","customId","callbackUrl","callbackSlug"]},"metadata":{"nullable":true,"description":"The metadata returned from your file route's `.middleware()` function."},"callbackData":{"nullable":true,"description":"The callback data set by the server by calling the POST /serverCallback route"}},"required":["status"]}}}}}}},"/v6/serverCallback":{"get":{"security":[{"ApiKeyAuth":[]}],"description":"Get server callback data. This is used to set the data returned from `onUploadComplete` callback.","parameters":[{"schema":{"type":"string","description":"The JWT token you got along with the presigned URLs from `/prepareUpload`"},"required":true,"description":"The JWT token you got along with the presigned URLs from `/prepareUpload`","name":"authorization","in":"header"}],"responses":{"200":{"description":"Successfully retrieved callback data.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["done","still waiting"]}},"required":["status"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}},"post":{"security":[{"ApiKeyAuth":[]}],"description":"Set server callback data. This is used to set the data returned from `onUploadComplete` callback.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileKey":{"type":"string","maxLength":300},"callbackData":{"nullable":true}},"required":["fileKey"]}}}},"responses":{"200":{"description":"Successfully set callback data.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/prepareUpload":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Request presigned URLs for file uploads through based on your file router. NOTE: This spec complies with SDK versions ^6.4. Response may vary for older versions.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"callbackUrl":{"type":"string","maxLength":2048,"format":"uri"},"callbackSlug":{"type":"string","maxLength":128},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":1024},"size":{"type":"number","minimum":0,"maximum":9007199254740991},"customId":{"type":"string","nullable":true,"maxLength":128}},"required":["name","size"]}},"routeConfig":{"$ref":"#/components/schemas/RouteConfig"},"metadata":{"nullable":true}},"required":["callbackUrl","callbackSlug","files","routeConfig"]}}}},"responses":{"200":{"description":"Successfully retrieved presigned URLs.","content":{"application/json":{"schema":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/PresignedPostURLs"},{"$ref":"#/components/schemas/MultipartUploadURLs"}],"oneOf":[{"$ref":"#/components/schemas/PresignedPostURLs"},{"$ref":"#/components/schemas/MultipartUploadURLs"}]}}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"403":{"description":"Your request was valid, but you are not allowed to perform this action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrForbidden"},"example":{"error":"Storage quota exceeded"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/uploadFiles":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Request presigned URLs for file uploads without file routes. NOTE: This spec complies with SDK versions ^6.4. Response may vary for older versions.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":1024},"size":{"type":"number","minimum":0,"maximum":9007199254740991},"type":{"type":"string"},"customId":{"type":"string","nullable":true,"maxLength":128}},"required":["name","size","type"]}},"acl":{"type":"string","enum":["public-read","private"]},"metadata":{"nullable":true},"contentDisposition":{"type":"string","enum":["inline","attachment"],"default":"inline"}},"required":["files"]}}}},"responses":{"200":{"description":"Successfully retrieved presigned URLs.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/PresignedPostURLs"},{"$ref":"#/components/schemas/MultipartUploadURLs"}],"oneOf":[{"$ref":"#/components/schemas/PresignedPostURLs"},{"$ref":"#/components/schemas/MultipartUploadURLs"}]}}},"required":["data"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/completeMultipart":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Complete a multipart upload. This will finalize the upload and make the file available for download.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileKey":{"type":"string"},"uploadId":{"type":"string"},"etags":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"partNumber":{"type":"number"}},"required":["tag","partNumber"]}}},"required":["fileKey","uploadId","etags"]}}}},"responses":{"200":{"description":"Successfully completed the multipart upload.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/listFiles":{"post":{"description":"List files for the current app. Response is paginated.","security":[{"ApiKeyAuth":[]}],"parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"number","minimum":0,"maximum":100000,"default":500,"description":"The maximum number of files to retrieve."},"offset":{"type":"number","minimum":0,"default":0,"description":"The number of files to skip."}},"default":{"limit":500,"offset":0}}}}},"responses":{"200":{"description":"Successfully retrieved files.","content":{"application/json":{"schema":{"type":"object","properties":{"hasMore":{"type":"boolean","description":"Whether there are more files to retrieve."},"files":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The file id.","deprecated":true},"customId":{"type":"string","nullable":true,"description":"The custom id of the file.","example":"my-custom-id"},"key":{"type":"string","description":"The file key."},"name":{"type":"string","description":"The name of the file.","example":"my-file.png"},"status":{"type":"string","description":"The status of the file.","example":"Uploaded"},"size":{"type":"number","description":"The size of the file in bytes.","example":1024},"uploadedAt":{"type":"number","description":"The timestamp of when the file was uploaded.","example":1717213483400}},"required":["id","customId","key","name","status","size","uploadedAt"]}}},"required":["hasMore","files"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/renameFiles":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Rename files.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"updates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"newName":{"type":"string","maxLength":1024},"fileKey":{"type":"string","maxLength":300}},"required":["newName","fileKey"],"additionalProperties":false},{"type":"object","properties":{"newName":{"type":"string","maxLength":1024},"customId":{"type":"string","maxLength":128}},"required":["newName","customId"],"additionalProperties":false}]}}},"required":["updates"]}}}},"responses":{"200":{"description":"Successfully renamed files.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the files were renamed successfully.","example":true},"renamedCount":{"type":"number","description":"The number of files that were renamed.","example":1}},"required":["success","renamedCount"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/deleteFiles":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Mark files for deletion. The files will be deleted at the storage provider shortly after.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","maxLength":36},"description":"A list of file ids","deprecated":true},"fileKeys":{"type":"array","items":{"type":"string","maxLength":300},"description":"A list of file keys"},"customIds":{"type":"array","items":{"type":"string","maxLength":128},"description":"A list of customIds"}}}}}},"responses":{"200":{"description":"Successfully marked file for deletion.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deletedCount":{"type":"number"}},"required":["success","deletedCount"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v7/getAppInfo":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Retrieve info for a given app","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"responses":{"200":{"description":"Successfully retrieved app info.","content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"The app ID.","example":"MY_APP_123"},"defaultACL":{"type":"string","description":"The app's default ACL.","example":"public-read"},"allowACLOverride":{"type":"boolean","description":"Whether the app allows overriding the ACL on a per-request basis","example":false}},"required":["appId","defaultACL","allowACLOverride"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/getUsageInfo":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Retrieve usage info for the app associated with the provided API key.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"responses":{"200":{"description":"Successfully retrieved usage info.","content":{"application/json":{"schema":{"type":"object","properties":{"totalBytes":{"type":"number","description":"Total bytes used counting towards the quota. For free apps this means the total bytes used by all free apps, for paid apps this will be the same as `appTotalBytes`.","example":26843545600},"appTotalBytes":{"type":"number","description":"Total bytes used by this app.","example":26843545600},"filesUploaded":{"type":"number","description":"Total number of files uploaded by this app.","example":100000},"limitBytes":{"type":"number","description":"The allocated storage quota for the app in bytes.","example":107374182400}},"required":["totalBytes","appTotalBytes","filesUploaded","limitBytes"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/failureCallback":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Mark an upload as failed, or abort a multipart upload. This will free up resources and revert the storage quota.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileKey":{"type":"string","maxLength":300,"description":"The file key of the file that failed to upload."},"uploadId":{"type":"string","nullable":true,"description":"The uploadId, only applicable for multipart uploads."}},"required":["fileKey"]}}}},"responses":{"200":{"description":"Successfully aborted or marked upload as failed.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/requestFileAccess":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Request a presigned GET url for a private file.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileKey":{"type":"string","maxLength":300,"description":"The file key of the file to access."},"customId":{"type":"string","nullable":true,"maxLength":128,"description":"The custom id of the file to access."},"expiresIn":{"type":"number","minimum":1,"maximum":604800,"description":"The number of seconds after which the URL expires. Defaults to what the app has set in the dashboard.","example":3600}}}}}},"responses":{"200":{"description":"Successfully retrieved a presigned GET URL.","content":{"application/json":{"schema":{"type":"object","properties":{"ufsUrl":{"type":"string","description":"The presigned GET URL. If the file is private, the URL will contain authentication parameters.","example":"https://APP_ID.ufs.sh/f/FILE_KEY"},"url":{"type":"string","deprecated":true,"description":"The presigned GET URL. If the file is private, the URL will contain authentication parameters.","example":"https://utfs.io/f/FILE_KEY"}},"required":["ufsUrl","url"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"404":{"description":"File not found.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v6/updateACL":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Update the ACL for a list of files.","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"updates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"fileKey":{"type":"string","maxLength":300,"description":"The file key of the file to update.","example":"aaaa-bbbb-cccc-dddd"},"acl":{"type":"string","enum":["public-read","private"],"description":"The new ACL for the file.","example":"public-read"}},"required":["fileKey","acl"]},{"type":"object","properties":{"customId":{"type":"string","maxLength":128,"description":"The custom id of the file to update.","example":"my-custom-id"},"acl":{"type":"string","enum":["public-read","private"],"description":"The new ACL for the file.","example":"public-read"}},"required":["customId","acl"]}]}}},"required":["updates"]}}}},"responses":{"200":{"description":"Successfully updated the ACL for files.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the ACLs were updated successfully.","example":true},"updatedCount":{"type":"number","description":"The number of files that were updated.","example":1}},"required":["success","updatedCount"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}},"/v7/prepareUpload":{"post":{"security":[{"ApiKeyAuth":[]}],"description":"Retrieve a presigned URL for a file upload. NOTE:: You can generate presigned URLs yourself directly on your server. Use this endpoint as a last resort if you're unable to generate valid signed URLs yourself. You can read more about generating your own presigned URLs here and how to upload files using the generated signed URL here: https://docs.uploadthing.com/uploading-files","parameters":[{"schema":{"type":"string","description":"The API key for the app","example":"sk_live_1234567890"},"required":true,"description":"The API key for the app","name":"x-uploadthing-api-key","in":"header"},{"schema":{"type":"string","description":"A semver parseable version string of the SDK calling the API","example":"6.4.0"},"required":false,"description":"A semver parseable version string of the SDK calling the API","name":"x-uploadthing-version","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the package name of the frontend","example":"@uploadthing/react"},"required":false,"description":"Used for analytics, the package name of the frontend","name":"x-uploadthing-fe-package","in":"header"},{"schema":{"type":"string","description":"Used for analytics, the name of the backend adapter","example":"express"},"required":false,"description":"Used for analytics, the name of the backend adapter","name":"x-uploadthing-be-adapter","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","description":"The name of the file to be uploaded","example":"image.png"},"fileSize":{"type":"number","description":"The size of the file to be uploaded, in bytes.","example":1468006.4},"slug":{"type":"string","description":"The slug of the file route used to upload this file. See https://docs.uploadthing.com/file-routes","example":"imageUploader"},"fileType":{"type":"string","description":"The type of the file to be uploaded.","example":"image/png"},"customId":{"type":"string","description":"A custom identifier for the file","example":"my-id-123"},"contentDisposition":{"type":"string","enum":["inline","attachment"]},"acl":{"type":"string","enum":["public-read","private"]},"expiresIn":{"type":"number","default":3600,"description":"The number of seconds after which the file will be deleted from the bucket.","example":3600}},"required":["fileName","fileSize"]}}}},"responses":{"200":{"description":"Successfully retrieved app info.","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"url":{"type":"string"}},"required":["key","url"]}}}},"400":{"description":"Your request input was invalid. Please check your request and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrBadRequest"}}}},"401":{"description":"Your request was not authorized, either due to missing or invalid API key provided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrUnauthorized"}}}},"500":{"description":"An unexpected error occurred. Please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrInternalServerError"}}}}}}}}}