Skip to main content
PATCH
/
context-documents
/
config
Update this app's brain-generation config (structure/prompts/weights)
curl --request PATCH \
  --url https://api.hyperspell.com/context-documents/config \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "structure": {
    "company": [
      {
        "key": "<string>",
        "filename": "<string>",
        "prompt": "<string>",
        "search_queries": [
          "<string>"
        ]
      }
    ],
    "workstream": [
      {
        "key": "<string>",
        "filename": "<string>",
        "prompt": "<string>",
        "search_queries": [
          "<string>"
        ]
      }
    ]
  },
  "company_prompts": {},
  "workstream_prompts": {},
  "personal_prompt": "<string>",
  "detection_prompt": "<string>",
  "source_weights": {}
}
'
import requests

url = "https://api.hyperspell.com/context-documents/config"

payload = {
"structure": {
"company": [
{
"key": "<string>",
"filename": "<string>",
"prompt": "<string>",
"search_queries": ["<string>"]
}
],
"workstream": [
{
"key": "<string>",
"filename": "<string>",
"prompt": "<string>",
"search_queries": ["<string>"]
}
]
},
"company_prompts": {},
"workstream_prompts": {},
"personal_prompt": "<string>",
"detection_prompt": "<string>",
"source_weights": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
structure: {
company: [
{
key: '<string>',
filename: '<string>',
prompt: '<string>',
search_queries: ['<string>']
}
],
workstream: [
{
key: '<string>',
filename: '<string>',
prompt: '<string>',
search_queries: ['<string>']
}
]
},
company_prompts: {},
workstream_prompts: {},
personal_prompt: '<string>',
detection_prompt: '<string>',
source_weights: {}
})
};

fetch('https://api.hyperspell.com/context-documents/config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperspell.com/context-documents/config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'structure' => [
'company' => [
[
'key' => '<string>',
'filename' => '<string>',
'prompt' => '<string>',
'search_queries' => [
'<string>'
]
]
],
'workstream' => [
[
'key' => '<string>',
'filename' => '<string>',
'prompt' => '<string>',
'search_queries' => [
'<string>'
]
]
]
],
'company_prompts' => [

],
'workstream_prompts' => [

],
'personal_prompt' => '<string>',
'detection_prompt' => '<string>',
'source_weights' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.hyperspell.com/context-documents/config"

payload := strings.NewReader("{\n \"structure\": {\n \"company\": [\n {\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"prompt\": \"<string>\",\n \"search_queries\": [\n \"<string>\"\n ]\n }\n ],\n \"workstream\": [\n {\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"prompt\": \"<string>\",\n \"search_queries\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"company_prompts\": {},\n \"workstream_prompts\": {},\n \"personal_prompt\": \"<string>\",\n \"detection_prompt\": \"<string>\",\n \"source_weights\": {}\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.hyperspell.com/context-documents/config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"structure\": {\n \"company\": [\n {\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"prompt\": \"<string>\",\n \"search_queries\": [\n \"<string>\"\n ]\n }\n ],\n \"workstream\": [\n {\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"prompt\": \"<string>\",\n \"search_queries\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"company_prompts\": {},\n \"workstream_prompts\": {},\n \"personal_prompt\": \"<string>\",\n \"detection_prompt\": \"<string>\",\n \"source_weights\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hyperspell.com/context-documents/config")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"structure\": {\n \"company\": [\n {\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"prompt\": \"<string>\",\n \"search_queries\": [\n \"<string>\"\n ]\n }\n ],\n \"workstream\": [\n {\n \"key\": \"<string>\",\n \"filename\": \"<string>\",\n \"prompt\": \"<string>\",\n \"search_queries\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"company_prompts\": {},\n \"workstream_prompts\": {},\n \"personal_prompt\": \"<string>\",\n \"detection_prompt\": \"<string>\",\n \"source_weights\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "structure": {},
  "prompts": {},
  "source_weights": {}
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

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

The self-serve subset of context-doc config an app may edit with its OWN credential. Excludes canonical_documents, demo/pretend, employee_domains, and digest flags — those are not customer-editable through this surface.

structure
BrainConfigStructure · object | null

Per-tier document set — the custom prompt set. Mirrors the admin TreeStructureUpdate validation without coupling this router to the admin package.

company_prompts
Company Prompts · object | null
workstream_prompts
Workstream Prompts · object | null
personal_prompt
string | null
detection_prompt
string | null
source_weights
Source Weights · object | null

Response

Successful Response

Filtered read view — only the customer-editable fields, never internal ones.

structure
Structure · object
required
prompts
Prompts · object
required
source_weights
Source Weights · object
required