Skip to main content
POST
/
api
/
v2
/
context
Context Search
curl --request POST \
  --url https://app.octavehq.com/api/v2/context \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "query": "How do you help with HIPAA compliance?",
  "additionalContext": {
    "person": {
      "firstName": "John",
      "lastName": "Doe",
      "title": "CISO",
      "email": "john.doe@healthcare.com"
    },
    "company": {
      "name": "Healthcare Corp",
      "domain": "healthcare.com"
    },
    "details": "Large healthcare provider in California"
  },
  "topK": 10,
  "rerank": "medium",
  "sources": {
    "library": {
      "enabled": true
    },
    "resources": {
      "enabled": true
    }
  },
  "tools": {
    "personProfile": {
      "enabled": false,
      "returnOutput": true,
      "guess": false
    },
    "companyProfile": {
      "enabled": false,
      "returnOutput": true
    },
    "companyResearch": {
      "enabled": false,
      "returnOutput": true
    },
    "personResearch": {
      "enabled": false,
      "returnOutput": true
    },
    "deepWebResearch": {
      "enabled": false,
      "returnOutput": true
    }
  },
  "agentTools": {
    "crmActivity": {
      "enabled": false
    }
  },
  "reasoning": {
    "perDocument": false,
    "overall": false
  }
}
'
import requests

url = "https://app.octavehq.com/api/v2/context"

payload = {
"query": "How do you help with HIPAA compliance?",
"additionalContext": {
"person": {
"firstName": "John",
"lastName": "Doe",
"title": "CISO",
"email": "john.doe@healthcare.com"
},
"company": {
"name": "Healthcare Corp",
"domain": "healthcare.com"
},
"details": "Large healthcare provider in California"
},
"topK": 10,
"rerank": "medium",
"sources": {
"library": { "enabled": True },
"resources": { "enabled": True }
},
"tools": {
"personProfile": {
"enabled": False,
"returnOutput": True,
"guess": False
},
"companyProfile": {
"enabled": False,
"returnOutput": True
},
"companyResearch": {
"enabled": False,
"returnOutput": True
},
"personResearch": {
"enabled": False,
"returnOutput": True
},
"deepWebResearch": {
"enabled": False,
"returnOutput": True
}
},
"agentTools": { "crmActivity": { "enabled": False } },
"reasoning": {
"perDocument": False,
"overall": False
}
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: 'How do you help with HIPAA compliance?',
additionalContext: {
person: {
firstName: 'John',
lastName: 'Doe',
title: 'CISO',
email: 'john.doe@healthcare.com'
},
company: {name: 'Healthcare Corp', domain: 'healthcare.com'},
details: 'Large healthcare provider in California'
},
topK: 10,
rerank: 'medium',
sources: {library: {enabled: true}, resources: {enabled: true}},
tools: {
personProfile: {enabled: false, returnOutput: true, guess: false},
companyProfile: {enabled: false, returnOutput: true},
companyResearch: {enabled: false, returnOutput: true},
personResearch: {enabled: false, returnOutput: true},
deepWebResearch: {enabled: false, returnOutput: true}
},
agentTools: {crmActivity: {enabled: false}},
reasoning: {perDocument: false, overall: false}
})
};

fetch('https://app.octavehq.com/api/v2/context', 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://app.octavehq.com/api/v2/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'How do you help with HIPAA compliance?',
'additionalContext' => [
'person' => [
'firstName' => 'John',
'lastName' => 'Doe',
'title' => 'CISO',
'email' => 'john.doe@healthcare.com'
],
'company' => [
'name' => 'Healthcare Corp',
'domain' => 'healthcare.com'
],
'details' => 'Large healthcare provider in California'
],
'topK' => 10,
'rerank' => 'medium',
'sources' => [
'library' => [
'enabled' => true
],
'resources' => [
'enabled' => true
]
],
'tools' => [
'personProfile' => [
'enabled' => false,
'returnOutput' => true,
'guess' => false
],
'companyProfile' => [
'enabled' => false,
'returnOutput' => true
],
'companyResearch' => [
'enabled' => false,
'returnOutput' => true
],
'personResearch' => [
'enabled' => false,
'returnOutput' => true
],
'deepWebResearch' => [
'enabled' => false,
'returnOutput' => true
]
],
'agentTools' => [
'crmActivity' => [
'enabled' => false
]
],
'reasoning' => [
'perDocument' => false,
'overall' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);

$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://app.octavehq.com/api/v2/context"

payload := strings.NewReader("{\n \"query\": \"How do you help with HIPAA compliance?\",\n \"additionalContext\": {\n \"person\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"title\": \"CISO\",\n \"email\": \"john.doe@healthcare.com\"\n },\n \"company\": {\n \"name\": \"Healthcare Corp\",\n \"domain\": \"healthcare.com\"\n },\n \"details\": \"Large healthcare provider in California\"\n },\n \"topK\": 10,\n \"rerank\": \"medium\",\n \"sources\": {\n \"library\": {\n \"enabled\": true\n },\n \"resources\": {\n \"enabled\": true\n }\n },\n \"tools\": {\n \"personProfile\": {\n \"enabled\": false,\n \"returnOutput\": true,\n \"guess\": false\n },\n \"companyProfile\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"companyResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"personResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"deepWebResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n }\n },\n \"agentTools\": {\n \"crmActivity\": {\n \"enabled\": false\n }\n },\n \"reasoning\": {\n \"perDocument\": false,\n \"overall\": false\n }\n}")

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

req.Header.Add("api_key", "<api-key>")
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.post("https://app.octavehq.com/api/v2/context")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"How do you help with HIPAA compliance?\",\n \"additionalContext\": {\n \"person\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"title\": \"CISO\",\n \"email\": \"john.doe@healthcare.com\"\n },\n \"company\": {\n \"name\": \"Healthcare Corp\",\n \"domain\": \"healthcare.com\"\n },\n \"details\": \"Large healthcare provider in California\"\n },\n \"topK\": 10,\n \"rerank\": \"medium\",\n \"sources\": {\n \"library\": {\n \"enabled\": true\n },\n \"resources\": {\n \"enabled\": true\n }\n },\n \"tools\": {\n \"personProfile\": {\n \"enabled\": false,\n \"returnOutput\": true,\n \"guess\": false\n },\n \"companyProfile\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"companyResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"personResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"deepWebResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n }\n },\n \"agentTools\": {\n \"crmActivity\": {\n \"enabled\": false\n }\n },\n \"reasoning\": {\n \"perDocument\": false,\n \"overall\": false\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.octavehq.com/api/v2/context")

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

request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"How do you help with HIPAA compliance?\",\n \"additionalContext\": {\n \"person\": {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"title\": \"CISO\",\n \"email\": \"john.doe@healthcare.com\"\n },\n \"company\": {\n \"name\": \"Healthcare Corp\",\n \"domain\": \"healthcare.com\"\n },\n \"details\": \"Large healthcare provider in California\"\n },\n \"topK\": 10,\n \"rerank\": \"medium\",\n \"sources\": {\n \"library\": {\n \"enabled\": true\n },\n \"resources\": {\n \"enabled\": true\n }\n },\n \"tools\": {\n \"personProfile\": {\n \"enabled\": false,\n \"returnOutput\": true,\n \"guess\": false\n },\n \"companyProfile\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"companyResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"personResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n },\n \"deepWebResearch\": {\n \"enabled\": false,\n \"returnOutput\": true\n }\n },\n \"agentTools\": {\n \"crmActivity\": {\n \"enabled\": false\n }\n },\n \"reasoning\": {\n \"perDocument\": false,\n \"overall\": false\n }\n}"

response = http.request(request)
puts response.read_body
{
  "_metadata": {
    "requestId": "requestId",
    "timestamp": "2021-01-01T00:00:00.000Z",
    "usage": 0,
    "message": "message"
  },
  "data": {
    "documents": [
      {
        "id": "<string>",
        "name": "<string>",
        "data": {},
        "score": 5,
        "reasoning": "<string>"
      }
    ],
    "reasoning": "<string>",
    "_debug": {
      "totalFetched": 123,
      "afterReranking": 123,
      "sourcesUsed": {
        "library": true,
        "resources": true,
        "tools": true
      },
      "timeTaken": 123,
      "tokenUsage": {
        "inputTokens": 123,
        "outputTokens": 123,
        "totalTokens": 123
      }
    }
  },
  "usage": 123,
  "found": true,
  "message": "<string>"
}
{
"_metadata": {
"requestId": "requestId",
"timestamp": "2021-01-01T00:00:00.000Z",
"usage": 0,
"message": "message"
},
"message": "<string>"
}
{
"_metadata": {
"requestId": "requestId",
"timestamp": "2021-01-01T00:00:00.000Z",
"usage": 0,
"message": "message"
},
"message": "<string>"
}

Authorizations

api_key
string
header
required

Body

application/json

Context search input with configuration

Context search input with inline configuration

query
string
required

Question or task to fetch context for

Minimum string length: 1
additionalContext
object | null

Optional person/company/details to enhance search

topK
number
rerank
enum<string>
Available options:
off,
low,
medium,
high,
best
sources
object
tools
object
agentTools
object
reasoning
object
commonContext
object | null

Response

Context search successful

_metadata
object
required
data
object
required
usage
number
required

Usage count for billing/credits

found
boolean
required

Whether the query was found

message
string
required

Message from the context agent