Sync Modes
Each folder can be assigned one of three sync modes:| Mode | Value | Behavior |
|---|---|---|
| Sync | sync | Always sync and index this folder’s contents (default) |
| Skip | skip | Never sync this folder — new content is not indexed |
| Manual | manual | New documents land in a review queue for manual approval |
Folder Discovery
Before setting policies, your UI needs to show the user’s folder tree. The folder discovery endpoint returns one level at a time (lazy loading):parent_id:
null policy means the folder inherits its sync mode from its nearest ancestor with a policy, or defaults to sync.
Setting Folder Policies
Create or update a folder policy on a connection:The folder ID from the source provider (e.g., Google Drive folder ID).
Display name of the folder. Updated on each request to stay current.
Display path of the folder. Updated on each request to stay current.
The parent folder’s provider ID. Used for policy inheritance resolution.
One of
sync, skip, or manual.Listing policies
Deleting a policy
sync).
Policy Inheritance
Policies resolve hierarchically — the most specific folder wins:- Check the folder itself for a policy
- Walk up the parent chain checking each ancestor
- If no policy is found, default to
sync
/Engineering is set to sync and /Engineering/Drafts is set to skip, files in /Engineering will sync but files in /Engineering/Drafts will not.
Manual Review Workflow
When a folder is set tomanual, new documents from that folder land in pending_review status instead of being indexed immediately. Your app can then present a review UI.
List pending resources
Use the existing/memories/list endpoint with a status filter:
Approve a resource
Approving moves the resource topending status, which queues it for indexing:
Reject a resource
Rejecting moves the resource toskipped status — it will not be indexed:
Webhook Notifications
When folder sync events occur, Hyperspell fires webhook notifications (if you have a webhook URL configured in your app settings):| Event | Trigger |
|---|---|
resource-pending-review | A new document in a manual folder needs approval |
resource-approved | A user approved a pending resource |
resource-rejected | A user rejected a pending resource |
Policy Change Side-Effects
Changing a folder’s sync mode has retroactive effects on existing resources:| Change | Effect |
|---|---|
Any mode -> skip | Pending review resources are marked as skipped |
manual -> sync | Pending review resources are auto-approved for indexing |
skip -> sync or manual | A resync is triggered to pick up previously skipped content |