UploadFile
Uploads a file to HubSpot's file manager for use in marketing or content purposes.
Input
| Name | Type | Description |
| FileLocation | String | Full path to the local file to upload, such as 'C:\\Temp\\downloads\\file.txt'. Required unless using EncodedFileData or Content with FileName. |
| EncodedFileData | String | Base64-encoded file content to upload. Used as an alternative to FileLocation or Content. Must be used in combination with FileName. |
| FileName | String | Name of the file being uploaded, such as 'Sample.txt'. Required when using EncodedFileData or Content. |
| Access | String | Access level for the uploaded file. Options: 'PUBLIC_INDEXABLE' (public and searchable), 'PUBLIC_NOT_INDEXABLE' (public but not indexed by search engines), or 'PRIVATE' (requires signed URL for access).
The allowed values are PUBLIC_INDEXABLE, PUBLIC_NOT_INDEXABLE, PRIVATE. |
| UploadFolderId | String | Optional. ID of the target folder for upload. If provided, UploadFolderPath will be ignored. |
| UploadFolderPath | String | Optional. Path of the folder to upload the file into. Defaults to root '/' if not specified and UploadFolderId is not used.
The default value is /. |
| TimeToLive | String | Optional. Duration before the file is automatically deleted. Use ISO 8601 format (such as 'P3M' for 3 months). Maximum duration is 1 year. |
| Overwrite | Boolean | Optional. If true, overwrites existing files with the same name. If false, appends a number to the filename to prevent overwrite. Defaults to false.
The default value is false. |
| DuplicateValidationStrategy | String | Optional. Defines how duplicate files are handled. Options: 'REJECT', 'RETURN_EXISTING', or 'NONE'. Defaults to 'NONE'.
The allowed values are REJECT, RETURN_EXISTING, NONE. |
| DuplicateValidationScope | String | Optional. Scope used to detect duplicates. Options: 'ENTIRE_PORTAL' (check all files) or 'EXACT_FOLDER' (check only within the folder). Defaults to 'EXACT_FOLDER'.
The allowed values are ENTIRE_PORTAL, EXACT_FOLDER. |
| CharsetHunch | String | Optional. Character encoding of the file, if known. Used for proper text interpretation during upload. |
Result Set Columns
| Name | Type | Description |
| FileId | String | Unique ID assigned to the newly uploaded file. |
| Success | Boolean | Indicates whether the file was uploaded successfully. Returns True if successful. |
| ErrorCode | Integer | If the procedure fails, this field displays the corresponding error code. Useful for debugging and troubleshooting. |
| ErrorMessage | String | If the procedure fails, this field provides a detailed error message explaining the failure. Helps diagnose upload issues. |