Skip to main content
POST
/
context-documents
/
tree
Generate a three-tier context document tree
curl --request POST \
  --url https://api.hyperspell.com/context-documents/tree \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sources": [
    "<string>"
  ],
  "user_id": "<string>",
  "workstream_name": "<string>"
}
'
{
  "tree_id": "<string>",
  "status": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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.

Body

application/json

Request body for POST /context-documents/tree.

sources
string[] | null

Integration sources to include (e.g., ['gmail', 'slack']). Defaults to all.

user_id
string | null

User ID for personal tier scoping. When set, personal/context.md is generated from this user's data only. Company and team tiers still use all data.

workstream_name
string | null

Generate docs for this team only (skip auto-detection). Alias: team_name.

Response

Successful Response

tree_id
string
required
status
string
required
created_at
string<date-time>
required