API Reference

The EchoKB API lets you search your knowledge bases and retrieve documents programmatically. All endpoints require authentication via API token.

Authentication

All API requests must include an API token in the Authorization header.

Token Authentication
Authorization: Token <your_api_token>

Create and manage tokens on the API Tokens page. Tokens are hashed on creation — store the token value when first displayed, as it cannot be retrieved later.

Get Document

Retrieve the full content of a document as markdown.

GET /api/v1/docs/:source_id
ParameterTypeRequiredDescription
source_iduuidYesSource UUID (path parameter). Also accepts legacy doc UUID for backward compatibility.

Response

Returns the document body as text/markdown; charset=utf-8.

curl

curl -H "Authorization: Token YOUR_TOKEN" \
  "https://echokb.com/api/v1/docs/SOURCE_ID"

Get Document URL

Retrieve the source URL for a document.

GET /api/v1/docs/:source_id/url
ParameterTypeRequiredDescription
source_iduuidYesSource UUID (path parameter). Also accepts legacy doc UUID for backward compatibility.

Response

{
  "success": true,
  "url": "https://example.com/document.pdf"
}

curl

curl -H "Authorization: Token YOUR_TOKEN" \
  "https://echokb.com/api/v1/docs/DOC_ID/url"

Errors

All errors return a consistent JSON response format.

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}
StatusCodeDescription
400INVALID_REQUESTMissing or invalid parameters
401UNAUTHORIZEDMissing, expired, or invalid token
403FORBIDDENToken valid but insufficient permissions
404NOT_FOUNDResource not found or not accessible
500INTERNAL_ERRORUnexpected server error

Search Syntax

Queries are processed through a Hebrew-aware stemmer before matching. You can pass natural Hebrew text — the stemmer handles normalization automatically.

FeatureDescriptionExample
Niqqud strippingDiacritical marks are removed before matchingשָׁלוֹם → שלומ
Final letter canonicalizationFinal forms (ך,ם,ן,ף,ץ) are normalized to standard formsחוזים → חוזימ
Prefix strippingCommon prefixes (ו,ה,ב,ל,כ,מ,ש and two-char combos) are stripped to generate variantsוהחוזה → חוזה, והחוזה
Plural suffix strippingPlural suffixes (ים, ות) are stripped from long-enough tokensחוזימ → חוז, חוזימ
Legal abbreviationsCourt/case-type abbreviations are expanded to full formsבגצ → בגצ OR בית_משפט_גבוה_לצדק
OR-joined BM25All variants are joined with OR for maximum recalltoken1 OR token2 OR token3