Ingest
curl --request POST \
--url https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"records": [
{
"source": "<string>",
"source_instance": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"source_id": "<string>",
"revised_at": "2023-11-07T05:31:56Z",
"container": {
"id": "<string>",
"name": "<string>",
"parent_id": "<string>"
},
"author": {
"name": "<string>",
"id": "<string>",
"bot": false
},
"participants": [
{
"name": "<string>",
"id": "<string>",
"bot": false
}
],
"metadata": {},
"configuration": {
"reasoning": {
"enabled": true,
"custom_instructions": "<string>"
}
},
"session_id": "<string>",
"peer_id": "<string>"
}
],
"derive": "now"
}
'import requests
url = "https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest"
payload = {
"records": [
{
"source": "<string>",
"source_instance": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"source_id": "<string>",
"revised_at": "2023-11-07T05:31:56Z",
"container": {
"id": "<string>",
"name": "<string>",
"parent_id": "<string>"
},
"author": {
"name": "<string>",
"id": "<string>",
"bot": False
},
"participants": [
{
"name": "<string>",
"id": "<string>",
"bot": False
}
],
"metadata": {},
"configuration": { "reasoning": {
"enabled": True,
"custom_instructions": "<string>"
} },
"session_id": "<string>",
"peer_id": "<string>"
}
],
"derive": "now"
}
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({
records: [
{
source: '<string>',
source_instance: '<string>',
created_at: '2023-11-07T05:31:56Z',
content: '<string>',
source_id: '<string>',
revised_at: '2023-11-07T05:31:56Z',
container: {id: '<string>', name: '<string>', parent_id: '<string>'},
author: {name: '<string>', id: '<string>', bot: false},
participants: [{name: '<string>', id: '<string>', bot: false}],
metadata: {},
configuration: {reasoning: {enabled: true, custom_instructions: '<string>'}},
session_id: '<string>',
peer_id: '<string>'
}
],
derive: 'now'
})
};
fetch('https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest', 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.honcho.dev/v3/workspaces/{workspace_id}/ingest",
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([
'records' => [
[
'source' => '<string>',
'source_instance' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'content' => '<string>',
'source_id' => '<string>',
'revised_at' => '2023-11-07T05:31:56Z',
'container' => [
'id' => '<string>',
'name' => '<string>',
'parent_id' => '<string>'
],
'author' => [
'name' => '<string>',
'id' => '<string>',
'bot' => false
],
'participants' => [
[
'name' => '<string>',
'id' => '<string>',
'bot' => false
]
],
'metadata' => [
],
'configuration' => [
'reasoning' => [
'enabled' => true,
'custom_instructions' => '<string>'
]
],
'session_id' => '<string>',
'peer_id' => '<string>'
]
],
'derive' => 'now'
]),
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.honcho.dev/v3/workspaces/{workspace_id}/ingest"
payload := strings.NewReader("{\n \"records\": [\n {\n \"source\": \"<string>\",\n \"source_instance\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"content\": \"<string>\",\n \"source_id\": \"<string>\",\n \"revised_at\": \"2023-11-07T05:31:56Z\",\n \"container\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_id\": \"<string>\"\n },\n \"author\": {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n },\n \"participants\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n }\n ],\n \"metadata\": {},\n \"configuration\": {\n \"reasoning\": {\n \"enabled\": true,\n \"custom_instructions\": \"<string>\"\n }\n },\n \"session_id\": \"<string>\",\n \"peer_id\": \"<string>\"\n }\n ],\n \"derive\": \"now\"\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.honcho.dev/v3/workspaces/{workspace_id}/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"records\": [\n {\n \"source\": \"<string>\",\n \"source_instance\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"content\": \"<string>\",\n \"source_id\": \"<string>\",\n \"revised_at\": \"2023-11-07T05:31:56Z\",\n \"container\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_id\": \"<string>\"\n },\n \"author\": {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n },\n \"participants\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n }\n ],\n \"metadata\": {},\n \"configuration\": {\n \"reasoning\": {\n \"enabled\": true,\n \"custom_instructions\": \"<string>\"\n }\n },\n \"session_id\": \"<string>\",\n \"peer_id\": \"<string>\"\n }\n ],\n \"derive\": \"now\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest")
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 \"records\": [\n {\n \"source\": \"<string>\",\n \"source_instance\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"content\": \"<string>\",\n \"source_id\": \"<string>\",\n \"revised_at\": \"2023-11-07T05:31:56Z\",\n \"container\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_id\": \"<string>\"\n },\n \"author\": {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n },\n \"participants\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n }\n ],\n \"metadata\": {},\n \"configuration\": {\n \"reasoning\": {\n \"enabled\": true,\n \"custom_instructions\": \"<string>\"\n }\n },\n \"session_id\": \"<string>\",\n \"peer_id\": \"<string>\"\n }\n ],\n \"derive\": \"now\"\n}"
response = http.request(request)
puts response.read_body{
"records": [
{
"index": 123,
"outcome": "created",
"reason": "stale_revision",
"record_id": "<string>",
"message_id": "<string>",
"session_id": "<string>",
"peer_id": "<string>",
"derivation": "pending"
}
],
"receipt": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}ingest
Ingest
Ingest source records as messages.
Honcho maps each record to a session and peers from its source context and
deduplicates it on its source identity (source_id, or a hash of its
content), so resending a batch is always safe. The response has one outcome
per record, in request order: created, duplicate, or rejected with a
reason. The workspace must be an auto workspace (created with auto: true).
Only workspace and admin keys may ingest: one batch can create sessions and
peers anywhere in the workspace.
Experimental: ingest may change or stop working without notice.
POST
/
v3
/
workspaces
/
{workspace_id}
/
ingest
Ingest
curl --request POST \
--url https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"records": [
{
"source": "<string>",
"source_instance": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"source_id": "<string>",
"revised_at": "2023-11-07T05:31:56Z",
"container": {
"id": "<string>",
"name": "<string>",
"parent_id": "<string>"
},
"author": {
"name": "<string>",
"id": "<string>",
"bot": false
},
"participants": [
{
"name": "<string>",
"id": "<string>",
"bot": false
}
],
"metadata": {},
"configuration": {
"reasoning": {
"enabled": true,
"custom_instructions": "<string>"
}
},
"session_id": "<string>",
"peer_id": "<string>"
}
],
"derive": "now"
}
'import requests
url = "https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest"
payload = {
"records": [
{
"source": "<string>",
"source_instance": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"source_id": "<string>",
"revised_at": "2023-11-07T05:31:56Z",
"container": {
"id": "<string>",
"name": "<string>",
"parent_id": "<string>"
},
"author": {
"name": "<string>",
"id": "<string>",
"bot": False
},
"participants": [
{
"name": "<string>",
"id": "<string>",
"bot": False
}
],
"metadata": {},
"configuration": { "reasoning": {
"enabled": True,
"custom_instructions": "<string>"
} },
"session_id": "<string>",
"peer_id": "<string>"
}
],
"derive": "now"
}
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({
records: [
{
source: '<string>',
source_instance: '<string>',
created_at: '2023-11-07T05:31:56Z',
content: '<string>',
source_id: '<string>',
revised_at: '2023-11-07T05:31:56Z',
container: {id: '<string>', name: '<string>', parent_id: '<string>'},
author: {name: '<string>', id: '<string>', bot: false},
participants: [{name: '<string>', id: '<string>', bot: false}],
metadata: {},
configuration: {reasoning: {enabled: true, custom_instructions: '<string>'}},
session_id: '<string>',
peer_id: '<string>'
}
],
derive: 'now'
})
};
fetch('https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest', 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.honcho.dev/v3/workspaces/{workspace_id}/ingest",
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([
'records' => [
[
'source' => '<string>',
'source_instance' => '<string>',
'created_at' => '2023-11-07T05:31:56Z',
'content' => '<string>',
'source_id' => '<string>',
'revised_at' => '2023-11-07T05:31:56Z',
'container' => [
'id' => '<string>',
'name' => '<string>',
'parent_id' => '<string>'
],
'author' => [
'name' => '<string>',
'id' => '<string>',
'bot' => false
],
'participants' => [
[
'name' => '<string>',
'id' => '<string>',
'bot' => false
]
],
'metadata' => [
],
'configuration' => [
'reasoning' => [
'enabled' => true,
'custom_instructions' => '<string>'
]
],
'session_id' => '<string>',
'peer_id' => '<string>'
]
],
'derive' => 'now'
]),
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.honcho.dev/v3/workspaces/{workspace_id}/ingest"
payload := strings.NewReader("{\n \"records\": [\n {\n \"source\": \"<string>\",\n \"source_instance\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"content\": \"<string>\",\n \"source_id\": \"<string>\",\n \"revised_at\": \"2023-11-07T05:31:56Z\",\n \"container\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_id\": \"<string>\"\n },\n \"author\": {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n },\n \"participants\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n }\n ],\n \"metadata\": {},\n \"configuration\": {\n \"reasoning\": {\n \"enabled\": true,\n \"custom_instructions\": \"<string>\"\n }\n },\n \"session_id\": \"<string>\",\n \"peer_id\": \"<string>\"\n }\n ],\n \"derive\": \"now\"\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.honcho.dev/v3/workspaces/{workspace_id}/ingest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"records\": [\n {\n \"source\": \"<string>\",\n \"source_instance\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"content\": \"<string>\",\n \"source_id\": \"<string>\",\n \"revised_at\": \"2023-11-07T05:31:56Z\",\n \"container\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_id\": \"<string>\"\n },\n \"author\": {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n },\n \"participants\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n }\n ],\n \"metadata\": {},\n \"configuration\": {\n \"reasoning\": {\n \"enabled\": true,\n \"custom_instructions\": \"<string>\"\n }\n },\n \"session_id\": \"<string>\",\n \"peer_id\": \"<string>\"\n }\n ],\n \"derive\": \"now\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honcho.dev/v3/workspaces/{workspace_id}/ingest")
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 \"records\": [\n {\n \"source\": \"<string>\",\n \"source_instance\": \"<string>\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"content\": \"<string>\",\n \"source_id\": \"<string>\",\n \"revised_at\": \"2023-11-07T05:31:56Z\",\n \"container\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_id\": \"<string>\"\n },\n \"author\": {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n },\n \"participants\": [\n {\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"bot\": false\n }\n ],\n \"metadata\": {},\n \"configuration\": {\n \"reasoning\": {\n \"enabled\": true,\n \"custom_instructions\": \"<string>\"\n }\n },\n \"session_id\": \"<string>\",\n \"peer_id\": \"<string>\"\n }\n ],\n \"derive\": \"now\"\n}"
response = http.request(request)
puts response.read_body{
"records": [
{
"index": 123,
"outcome": "created",
"reason": "stale_revision",
"record_id": "<string>",
"message_id": "<string>",
"session_id": "<string>",
"peer_id": "<string>",
"derivation": "pending"
}
],
"receipt": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"detail": "<string>"
}Ingest is experimental: this endpoint may change or stop working without notice. See Ingesting Source Records.
Authorizations
Body
application/json
Was this page helpful?