Docstore API

Quickstart

Use this page when you want the practical version: what auth to send, which endpoints matter first, and how to call them from real code.

Authentication

Send your Docstore API key as a bearer token:

Authorization: Bearer YOUR_DOCSTORE_API_KEY

Most endpoints are tenant/workspace scoped. If your API key is already workspace-scoped, you may not need to send both IDs on every request, but it is still valid to do so.

Core endpoints

POST /api/v1/chat/
Ask a grounded question against workspace documents.

POST /api/v1/search/
Return relevant chunks and preferred source links.

POST /api/v1/documents/
Upload a file for ingestion.

POST /api/v1/urls/ingest/
Ingest one or more URLs.

POST /api/v1/documents/delete/
Soft-delete documents visible to the current workspace.

POST /api/v1/support/channel-lookup/
Resolve support phone numbers to tenant/workspace context.

POST /api/v1/support/shipping/bot-lookup/
Resolve shipping/package questions through the tenant shipping manager.

POST /api/v1/support/email/agentmail/inbound/
Receive inbound support email events from AgentMail.

Multi-workspace ingest

Docstore can ingest a document once and assign it to multiple workspaces without duplicating the file, versions, chunks, or embeddings.

{
  "tenant_id": 2,
  "workspace_id": 3,
  "additional_workspace_ids": [4, 5],
  "collection": "hr"
}

The response includes assigned_workspace_ids so you can confirm where the document is available.

Support and integrations

Shipping manager
Tenant-scoped shipping integrations can power package lookup workflows across bots, voice, support email, and internal support tools.

Support email
AgentMail-backed tenant inboxes can ingest inbound email into support conversations and send replies from the same inbox identity.

Connectors and delivery surfaces
Docstore can connect source systems like Google Drive / Dropbox / SharePoint and deliver answers into chatbots, voice, support inboxes, and dashboard workflows.

Python

import requests

BASE_URL = "https://docstore.oddsmith.net"
API_KEY = "YOUR_DOCSTORE_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

chat_response = requests.post(
    f"{BASE_URL}/api/v1/chat/",
    json={
        "tenant_id": 2,
        "workspace_id": 3,
        "question": "What is the PTO policy?",
        "top_k": 5,
    },
    headers=HEADERS,
    timeout=60,
)
chat_response.raise_for_status()
print(chat_response.json())

Node.js

const fs = require('fs');
const FormData = require('form-data');

const BASE_URL = 'https://docstore.oddsmith.net';
const API_KEY = 'YOUR_DOCSTORE_API_KEY';

async function run() {
  const form = new FormData();
  form.append('tenant_id', '2');
  form.append('workspace_id', '3');
  form.append('additional_workspace_ids', '4');
  form.append('additional_workspace_ids', '5');
  form.append('collection', 'hr');
  form.append('file', fs.createReadStream('employee-handbook.pdf'));

  const response = await fetch(`${BASE_URL}/api/v1/documents/`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      ...form.getHeaders(),
    },
    body: form,
  });

  console.log(await response.json());
}

run().catch(console.error);

.NET / C#

using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;

var baseUrl = "https://docstore.oddsmith.net";
var apiKey = "YOUR_DOCSTORE_API_KEY";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);

var payload = new
{
    tenant_id = 2,
    workspace_id = 3,
    question = "What is the PTO policy?",
    top_k = 5
};
var json = JsonSerializer.Serialize(payload);
var response = await client.PostAsync(
    $"{baseUrl}/api/v1/chat/",
    new StringContent(json, Encoding.UTF8, "application/json")
);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());