Get a context
curl --request GET \
--url https://{host}/api/contexts/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/contexts/{slug}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/contexts/{slug}', 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://{host}/api/contexts/{slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/contexts/{slug}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/contexts/{slug}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/contexts/{slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"kind": "search",
"created_by": "<string>",
"description": "<string>",
"is_optimizing": true,
"has_sources": true,
"is_curating": true,
"is_importing": true,
"is_exploring": true,
"is_restoring": true,
"is_grooming": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"workspace": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": true,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": true
},
"keyword": {
"enabled": true
}
},
"artifacts": {
"enabled": false,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": [
"<string>"
],
"sections": [
"<string>"
],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": [
"<string>"
]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": [
"<string>"
]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
},
"search": {
"instructions": "<string>"
}
},
"semantic_index": "<string>",
"keyword_index": "<string>",
"optimize_task_id": "<string>",
"optimize_score": 123,
"optimize_iterations": 123,
"last_optimized_at": "2023-11-07T05:31:56Z",
"last_curated_at": "2023-11-07T05:31:56Z",
"last_source_import_at": "2023-11-07T05:31:56Z",
"curate_task_id": "<string>",
"import_task_id": "<string>",
"explore_task_id": "<string>",
"restore_task_id": "<string>",
"manifest_suggestion": {
"matches": [
{
"template_id": "<string>",
"rationale": "<string>",
"confidence": 123
}
],
"none": true,
"explored_at": "2023-11-07T05:31:56Z",
"task_id": "<string>"
},
"sample_queries": [
"<string>"
],
"groom_task_id": "<string>",
"groom_artifact_count": 123,
"last_groomed_at": "2023-11-07T05:31:56Z",
"stats": {
"tasks_total": 123,
"tasks_active": 123,
"tasks_completed": 123,
"tasks_failed": 123,
"tasks_cancelled": 123,
"tokens_total": 123,
"runtime_seconds": 123
}
}{
"message": "<string>",
"code": "<string>"
}Contexts
Get a context
One context and its derived lifecycle flags.
GET
/
contexts
/
{slug}
Get a context
curl --request GET \
--url https://{host}/api/contexts/{slug} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/contexts/{slug}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/contexts/{slug}', 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://{host}/api/contexts/{slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/contexts/{slug}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/contexts/{slug}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/contexts/{slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"kind": "search",
"created_by": "<string>",
"description": "<string>",
"is_optimizing": true,
"has_sources": true,
"is_curating": true,
"is_importing": true,
"is_exploring": true,
"is_restoring": true,
"is_grooming": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"workspace": "<string>",
"guide": "<string>",
"manifest": {
"curate": {
"chunks": {
"enabled": true,
"embedding_model": "multilingual-e5-large",
"chunking": {
"strategy": "markdown_heading",
"target_size": 512,
"overlap": 64,
"respect_sections": true
},
"keyword": {
"enabled": true
}
},
"artifacts": {
"enabled": false,
"artifact_model": "lite",
"artifact_types": [
{
"name": "<string>",
"kind": "topic",
"scope": "corpus",
"icon": "<string>",
"description": "<string>",
"coverage": [
"<string>"
],
"sections": [
"<string>"
],
"min_doc_count": 1,
"format": "markdown",
"columns": [
{
"name": "<string>",
"type": "TEXT",
"description": "<string>"
}
],
"natural_key": [
"<string>"
]
}
],
"edge_types": [
{
"name": "<string>",
"from": "<string>",
"to": "<string>",
"description": "<string>",
"attributes": [
"<string>"
]
}
],
"min_doc_count": 1,
"max_tokens": 1500,
"max_doc_chars": 60000,
"extraction_window_chars": 0,
"mention_max_chars": 400,
"max_mentions_per_artifact": 40,
"mention_context_chars": 8000,
"max_artifacts_per_type": 10000
}
},
"optimize": {
"schedule": "0 * * * *",
"latency_threshold_ms": 60000,
"min_group_size": 2,
"eval_pass_rate_threshold": 1,
"max_iterations": 20
},
"search": {
"instructions": "<string>"
}
},
"semantic_index": "<string>",
"keyword_index": "<string>",
"optimize_task_id": "<string>",
"optimize_score": 123,
"optimize_iterations": 123,
"last_optimized_at": "2023-11-07T05:31:56Z",
"last_curated_at": "2023-11-07T05:31:56Z",
"last_source_import_at": "2023-11-07T05:31:56Z",
"curate_task_id": "<string>",
"import_task_id": "<string>",
"explore_task_id": "<string>",
"restore_task_id": "<string>",
"manifest_suggestion": {
"matches": [
{
"template_id": "<string>",
"rationale": "<string>",
"confidence": 123
}
],
"none": true,
"explored_at": "2023-11-07T05:31:56Z",
"task_id": "<string>"
},
"sample_queries": [
"<string>"
],
"groom_task_id": "<string>",
"groom_artifact_count": 123,
"last_groomed_at": "2023-11-07T05:31:56Z",
"stats": {
"tasks_total": 123,
"tasks_active": 123,
"tasks_completed": 123,
"tasks_failed": 123,
"tasks_cancelled": 123,
"tokens_total": 123,
"runtime_seconds": 123
}
}{
"message": "<string>",
"code": "<string>"
}Authorizations
bearerAuthapiKey
Headers
Response
The context
What context endpoints return — the stored context plus the lifecycle flags derived from its in-flight tasks.
Was this page helpful?