Update brain generation settings
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": {},
"domain": "<string>"
}
'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": {},
"domain": "<string>"
}
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: {},
domain: '<string>'
})
};
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' => [
],
'domain' => '<string>'
]),
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 \"domain\": \"<string>\"\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 \"domain\": \"<string>\"\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 \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"structure": {},
"prompts": {},
"source_weights": {},
"domain": "<string>",
"detected_domain": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Context Documents
Update brain generation settings
Update the supplied generation settings.
Changes apply to the next generation. This endpoint does not start a generation or modify existing context documents.
PATCH
/
context-documents
/
config
Update brain generation settings
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": {},
"domain": "<string>"
}
'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": {},
"domain": "<string>"
}
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: {},
domain: '<string>'
})
};
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' => [
],
'domain' => '<string>'
]),
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 \"domain\": \"<string>\"\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 \"domain\": \"<string>\"\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 \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"structure": {},
"prompts": {},
"source_weights": {},
"domain": "<string>",
"detected_domain": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
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.
Headers
Optionally set this header to act as a specific user when using an API Key, equivalent to first exchanging the API Key for a User Token
Body
application/json
Customer-editable generation settings. Only supplied fields are updated.
Per-tier document definitions for custom generation.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I