POST/shares/{id}/files/{filePath}

Upload a single file to a shared path

Uploads a single file to a shared path using the raw request body, without multipart encoding. The filePath identifies the new file and may include a relative subdirectory; URL-encode special characters in the path. The share must have write scope, and its associated user must have upload or overwrite permission.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters
idstringrequired
The unique identifier of the share to upload the file to.
filePathstringrequired
The new file's name and relative path. Subdirectories are accepted; URL-encode special characters in the path.
X-SFTPGO-MTIMEintegeroptional
File modification time as a Unix timestamp in milliseconds.

8 status codes
201Returns a JSON response object with `error` and `message` fields.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
400Returned when the request is invalid.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
401Returned when the request is unauthorized.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
403Returned when the share lacks write scope or its associated user lacks upload or overwrite permission.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
413Returned when the request exceeds the maximum allowed size.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
429Returned when too many requests have been made; you can retry the request later.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
500Returned when an internal server error occurs.
errorstringoptional
error description if any
messagestringoptional
message, can be empty
defaultUnexpected Error
errorstringoptional
error description if any
messagestringoptional
message, can be empty

Error handling

A 400 is returned when the request is invalid, and a 401 when authentication is missing or invalid. A 403 is returned when the share lacks write scope or its associated user lacks upload or overwrite permission; a 413 indicates that the maximum allowed size was exceeded. A 429 indicates too many requests, while a 500 indicates an internal server error. The id path parameter must identify the share, and the filePath path parameter must specify the destination path.