Skip to main content

Uploading and Downloading Files from the SmartSuite API

Peter Novosel avatar
Written by Peter Novosel
Updated over 2 months ago

The SmartSuite REST API enables you to upload binary file data and retrieve files along with their metadata, offering a seamless way to handle file operations programmatically.

Plan Availability

All plan types with varying limitations

Related Reading


Authorization

File upload and download requests follow the same token-based authentication used by other SmartSuite API endpoints. Ensure you:

  • Generate an API key in your User Profile.

  • Authenticate requests using HTTPS.

Header Example:

Authorization: Token API_KEY_HERE Account-Id: WORKSPACE_ID_HERE

Note: Your Workspace ID is the 8-character identifier in your SmartSuite URL after logging in (e.g., https://app.smartsuite.com/sv25cxf2/).


Uploading a File

To upload a file to a specific table and record, use the following endpoint:

Endpoint:

Method: POST

https://app.smartsuite.com/api/v1/recordfiles/{table_id}/{record_id}/{field_slug}/

Request Headers

  • Content-Type: multipart/form-data

Request Body

  • files: Binary file data

  • filename: Desired file name

Example in Postman

  1. Set the method to POST.

  2. Include the required headers and body with your binary file data.


Downloading a File

To download a file and retrieve its metadata, use the following endpoint:

Endpoint:

Method: GET

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

Response

The API returns:

  • Binary File Data: File content.

  • Metadata (in headers):

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

    • Content-Length: File size in bytes.

    • Content-Type: MIME type.

    • Content-Disposition: inline; filename="{filename}"


Practical Scenarios and Use Cases

1. Storing Attachments

Scenario: A sales team needs to upload contracts and proposals to specific customer records.

Solution: Use the upload endpoint to attach files directly to customer records in relevant tables.

2. File Retrieval for Reporting

Scenario: An administrator wants to download uploaded invoices for financial analysis.

Solution: Use the download endpoint to retrieve files and their metadata programmatically.

3. Automating File Management

Scenario: A developer needs to integrate external file storage services with SmartSuite.

Solution: Automate file upload and retrieval processes using SmartSuite API endpoints.

Did this answer your question?