HubSpot: Search folders
HubSpot files.searchFolders: arguments, response, policy and SDK examples.
← Files operations · Get started
Operation hubspot.files_search_folders
Provider route: GET /files/2026-09/folders/search. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/hubspot with npm, or alter-sdk-hubspot with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { HubSpotIntegration } from "@alter-ai/hubspot";
async function execute(input: Parameters<HubSpotIntegration["files"]["searchFolders"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new HubSpotIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.files.searchFolders(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_hubspot import HubSpotIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = HubSpotIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.files.search_folders(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.after | string | Optional | |
query.before | string | Optional | |
query.createdAt | string | Optional | Format: date-time |
query.createdAtGte | string | Optional | Format: date-time |
query.createdAtLte | string | Optional | Format: date-time |
query.idGte | integer | Optional | Format: int64 |
query.idLte | integer | Optional | Format: int64 |
query.ids | array | Optional | |
query.ids[] | integer | Each item | Format: int64 |
query.limit | integer | Optional | Format: int32 |
query.name | string | Optional | |
query.parentFolderIds | array | Optional | |
query.parentFolderIds[] | integer | Each item | Format: int64 |
query.path | string | Optional | |
query.properties | array | Optional | |
query.properties[] | string | Each item | |
query.sort | array | Optional | |
query.sort[] | string | Each item | |
query.updatedAt | string | Optional | Format: date-time |
query.updatedAtGte | string | Optional | Format: date-time |
query.updatedAtLte | string | Optional | Format: date-time |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Search folders — response body |
Referenced models: Search folders — response body
Schemas
Section titled “Schemas”Search folders — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
paging | Model | Optional | Expand Search files — response body — paging |
results | array | Required within parent | An array of folder objects, each representing a folder within the file manager. |
results[] | Model | Each item | Expand Create folder — response body |
Referenced models: Search files — response body — paging, Create folder — response body
Search files — response body — paging
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the pagination information for navigating through a list of results in the API. It provides details on how to access the previous or next set of results. |
next | Model | Optional | Expand Search files — response body — paging next |
prev | Model | Optional | Expand Search files — response body — paging prev |
Referenced models: Search files — response body — paging next, Search files — response body — paging prev
Create folder — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
archived | boolean | Required within parent | A boolean indicating whether the folder is archived. |
archivedAt | string | Optional | The date and time when the folder was archived, in ISO 8601 format. Format: date-time |
createdAt | string | Required within parent | The date and time when the folder was created, in ISO 8601 format. Format: date-time |
id | string | Required within parent | The unique ID for the folder, represented as a string. |
name | string | Optional | The name of the folder, represented as a string. |
parentFolderId | string | Optional | The unique identifier of the parent folder, represented as a string. |
path | string | Optional | The path of the folder within the file system, represented as a string. |
updatedAt | string | Required within parent | The date and time when the folder was last updated, in ISO 8601 format. Format: date-time |
Search files — response body — paging next
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Specifies the paging information needed to retrieve the next set of results in a paginated API response |
after | string | Required within parent | A string token used to retrieve the next page of results. |
link | string | Optional | A string URL that provides the link to access the next page of results. |
Search files — response body — paging prev
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | specifies the paging information needed to retrieve the previous set of results in a paginated API response |
before | string | Required within parent | A string token representing the cursor for the previous page of results. |
link | string | Optional | A string URL that provides a link to the previous page of results. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: hubspot.files_search_folders. Catalog operation: files_search_folders. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["files.read", "files.sensitive.read", "files.ui_hidden.read"]