Developer Reference

API Documentation

Integrate Documind's AI-powered support into your applications. Triage tickets, draft responses, and chat with your knowledge base programmatically.

Base URL: https://documind.wentzel.ai

Authentication

Documind supports two authentication methods depending on your integration pattern.

Session Cookies
For dashboard users. Automatically managed by BetterAuth when signed in via the web UI. No additional headers needed.
API Keys
For programmatic access. Generate keys from your dashboard → API Keys page. Pass them via the Authorization header.
# API Key authentication
curl -H "Authorization: Bearer dm_live_..." \
     https://documind.wentzel.ai/api/v1/agent/triage
POST
/api/v1/agent/triage
Session or API Key
Classify and prioritize a support ticket by severity and product area using AI.

Request Body

{
  "text": "string (1-10,000 chars) — the ticket content",
  "workspaceId": "UUID — your workspace identifier"
}

Response

{
  "severity": "low | medium | high | critical",
  "productArea": "string",
  "summary": "string"
}

curl Example

curl -X POST https://documind.wentzel.ai/api/v1/agent/triage \
  -H "Authorization: Bearer dm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "text": "I cannot access the billing portal. It shows a 403 error when I click Manage Subscription.",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000"
  }'
POST
/api/v1/agent/draft
Session or API Key
Generate an on-brand response draft for a support ticket using your workspace knowledge base.

Request Body

{
  "ticketContext": "string (1-10,000 chars) — the ticket content",
  "brandTone": "string (optional) — e.g. 'professional', 'friendly'",
  "workspaceId": "UUID — your workspace identifier"
}

Response

{
  "draft": "string — the generated response"
}

curl Example

curl -X POST https://documind.wentzel.ai/api/v1/agent/draft \
  -H "Authorization: Bearer dm_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "ticketContext": "Customer is unable to access billing portal, gets 403 error.",
    "brandTone": "professional and empathetic",
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000"
  }'
POST
/api/v1/chat
Session or API Key
Stream a conversational AI response grounded in your workspace documentation via RAG.

Request Body

{
  "messages": [
    { "role": "user | model", "content": "string" }
  ],
  "workspaceId": "UUID — your workspace identifier",
  "conversationId": "UUID (optional) — attach to existing conversation"
}

Response

Streaming response with content type text/plain; charset=utf-8

Response Headers

HeaderDescription
X-Conversation-IdThe conversation ID (created if not provided)
X-Credits-RemainingCredits remaining in the current billing period
X-Credits-AllocationTotal credit allocation for the billing period
X-RateLimit-RemainingRequests remaining in the current rate-limit window

curl Example

curl -X POST https://documind.wentzel.ai/api/v1/chat \
  -H "Authorization: Bearer dm_live_..." \
  -H "Content-Type: application/json" \
  --no-buffer \
  -d '{
    "messages": [
      { "role": "user", "content": "How do I reset my password?" }
    ],
    "workspaceId": "550e8400-e29b-41d4-a716-446655440000"
  }'

Conversations

Manage chat conversations. All conversation endpoints require session-based authentication.

GET
/api/v1/conversations
Session only
List all conversations for a workspace.

Query Parameters

?workspaceId=UUID

Response

[
  {
    "id": "UUID",
    "workspaceId": "UUID",
    "userId": "string",
    "title": "string",
    "createdAt": "ISO 8601",
    "updatedAt": "ISO 8601"
  }
]
POST
/api/v1/conversations
Session only
Create a new conversation.

Request Body

{
  "workspaceId": "UUID",
  "title": "string (1-200 chars)"
}

Response
201

{
  "id": "UUID",
  "workspaceId": "UUID",
  "userId": "string",
  "title": "string",
  "createdAt": "ISO 8601",
  "updatedAt": "ISO 8601"
}
GET
/api/v1/conversations/[id]/messages
Session only
Retrieve all messages in a conversation.

Response

[
  {
    "id": "UUID",
    "role": "user | model",
    "content": "string",
    "createdAt": "ISO 8601"
  }
]
GET
/api/v1/conversations/[id]/export
Session only
Export a conversation as Markdown or JSON.

Query Parameters

?format=md | json   (default: md)

Response

File download. Content type is text/markdown or application/json depending on the format parameter.

Sources

Manage knowledge base data sources. Connect documentation from GitHub, Notion, Confluence, Zendesk, and more.

GET
/api/v1/sources
Session only
List all sources for a workspace, including document counts.

Query Parameters

?workspaceId=UUID

Response

[
  {
    "id": "UUID",
    "workspaceId": "UUID",
    "type": "website | github | notion | ...",
    "name": "string",
    "syncStatus": "pending | syncing | synced | error",
    "lastSyncedAt": "ISO 8601 | null",
    "documentsCount": 42,
    "createdAt": "ISO 8601"
  }
]
POST
/api/v1/sources
Session only
Connect a new data source to a workspace.

Request Body

{
  "workspaceId": "UUID",
  "type": "website | github | gitlab | notion | confluence | zendesk | jira | slack | google_drive | salesforce | fireflies | intercom",
  "name": "string — display name for the source",
  "config": { }  // type-specific configuration object
}

Response
201

{
  "id": "UUID",
  "workspaceId": "UUID",
  "type": "string",
  "name": "string",
  "syncStatus": "pending",
  "createdAt": "ISO 8601"
}
GET
/api/v1/sources/[id]/status
Session only
Check the sync status and document count for a specific source.

Response

{
  "syncStatus": "pending | syncing | synced | error",
  "lastSyncedAt": "ISO 8601 | null",
  "errorMessage": "string | null",
  "documentsCount": 42
}
GET
/api/v1/credits
Session only
Check remaining credits and optionally estimate cost for a text input.

Query Parameters

?workspaceId=UUID
&text=string (optional) — estimate credits for this text

Response

{
  "remaining": 48500,
  "allocation": 50000,
  "estimate": 120   // only present when "text" param is provided
}

Error Codes

All error responses follow a consistent shape: { "error": "message" }

CodeMeaning
400
Invalid request — malformed body or bad input
401
Unauthorized — no session cookie or API key provided
402
Credits exhausted — upgrade plan or purchase credit packs
403
Forbidden — authenticated but not a member of the workspace
404
Resource not found
429
Rate limited — exceeds 30 requests per minute per workspace
500
Internal server error — contact support

Rate Limits

30 requests per minute per workspace

Rate limits are applied per workspace, not per user. The X-RateLimit-Remaining response header indicates how many requests you have left in the current window. When exceeded, the API returns a 429 status code.

Credits & Billing

AI operations consume credits based on token usage with a 5x markup applied to raw token counts. Credits reset monthly on your billing date.

PlanMonthly Credits
Free50,000
Pro500,000

Need more? Purchase credit packs from your workspace Plans page for on-demand capacity.

Ready to Integrate?

Create your workspace and generate an API key to get started in minutes.