Create an API that copies a file from localhost to cloud?

Running in a notebook on the desktop

CopyFile[localpath, CloudObject[cloudname]]

will copy the local file to the cloud.

Is it possible to deploy a cloud API that accepts a URL for the local file and performs the copy?

Something like:

CloudDeploy[APIFunction[{"localpath" -> "String"}, CopyFile[#localpath, CloudObject[cloudname]] &],  CloudObject["GetLocalFile"]]

I want to avoid using the “UploadedFile” interpreter type in a form page.