Skip to main content
POST
/
training
/
search
Semantic search across training and knowledge base
curl --request POST \
  --url https://api.open.cx/training/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "limit": 10,
  "visibility": [],
  "sourceTypes": [],
  "dataSources": [],
  "sortBy": "relevance",
  "dateFrom": "<unknown>",
  "dateTo": "<unknown>",
  "include_content": true
}
'
import requests

url = "https://api.open.cx/training/search"

payload = {
"query": "<string>",
"limit": 10,
"visibility": [],
"sourceTypes": [],
"dataSources": [],
"sortBy": "relevance",
"dateFrom": "<unknown>",
"dateTo": "<unknown>",
"include_content": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
query: '<string>',
limit: 10,
visibility: [],
sourceTypes: [],
dataSources: [],
sortBy: 'relevance',
dateFrom: '<unknown>',
dateTo: '<unknown>',
include_content: true
})
};

fetch('https://api.open.cx/training/search', 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.open.cx/training/search",
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' => '<string>',
'limit' => 10,
'visibility' => [

],
'sourceTypes' => [

],
'dataSources' => [

],
'sortBy' => 'relevance',
'dateFrom' => '<unknown>',
'dateTo' => '<unknown>',
'include_content' => true
]),
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.open.cx/training/search"

payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 10,\n \"visibility\": [],\n \"sourceTypes\": [],\n \"dataSources\": [],\n \"sortBy\": \"relevance\",\n \"dateFrom\": \"<unknown>\",\n \"dateTo\": \"<unknown>\",\n \"include_content\": true\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.open.cx/training/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 10,\n \"visibility\": [],\n \"sourceTypes\": [],\n \"dataSources\": [],\n \"sortBy\": \"relevance\",\n \"dateFrom\": \"<unknown>\",\n \"dateTo\": \"<unknown>\",\n \"include_content\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.open.cx/training/search")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 10,\n \"visibility\": [],\n \"sourceTypes\": [],\n \"dataSources\": [],\n \"sortBy\": \"relevance\",\n \"dateFrom\": \"<unknown>\",\n \"dateTo\": \"<unknown>\",\n \"include_content\": true\n}"

response = http.request(request)
puts response.read_body
{
  "results": [
    {
      "id": "<string>",
      "title": "<string>",
      "source_url": "<string>",
      "updated_at": "2023-11-07T05:31:56Z",
      "stream": "<string>",
      "relevance_score": 50,
      "directory_id": "<string>",
      "directory_name": "<string>",
      "usage_count": 0,
      "content_preview": "<string>",
      "content": "<string>",
      "is_draft": true,
      "restricted_to_segments": [
        "<string>"
      ],
      "restricted_to_channels": [
        "<string>"
      ],
      "start_time": "2023-11-07T05:31:56Z",
      "end_time": "2023-11-07T05:31:56Z"
    }
  ],
  "total_count": 123
}
{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
string
required
Required string length: 2 - 500
limit
number
default:10
Required range: 1 <= x <= 50
visibility
enum<string>[]
Available options:
internal,
public
sourceTypes
enum<string>[]
Available options:
custom_training,
help_center,
integration,
website
dataSources
enum<string>[]
Available options:
confluence,
notion,
zendesk_support,
shopify,
gitbook,
intercom,
front,
freshdesk,
hubspot_kb,
ai_instructions,
custom_training,
website
sortBy
enum<string>
default:relevance
Available options:
relevance,
handoffs,
citations
dateFrom
any
dateTo
any
include_content
boolean
default:true

Include the full content field in results. Set to false to reduce response size.

Response

Default Response

results
object[]
required
total_count
number
required