Try our new Setup Skill to automatically integrate Hyperspell into your project
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const response = await client.folders.setPolicies('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
provider_folder_id: 'provider_folder_id',
sync_mode: 'sync',
});
console.log(response.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_folder_id": "<string>",
"sync_mode": "sync",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Create or update a folder policy for a specific connection.
import Hyperspell from 'hyperspell';
const client = new Hyperspell({
apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
});
const response = await client.folders.setPolicies('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
provider_folder_id: 'provider_folder_id',
sync_mode: 'sync',
});
console.log(response.id);{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_folder_id": "<string>",
"sync_mode": "sync",
"folder_name": "<string>",
"folder_path": "<string>",
"parent_folder_id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.
Folder ID from the source provider
Sync mode for this folder
sync, skip, manual Display name of the folder
Display path of the folder
Parent folder's provider ID for inheritance resolution
Successful Response
Unique policy ID
Folder ID from the source provider
Sync mode for this folder
sync, skip, manual Display name of the folder
Display path of the folder
Parent folder's provider ID
Connection ID (null for integration defaults)
Was this page helpful?