The Data Sources Ingestion File API allows developers to upload tabular files directly into HubSpot Data Studio as independent datasets.
Scope requirements
These endpoints provide a flexible way to ingest and manage external data without the need to map it to standard HubSpot CRM object schemas.Learn more about managing external datasets.
When creating a data source, the following multipart/form-data parameters must be included in your request:
Parameter
Type
Required
Description
file
FILE
Yes
Required for file data source type. The CSV, XLS, XLSX, or TSV file to upload. Maximum size: 512 MB. Only one file per request.
request
JSON
Yes
Configuration object describing the data source structure.
The request form parameter should be a JSON object that includes the following fields:
Field
Type
Required
Description
datasourceName
string
No
A custom name for the data source. It must be unique within the portal. For file data source type, if not provided, it defaults to the filename. If you need to create multiple data sources using the same file, use different datasourceName values in each request. When you delete a data source, its name is immediately released and can be reused.
datasourceType
string
Yes
This currently only support FILE data source type.
config
JSON object
Yes
The configuration object describing the data source structure. Contents vary based on datasourceType.
Below is a description of the request body fields for the FILE data source type:
Field
Type
Required
Description
config.file
JSON object
Yes
The file configuration details.
config.file.headerRowIndex
integer
No
The 1-based row index containing column headers. This defaults to 1.
config.file.sheetIndex
integer
No
For XLS and XLSX files, the zero-based index of the sheet to ingest. This defaults to 0, which refers to the first sheet in the file.
config.file.columns
array
Yes
An array of column definitions. At least one column is required.
config.file.columns[].name
string
Yes
The header name of the column. This cannot be blank or duplicated.
config.file.columns[].type
string
Yes
The data type of the column. Valid values include: STRING, BOOL, DATETIME, DATE, INTEGER, DECIMAL.
To get details about a data source, including ingestion status and file structure, make a GET request to /data-studio/data-source/2026-09-beta/{datasourceId}.When retrieving a data source, the following parameter must be met:
Parameter
Type
Required
Description
datasourceId
string
Yes
The unique identifier for the created data source. Use this ID to retrieve or delete the data source.
For example, the following request would retrieve a data source:
To delete a data source, make a DELETE request to /data-studio/data-source/2026-09-beta/{datasourceId}.A data source cannot be deleted if it’s actively used by datasets.When retrieving a data source, the following parameter must be met:
Parameter
Type
Required
Description
datasourceId
string
Yes
The unique identifier of the data source to delete.
You would receive a 204 No Content response on successful deletion with no response body.Status codes you could receive include:
There was a conflict. The data source cannot be deleted because it’s in use by one or more datasets. You must remove the data source from all datasets before deleting.
To upload a new file to overwrite an existing data source in Data Studio, make a PUT request to /data-studio/data-source/2026-09-beta/{datasourceId}. Currently, only file-based data sources are supported for updates.When providing a new schema, it must include all existing fields in use, otherwise the request will be rejected. Any missing fields in the new schema are dropped.When updating a data source, you can provide the same parameters as when you create a data source.For example, the following request body would update a data source: