Skip to main content
All CollectionsAPI
Uploading and Downloading Files from the SmartSuite API
Uploading and Downloading Files from the SmartSuite API
Peter Novosel avatar
Written by Peter Novosel
Updated over a week ago

The SmartSuite REST API gives you the ability to upload binary file data as well as retrieve a file and its filename.

Note that SmartSuite does not consider adding keys to response objects as breaking changes, so the shape of objects may change without notice. Existing keys will not be removed without a deprecation warning and timeframe.


Authorization

Just like other SmartSuite REST API endpoints, we use token-based authentication for file upload and download requests. You can generate or manage your API key in your User Profile. All API requests must be authenticated and made over HTTPS.

IMPORTANT! Your API key conveys the same privileges as the Member account it is generated in, so it should be treated as securely as a password.

You authenticate to the API by providing your API key in the Authorization header, as well as your Workspace Id in an Account-Id header, as shown below.

KEY:VALUE

  • Authorization: Token API_KEY_HERE

  • Account-Id: WORKSPACE_ID_HERE

NOTE: Your Workspace Id is the 8 characters that follow https://app.smartsuite.com/ in the SmartSuite URL when you’re logged in.

Example: https://app.smartsuite.com/sv25cxf2/solution/62c4b…


Upload a File

To upload a file via the API, you need to make a request to this endpoint:

Method: POST

https://app.smartsuite.com/api/v1/recordfiles/{tableId}/{recordId}/{field_slug}/

Headers:

Content-Type: multipart/form-data

Body:

files: binary data

filename: [file_name]

Here is what it looks like in Postman:


Download a File

If you need to download files from the API, use this endpoint:

Method: GET

https://app.smartsuite.com/api/v1/shared-files/{fileHandle}/get_url/


The response body will be the binary file, and you will also get file metadata in the response headers:

  • X-File-Name: the name of the file

  • Content-Length: the size in bytes

  • Content-Type: MIME file type

  • Content-Disposition: will be set to "inline; filename="{filename}"

Did this answer your question?