API DocsIntroduction
Getting Started

Developer API

Build on top of your own document sets. Upload and index documents, then ask natural-language questions and get answers grounded in those documents — with citations back to the source files and pages.

This reference covers the Document API (bearer-token, JSON) and the embeddable chatbot (an account-scoped cb_ key), which lives on the web app host.

Conventions

  • API request and response bodies are JSON (Content-Type: application/json), except the streaming chat response, which is Server-Sent Events.
  • A docset (docSetName) is a named collection of indexed documents.
  • Timestamps are ISO 8601 strings.
Try requests in the browser

Most endpoints have a Try it console. Open Authorize in the top bar to set your API token or chatbot cb_ key, then edit the body and send. Every request goes to the app host — Document API calls are forwarded through its proxy, which attaches the backend credential server-side, so there’s no CORS setup and the backend secret never reaches the browser. Admin endpoints (indexing and operations) are documented for reference but aren’t callable from this console.

Getting Started

Authentication

There are two credential types. Most API endpoints use a bearer API token; the embeddable chatbot uses an account-scoped cb_ key.

API token (Document API)

HTTP header
Authorization: Bearer YOUR_API_TOKEN

Document API requests are made against the app host and forwarded through its proxy (/api/v1/document_proxy/…), which authenticates your bearer token and attaches the backend credential server-side. Requests without a valid token are rejected with 401 Unauthorized. The proxy only forwards a safe set of query endpoints — the indexing and operations endpoints are documented for reference but aren’t reachable this way.

Chatbot key (cb_…)

HTTP header
Authorization: Bearer cb_1234567890abcdef…

The chatbot and support-email endpoints use an account-scoped key that starts with cb_, generated from the account’s chatbot settings. It is safe to embed in a public website widget: a key may be locked to an allowed Origin/Referer, the endpoints require a Pro or Business plan, and they are rate-limited (50/hour on Pro, 100/hour on Business).

Keep credentials secret

Treat the API token like a password — keep it server-side, never in client code. Only the cb_ chatbot key is designed to be exposed in a browser widget.

Getting Started

Errors

Errors are returned as JSON with an HTTP status code that reflects the problem.

Error shape (API)

application/json
{
  "message": "Add an authorization header to the request: \"bearer <token>\"",
  "errorCode": "UNAUTHENTICATED"
}

message is human-readable; errorCode is a stable, machine-readable code you can branch on. Some validation errors include additional context fields.

Common status codes

StatusMeaning
400Bad Request — the input was malformed.
401Unauthorized — missing or invalid credentials.
404Not Found — the requested resource does not exist.
409Conflict — the request clashes with current state.
422Unprocessable Entity — well-formed but could not be acted on.
503Service Unavailable — a required capability is disabled.
General

Health check

GET/health

Liveness probe for the API service. Public on the API itself, but the app proxy authenticates every request, so send your API token.

GET /health
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/health \
  -H "Authorization: Bearer $API_TOKEN"
Try itGET https://app.gg.env.docutrix.com/api/v1/document_proxy/health
General

Version

GET/version

Returns the running application version. Public on the API itself, but the app proxy authenticates every request, so send your API token.

GET /version
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/version \
  -H "Authorization: Bearer $API_TOKEN"
Try itGET https://app.gg.env.docutrix.com/api/v1/document_proxy/version
Chat

Ask a question (RAG)

POST/ask

Run a retrieval-augmented question against one or more docsets and get an answer grounded in the retrieved passages, with citations.

Multi-turn conversations

Pass the conversation so far in pastMessages (oldest first) to keep context. The current question goes in question, not in pastMessages.

Streaming

Set "stream": true (or send Accept: text/event-stream) to receive a Server-Sent Events stream of JSON chunks carrying incremental answer text, so a chat UI can render tokens as they arrive.

Citations

The answer contains inline markers like [1] that map to entries in citations by index. Each citation carries fileName, pageNumber, and source metadata.

Body parameters
question
string
Required
The user’s question.
docSetNames
string[]
Required
Docsets to search.
pastMessages
Message[]
Optional
Prior turns, oldest first. A Message is { "role": "user" | "assistant", "content": string }.
config
object
Optional
Retrieval/generation tuning — e.g. retrievalLimit, minimumSimilarityScore, model.
promptContext
string
Optional
Extra system context prepended to the prompt.
stream
boolean
Optional
Stream the answer as Server-Sent Events.
POST /ask
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/ask \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"question":"What is our refund policy?","docSetNames":["company-policies"]}'
Try itPOST https://app.gg.env.docutrix.com/api/v1/document_proxy/ask
Example response · 200
application/json
{
  "answer": "Refunds are available within 30 days of purchase [1].",
  "citations": [
    {
      "index": 1,
      "fileName": "refund-policy.pdf",
      "pageNumber": "2",
      "sourceType": "S3",
      "sourceMetadata": { "sourceId": "policies/refund-policy.pdf" }
    }
  ],
  "usage": { "inputTokens": 1234, "outputTokens": 88, "calls": 2, "perModel": [] }
}
Chat

Evaluate keyword routing

GET/keyword-routing/evaluate

Evaluate which docsets a query would route to via keyword rules, without running a full RAG query.

GET /keyword-routing/evaluate
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/keyword-routing/evaluate?question=refund%20policy \
  -H "Authorization: Bearer $API_TOKEN"
Chatbot

Ask the chatbot

POST/api/v1/chatbot/ask_question

The embeddable chatbot endpoint on the web app. Runs a retrieval-augmented question against the account’s docset and returns an answer with citations — authenticated with the account-scoped cb_ key.

Uses the cb_ chatbot key

Authenticate with the cb_ key (not the API token). Requires a Pro or Business plan, and — when the key has an allowed origin set — the request Origin/Referer must match it. Rate limited to 50/hour (Pro) or 100/hour (Business).

Pass prior turns in past_messages (oldest first; only the last 10 are used). Set stream to true to receive a text/event-stream of Server-Sent Events instead of a single JSON body. The docset is resolved from the account the key belongs to.

Body parameters
question
string
Required
The user’s question.
past_messages
Message[]
Optional
Prior turns as { role, content } objects (role is "user" or "assistant"). Only the last 10 are used.
format
string
Optional
text (default) returns Markdown; html returns rendered HTML.
stream
boolean
Optional
When true, responds with a Server-Sent Events stream.
POST /api/v1/chatbot/ask_question
curl -X POST https://app.gg.env.docutrix.com/api/v1/chatbot/ask_question \
  -H "Authorization: Bearer $CHATBOT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question":"What is the refund policy?","format":"text"}'
Try itPOST https://app.gg.env.docutrix.com/api/v1/chatbot/ask_question
Example response · 200
application/json
{
  "answer": "Refunds are available within 30 days of purchase [1].",
  "citations": [
    {
      "index": 1,
      "fileName": "refund-policy.pdf",
      "pageNumber": "2",
      "source": "https://files.example.com/refund-policy.pdf?signature=..."
    }
  ],
  "support_email": "support@example.com"
}
Chatbot

Send a support request

POST/api/v1/support_emails

Send a support message to the account’s configured support inbox — designed to back a “Contact support” action in a widget. Uses the cb_ chatbot key.

Body parameters
message
string
Required
The support message (maximum 2000 characters).
sender_email
string
Optional
Optional reply-to address for the requester.
POST /api/v1/support_emails
curl -X POST https://app.gg.env.docutrix.com/api/v1/support_emails \
  -H "Authorization: Bearer $CHATBOT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"I can’t find the onboarding guide.","sender_email":"customer@example.com"}'
Try itPOST https://app.gg.env.docutrix.com/api/v1/support_emails
Example response · 200
application/json
{
  "success": true,
  "message": "Your support request has been sent successfully. We'll get back to you soon!"
}
Summaries

Generate a conversation summary

POST/summary

Generate a short, descriptive title for a conversation — useful for naming chat threads in a sidebar.

Body parameters
pastMessages
Message[]
Required
The conversation to title, oldest first. A Message is { "role": "user" | "assistant", "content": string }.
POST /summary
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/summary \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pastMessages":[{"role":"user","content":"What is our refund policy?"},{"role":"assistant","content":"Refunds are available within 30 days."}]}'
Try itPOST https://app.gg.env.docutrix.com/api/v1/document_proxy/summary
Example response · 200
application/json
{ "title": "Refund policy window" }
Documents (API)

List documents

GET/documents

List the documents in a docset. Returns id, fileName, docSetName, source, indexingStatus, and timestamps.

GET /documents
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/documents?docSetName=company-policies \
  -H "Authorization: Bearer $API_TOKEN"
Example response · 200
application/json
[
  {
    "id": "doc_01HZX9...",
    "fileName": "refund-policy.pdf",
    "docSetName": "company-policies",
    "source": "S3",
    "indexingStatus": "COMPLETE",
    "createdAt": "2026-01-12T09:24:01.000Z",
    "updatedAt": "2026-01-12T09:24:18.000Z"
  }
]
Documents (API)

Recent documents

GET/documents/recent

List recently indexed documents. limit is optional (1–100, default 20).

GET /documents/recent
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/recent?limit=1 \
  -H "Authorization: Bearer $API_TOKEN"
Documents (API)

List docsets

GET/documents/docsets

List every docset with its source types and document counts.

GET /documents/docsets
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/docsets \
  -H "Authorization: Bearer $API_TOKEN"
Try itGET https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/docsets
Documents (API)

Docset metadata

GET/documents/metadata/{docSetName}

Return aggregate metadata for a single docset.

GET /documents/metadata/{docSetName}
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/metadata/company-policies \
  -H "Authorization: Bearer $API_TOKEN"
Try itGET https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/metadata/company-policies
Documents (API)

Indexing summary

GET/documents/indexing-summary

Summary of indexing status across docsets.

GET /documents/indexing-summary
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/indexing-summary \
  -H "Authorization: Bearer $API_TOKEN"
Documents (API)

Get document

GET/documents/{id}

Fetch a single document by id, or 404 if the id is unknown.

GET /documents/{id}
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/documents/123 \
  -H "Authorization: Bearer $API_TOKEN"
Indexing

Start indexing

POST/index

Index a docset from a source — S3 (default), SharePoint, or Google Drive. Runs asynchronously by default and returns a job id.

Body parameters
docSetName
string
Required
The docset to index into.
sourceType
enum
Optional
S3 (default), SHAREPOINT, or GOOGLEDRIVE.
credentials
object
Optional
Source credentials; shape depends on sourceType. Omit for S3 when the API has bucket access.
indexOptions
object
Optional
{ targetIndexTypes?, forceReindex? }.
async
boolean
Optional
Queue the job (true, default) or block until done (false).
accountName
string
Optional
Optional account/tenant label.
summaryModel
string
Optional
LLM used for document summarization.
POST /index
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"docSetName":"company-policies","sourceType":"S3"}'
Example response · 200
application/json
{ "message": "Indexing queued", "docSetName": "company-policies", "jobId": "..." }
Indexing

Check a source

POST/index/check-source

Validate connectivity and report how many supported files a source has, without indexing anything.

POST /index/check-source
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index/check-source \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"docSetName":"company-policies","sourceType":"S3"}'
Example response · 200
application/json
{ "sourceFileCount": 12, "existingDocumentCount": 0, "message": "Found 12 supported files." }
Indexing

Store SharePoint credentials

POST/index/credentials/sharepoint

Store the SharePoint credentials used to index a docset. The exact shape depends on your tenant’s app registration.

POST /index/credentials/sharepoint
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index/credentials/sharepoint \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"docSetName":"company-policies","tenantId":"...","clientId":"...","clientSecret":"..."}'
Indexing

Indexing progress

GET/index/progress/{docSetName}

Return document status counts and an isIndexing flag for a docset.

GET /index/progress/{docSetName}
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/progress/company-policies \
  -H "Authorization: Bearer $API_TOKEN"
Example response · 200
application/json
{
  "pendingCount": 3,
  "indexingCount": 1,
  "completedCount": 8,
  "errorCount": 0,
  "isIndexing": true
}
Indexing

Cancel indexing

POST/index/cancel/{docSetName}

Cancel an in-progress indexing run for a docset.

POST /index/cancel/{docSetName}
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index/cancel/company-policies \
  -H "Authorization: Bearer $API_TOKEN"
Indexing

Retry a document

POST/index/retry/{documentId}

Retry indexing a single failed document.

POST /index/retry/{documentId}
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index/retry/DOCUMENT_ID \
  -H "Authorization: Bearer $API_TOKEN"
Indexing

Reindex all

POST/index/reindex-all

Trigger a reindex of every document. Long-running.

POST /index/reindex-all
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index/reindex-all \
  -H "Authorization: Bearer $API_TOKEN"
Indexing

Delete docsets

DELETE/index/docsets

Delete one or more docsets and their indexed documents.

DELETE /index/docsets
curl -X DELETE https://app.gg.env.docutrix.com/api/v1/document_proxy/index/docsets \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"docSetNames":["company-policies"]}'
Indexing — Operations

Get consumer mode

GET/index/consumer

Return the current queue consumer mode.

GET /index/consumer
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/consumer \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Set consumer mode

POST/index/consumer

Set the queue consumer mode (e.g. pause or resume consumption).

POST /index/consumer
curl -X POST https://app.gg.env.docutrix.com/api/v1/document_proxy/index/consumer \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"paused"}'
Indexing — Operations

Active sessions

GET/index/sessions

List active indexing sessions.

GET /index/sessions
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/sessions \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Session detail

GET/index/sessions/{docSetName}

Return the indexing session detail for a docset.

GET /index/sessions/{docSetName}
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/sessions/company-policies \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Recovery log

GET/index/recovery-log

Return the indexing recovery log.

GET /index/recovery-log
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/recovery-log \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Abort log

GET/index/abort-log

Return the indexing abort log.

GET /index/abort-log
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/abort-log \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Watchdog status

GET/index/watchdog

Return the indexing watchdog status.

GET /index/watchdog
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/watchdog \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Queue status

GET/index/queues

Return queue status.

GET /index/queues
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/queues \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Queue stats

GET/index/queue-stats

Return queue statistics.

GET /index/queue-stats
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/queue-stats \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Stuck documents

GET/index/stuck-documents

List documents that appear stuck mid-indexing.

GET /index/stuck-documents
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/stuck-documents \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Document errors

GET/index/document-errors

List documents that errored during indexing.

GET /index/document-errors
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/document-errors \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Runtime config

GET/index/config

Return the indexer’s runtime configuration.

GET /index/config
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/config \
  -H "Authorization: Bearer $API_TOKEN"
Indexing — Operations

Document timeline

GET/index/document-timeline/{id}

Return the indexing timeline for a single document.

GET /index/document-timeline/{id}
curl https://app.gg.env.docutrix.com/api/v1/document_proxy/index/document-timeline/123 \
  -H "Authorization: Bearer $API_TOKEN"