Upload files to a vault secret
POST/api/v1/EncryptedFile/Upload/:secretVaultId
Uploads one or more files in a multipart form and stores them encrypted in the vault secret. A file with the same name and content type as a file already in the secret replaces that file. When malware scanning is turned on in the encrypted file settings, each file is scanned before it is stored.
Permission required: Admin role (or the App role).
Caution: Uploading a file with the same name and content type as an existing file in the secret replaces that file's content immediately. Files are stored one at a time, so if a later file in the same request fails (for example the malware scan), earlier files in that request are already stored.
Request
Responses
- 200
- 204
- 400
- 401
- 403
- 415
The files were stored. The body is a summary with secretVaultId, description, fileCount, totalSize, uploadTime and details, a list with the id, name, contentType, size, checksum and timestamps of each file.
The request had no content type, so nothing was stored.
The vault secret was not found, a file is too large or invalid, the malware scan failed, or the upload failed. The body is an error message.
The caller is not signed in.
The signed-in user does not have the required role, or the account has read-only access.
The content type is not multipart/form-data.