SheetgoDevelopers

Developers › REST API › Storage

REST API · 5 endpoints

files

Complete for this group. Each operation below lists its parameters, request body, responses and errors. Every model they use is documented under Models used on this page, so you do not need another page to build a request. Base URL https://dev-api.sheetgo.com; send Authorization: Bearer sg_…. Latest version: https://dev-api.sheetgo.com/rest/reference/files (Markdown).

Conventions for every endpoint. Lists take page (from 1) and per_page (1-100, default 50), and total counts pages, not items. Collection URLs end with /. POST …/run returns 200 when the run is queued; poll GET …/run. Google Sheets use provider: "drive"; column fields take letters ("E"). Error bodies and status codes: api.html#api-errors.

Browse and search the storage providers connected to your account — Google Drive, OneDrive, SharePoint and Dropbox — to find the ids you need when building an automation.

Every result carries id, provider and file_type, which is exactly what a source or destination needs, so a result can be used in an automation payload without translation. Folders are returned alongside files; filter with type=folder when you only want containers.

Start at /files/{provider}/roots to discover where browsing can begin: SharePoint sites, Drive shared drives and virtual containers such as Shared with me are only reachable from there. These endpoints are read-only — files are created through the automation payload.

Google Docs are not returned by default. Pass type=gdocs to find a Google Docs file for a document destination's template_id — it is the one type omitted from an unfiltered listing, and it exists on Google Drive only.

Operations

GET/rest/beta/files/{provider}Browse a folder

List the direct contents of one folder, files and folders interleaved.

Parameters
NameInTypeDescription
providerpathProviderrequiredStorage provider: drive, onedrive, sharepoint or dropbox
parentquerystringoptionalFolder id to list. Defaults to the provider root. Use /files/{provider}/roots to discover valid starting points (SharePoint sites, Drive shared drives, Shared with me).
Default: "root"
typequerystringoptionalComma-separated list of file types to include: gsheets, xlsx, csv, tsv, folder, gdocs. Omit for every supported type except gdocs: Google Docs are not returned by default, so request type=gdocs to find a document template (Google Drive only).
Example: "gsheets,xlsx"
pagequeryintegeroptionalPage number, 1-based
Default: 1 · Min: 1
per_pagequeryintegeroptionalItems per page
Default: 50 · Min: 1 · Max: 100
Responses
StatusMeaningBody
200Folder contentsFileListResponse
401Authentication failed or token is invalid—
412Provider account not connected—
422Validation ErrorHTTPValidationError
Example request
curl -s -X GET "https://dev-api.sheetgo.com/rest/beta/files/PROVIDER" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"
GET/rest/beta/files/{provider}/rootsList browsable entry points

Where browsing can start for this provider.

SharePoint ids are site-qualified, so its sites are only reachable through this endpoint. Drive adds its shared drives and virtual containers here. Each entry's id can be passed straight back as parent.

Parameters
NameInTypeDescription
providerpathProviderrequiredStorage provider: drive, onedrive, sharepoint or dropbox
Responses
StatusMeaningBody
200Entry pointsFileListResponse
401Authentication failed or token is invalid—
412Provider account not connected—
422Validation ErrorHTTPValidationError
Example request
curl -s -X GET "https://dev-api.sheetgo.com/rest/beta/files/PROVIDER/roots" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"
GET/rest/beta/files/{provider}/{file_id}Get one file or folder

Resolve a single id — useful to validate one before building an automation.

Parameters
NameInTypeDescription
providerpathProviderrequiredStorage provider: drive, onedrive, sharepoint or dropbox
file_idpathstringrequiredProvider file or folder id
Responses
StatusMeaningBody
200Item metadataFileItem
401Authentication failed or token is invalid—
404Item not found or not accessible—
412Provider account not connected—
422Validation ErrorHTTPValidationError
Example request
curl -s -X GET "https://dev-api.sheetgo.com/rest/beta/files/PROVIDER/FILE_ID" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"
GET/rest/beta/files/{provider}/{file_id}/structureDescribe what is inside a file

Tabs, column letters, named ranges and charts of a spreadsheet.

include=columns returns, per tab, the letter → header map that automation column fields (filter, split, remove_duplicates, left_join, anonymize) need: they take the LETTER (D), not the header (Status).

Cost: this reads the file. Google Sheets and Excel on SharePoint cost a provider read per call; other files (CSV/TSV, and Excel on Drive, Dropbox or OneDrive) are downloaded and parsed, and the first read of a large file takes seconds. Pass tab= and reuse the result: repeat reads of the same file, header_row and tabs are answered from a cache without reopening the file, until it changes.

The ids returned are what a dashboard element needs: tabs[].id is the numeric tab_id (Google Sheets only), charts[].chart_id the chart_id.

Parameters
NameInTypeDescription
providerpathProviderrequiredStorage provider: drive, onedrive, sharepoint or dropbox
file_idpathstringrequiredProvider file id, or a folder id (its newest spreadsheet is read)
includequerystringoptionalComma-separated sections: tabs, columns, named_ranges, charts. Default: tabs,named_ranges,charts for Google Sheets, tabs for Excel/CSV/TSV. columns (the letter → header map automation column fields need) is never in the default and implies tabs. named_ranges and charts exist only in Google Sheets.
tabquerystringoptionalcolumns for this tab only (by name). Cannot be combined with all_tabs.
all_tabsquerybooleanoptionalcolumns for every tab. Without it and without tab, only the first 10 tabs are read and columns_truncated is true.
Default: false
header_rowqueryintegeroptionalRow holding the headers (1-based). Must match the source's offset_header.
Default: 1
Responses
StatusMeaningBody
200What is inside the fileFileStructureResponse
400Unknown include value, or invalid tab / all_tabs / header_row—
401Authentication failed or token is invalid—
404File, folder content or tab not found—
412Provider account not connected—
422Not a spreadsheet (unsupported_file_type), a section the file cannot have (section_not_available), or a downloaded file above the size limit (file_too_large)—
Example request
curl -s -X GET "https://dev-api.sheetgo.com/rest/beta/files/PROVIDER/FILE_ID/structure" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"

Models used on this page

Every request and response model referenced above, including nested ones (14). The full catalogue is on api-models.html.

ChartItem

One chart already drawn in the spreadsheet.

FieldTypeDescription
chart_idintegerrequiredNumeric chart id. Pass as chart_id when creating a dashboard element.
chart_typestringnullableNormalized chart type, e.g. column, line, pie
supportedbooleanoptionalFalse when Sheetgo cannot render this chart type on a dashboard
Default: true
tab_idintegernullableNumeric id of the tab the chart is drawn on.
tab_namestringnullableName of that tab.
titlestringnullableThe chart's title as set in the spreadsheet, when it has one.

ColumnItem

One column of a tab's header row.

FieldTypeDescription
headerstringnullableThe header cell exactly as stored (not trimmed — match it verbatim); null when the cell is empty.
indexintegerrequiredZero-based column position.
letterstringrequiredSpreadsheet column letter — the value automation column fields take (filter, split, remove_duplicates, left_join, anonymize).

FileItem

One file or folder, normalized across all four storage providers.

FieldTypeDescription
created_atstringnullableISO-8601 creation time as reported by the provider
file_typeFileTypeFilternullableAutomation file type; null when the item is outside the supported set
idstringrequiredProvider id. Usable as an automation source/destination id, and as parent when browsing.
is_folderbooleanoptionalTrue when the item can be used as a parent
Default: false
kindItemKindoptionalfile | folder | site | shared_drive | virtual
Default: "file"
mime_typestringnullableProvider mimetype
modified_atstringnullableISO-8601 last-modified time as reported by the provider
namestringnullableDisplay name
parent_idstringnullableContaining folder id, when the provider reports one
providerstringrequireddrive | onedrive | sharepoint | dropbox
sizeintegernullableSize in bytes; null or 0 for folders and for providers that omit it
supports_structurebooleanoptionalTrue when GET /files/{provider}/{file_id}/structure can describe this item (any spreadsheet: Google Sheets, Excel, CSV, TSV). Not a claim about reading its values.
Default: false
web_urlstringnullableLink to open the item in the provider UI; null when unavailable

Used by: GET /rest/beta/files/{provider}/{file_id}

FileListResponse

Standard paginated envelope plus a truncation flag.

truncated is true when the enumeration ceiling (FILE_DISCOVERY_MAX_ITEMS, or the internal byte ceiling) was reached, so items past it are not reachable by paging. Narrow with type or search.

FieldTypeDescription
pageintegernullablePage number
Default: 1
per_pageintegernullableNumber of items per page
Default: 50
resultsarray of FileItemoptionalList of results
totalintegernullableTotal number of pages
Default: 0
truncatedbooleanoptionalTrue when the listing was capped
Default: false

Used by: GET /rest/beta/files/{provider}, GET /rest/beta/files/{provider}/roots, GET /rest/beta/files/{provider}/search

FileStructureResponse

What is inside one file.

Discriminated by file_type: the matching body key is populated and the others are absent. Today only spreadsheet exists; a future document variant adds document without changing this URL.

FieldTypeDescription
file_idstringrequiredId of the file that was inspected.
file_typestringrequiredBody discriminator, e.g. spreadsheet
namestringnullableThe file's name.
providerstringrequiredStorage provider the file lives on.
resolved_fileResolvedFilenullableSet when file_id was a folder: the newest spreadsheet in it, whose structure is returned.
spreadsheetSpreadsheetStructurenullableThe spreadsheet's tabs, named ranges and charts. Populated when file_type is spreadsheet, absent otherwise.

Used by: GET /rest/beta/files/{provider}/{file_id}/structure

FileTypeFilter

Public type vocabulary.

The spreadsheet and folder values mirror :class:newapi.models.beta.connections.FileType, so such a value can be handed straight back in an automation payload as file_type.

gdocs is the exception: it has no FileType counterpart because a Google Docs id is passed as the document destination's template_id, a field that carries no file type. It is also the only value not returned by default -- ask for it explicitly.

Type: one of "gsheets", "xlsx", "csv", "tsv", "folder", "gdocs"

HTTPValidationError

FieldTypeDescription
detailarray of ValidationErroroptional

Used by: GET /rest/beta/workflows/, POST /rest/beta/workflows/, POST /rest/beta/workflows/run/{id}, GET /rest/beta/workflows/{id}, PATCH /rest/beta/workflows/{id}, DELETE /rest/beta/workflows/{id}, GET /rest/beta/workflows/{id}/collaborators, POST /rest/beta/workflows/{id}/collaborators, DELETE /rest/beta/workflows/{id}/collaborators, PATCH /rest/beta/workflows/{id}/collaborators/{email}, DELETE /rest/beta/workflows/{id}/collaborators/{email}, GET /rest/beta/workflows/{id}/destinations, GET /rest/beta/workflows/{id}/files, GET /rest/beta/workflows/{id}/general-access, PUT /rest/beta/workflows/{id}/general-access, DELETE /rest/beta/workflows/{id}/general-access, POST /rest/beta/workflows/{id}/leave, POST /rest/beta/workflows/{id}/request-access, GET /rest/beta/workflows/{id}/run, POST /rest/beta/workflows/{id}/run, GET /rest/beta/workflows/{id}/sources, GET /rest/beta/automations/, POST /rest/beta/automations/run/{id}, GET /rest/beta/automations/{id}, DELETE /rest/beta/automations/{id}, GET /rest/beta/automations/{id}/destinations, GET /rest/beta/automations/{id}/files, GET /rest/beta/automations/{id}/run, POST /rest/beta/automations/{id}/run, GET /rest/beta/automations/{id}/sources, GET /rest/beta/workflows/{id}/trigger, DELETE /rest/beta/workflows/{id}/trigger, GET /rest/beta/workflows/{id}/dashboard, DELETE /rest/beta/workflows/{id}/dashboard/elements/{element_id}, GET /rest/beta/workflows/{id}/dashboard/elements/{element_id}/data, PUT /rest/beta/workflows/{id}/dashboard/publish, GET /rest/beta/workflows/{workflow_id}/forms/, POST /rest/beta/workflows/{workflow_id}/forms/, GET /rest/beta/workflows/{workflow_id}/forms/{form_id}, PATCH /rest/beta/workflows/{workflow_id}/forms/{form_id}, DELETE /rest/beta/workflows/{workflow_id}/forms/{form_id}, GET /rest/beta/workflows/{workflow_id}/forms/{form_id}/responses, HEAD /rest/beta/workflows/{workflow_id}/forms/{form_id}/responses, GET /rest/beta/automations/{automation_id}/webhook, GET /rest/beta/workflows/{workflow_id}/webhooks, GET /rest/beta/api-destination/{public_id}, HEAD /rest/beta/api-destination/{public_id}, GET /rest/beta/integrations/{provider}/options, GET /rest/beta/outlook/messages, POST /rest/beta/outlook/messages/batch, GET /rest/beta/outlook/messages/{message_id}, GET /rest/beta/outlook/messages/{message_id}/attachments/{attachment_id}, POST /rest/beta/outlook/send, POST /rest/beta/gmail/send, GET /rest/beta/files/{provider}, GET /rest/beta/files/{provider}/roots, GET /rest/beta/files/{provider}/search, GET /rest/beta/files/{provider}/{file_id}, GET /rest/beta/bigquery/projects, GET /rest/beta/bigquery/projects/{project}/datasets, GET /rest/beta/bigquery/projects/{project}/datasets/{dataset}/tables, GET /rest/beta/bigquery/projects/{project}/datasets/{dataset}/tables/{table}, POST /rest/beta/bigquery/projects/{project}/validate-query, POST /rest/auth/refresh, POST /rest/auth/token

ItemKind

What a result is, beyond its file type.

site, shared_drive and virtual are only ever emitted by the /roots endpoint; browse and search return file or folder.

Type: one of "file", "folder", "site", "shared_drive", "virtual"

NamedRangeItem

One named range.

FieldTypeDescription
idstringnullableProvider namedRangeId
namestringnullableThe name as defined in the spreadsheet
rangestringnullableA1 range the name resolves to
tab_idintegernullableNumeric id of the tab the named range lives on.
tab_namestringnullableName of that tab.

ResolvedFile

The spreadsheet a folder id resolved to.

FieldTypeDescription
idstringrequiredId of the spreadsheet that was read.
namestringnullableIts name.

SpreadsheetStructure

Spreadsheet body of a structure response.

A section is null when it was not requested via include, and an empty list when it was requested and the spreadsheet has none.

FieldTypeDescription
chartsarray of ChartItemnullableCharts already drawn in the spreadsheet. Each carries the chart_id a chart-reference dashboard element needs.
columns_truncatedbooleannullablePresent when include=columns was requested. True when at least one tab's columns is null because only the first tabs are read by default (pass all_tabs=true or tab=) or the read ran out of time.
named_rangesarray of NamedRangeItemnullableNamed ranges defined in the spreadsheet.
tabsarray of TabItemnullableThe spreadsheet's tabs, in workbook order. Each carries the tab_id a dashboard element needs.

TabItem

One tab (sheet) of a spreadsheet.

FieldTypeDescription
colsintegernullableGrid column count
columnsarray of ColumnItemnullableLetter → header map of this tab, when include=columns read it. Null when not requested, or not read (see columns_truncated).
hiddenbooleanoptionalTrue when the tab is hidden in the UI
Default: false
idintegernullableNumeric Google sheetId (Google Sheets only; null for Excel/CSV, whose tabs are identified by name). Pass as tab_id when creating a dashboard element.
indexintegernullableZero-based position
namestringnullableTab title
rowsintegernullableGrid row count
typestringnullableProvider sheet type, e.g. GRID

ValidationError

FieldTypeDescription
locarray of string or integerrequired
msgstringrequired
typestringrequired