Lincoln Cannon LLC

Knowledge API Integration Guide

Schemas and Try it: API Reference (knowledge). This page is an Integration Guide. Related: Agent API Integration Guide · SSO Integration Guide

Manage organization knowledge sources for your Lincoln Cannon LLC account: named libraries, website consumers, and which sources each agent or site may use. This is not the chat/agent API — for that see Agent API Integration Guide.

Base URL: https://api.lincolncannon.co/knowledge. If your integration contact gives you a non-production API base, use https://api-dev.lincolncannon.co/knowledge instead.

Authentication

Send one of:

HeaderWho
Authorization: Bearer <id_token>Organization owner account, or an additional mailbox your integration contact configures. Obtain tokens per SSO Integration Guide.
x-api-keyAPI key your integration contact issued for your account.

Do not send an invalid or expired Bearer token together with an API key — a present Bearer that fails is not ignored. Missing credentials → Authorization required, except POST /search (browser site search may send Origin only; see Search).

CORS: the API echoes a valid Origin on responses. Browser preflight is handled automatically.

Sources

A source is one library. Lincoln Cannon LLC assigns the id (UUID). name is required, unique in your account (case-insensitive), and may be renamed.

Supported types:

typeclassUse
curatedcuratedNamed notes library (agents and humans write documents later)
uploadreadonlyNamed upload library (presigned file ingest)
urlreadonlyPublic website library (native Web Crawler; seed URLs and/or sitemaps)
gdrivereadonlyGoogle Drive library (OAuth connect + native Drive ingest)
zendeskreadonlyZendesk Help Center library (OAuth connect + article export)

Unknown type values are rejected: type must be one of: curated, gdrive, upload, url, zendesk. class must match the type (for example class must be curated for type curated, class must be readonly for type url, class must be readonly for type gdrive). class and type cannot be changed after create.

Public source JSON (success bodies). Fields may grow; ignore unknown keys. Responses never include OAuth tokens.

FieldNotes
idSource UUID
nameHuman-facing name
descriptionOptional. Up to 280 characters. What the library contains and when to use it. Empty or omitted on create stores nothing. PUT "" clears. Omitted on PUT leaves the stored value unchanged.
classcurated or readonly
typecurated, gdrive, upload, url, or zendesk
enabledDefaults true
seedUrlshttps seed URLs (type=url only; max 10)
siteMapUrlshttps sitemap URLs (type=url only; max 3)
syncScheduleNative ingest cadence (type=url and type=gdrive): object shapes such as { "daily": {} }, { "weekly": { "dayOfWeek": "MONDAY" } }, or { "monthly": { "dayOfMonth": { "dayNumber": 15 } } }
subdomainZendesk account subdomain (type=zendesk only; set from the Integration connector, not by create/PUT body)
oauthConnectedAtISO timestamp when the source’s Integration connector grant is connected
localeZendesk Help Center locale (default en-us, type=zendesk only)
publicBaseUrlhttps origin used to rewrite public article URLs (type=zendesk only)
categoryIdsOptional Zendesk category ids to export (type=zendesk only)
autoExportEnabledWhen true, Lincoln Cannon LLC exports on autoExportExpression
autoExportExpressionrate(6 hours), rate(12 hours), or rate(1 day)
lastExportAtISO timestamp of the last export attempt (type=zendesk only)
lastExportStatuscomplete, complete_with_warnings, failed, or in_progress

Creating a source with this API grants no agents or sites. Associate them separately. Creating an agent (management UI or repository sync your integration contact enables) also creates a curated source named after that agent. For repository-managed agents, list associated source names in the agent definition your contact supplies (knowledgeSources); that list is the complete set after each sync — see Agent API Integration Guide.

GET /sources

List sources for the authenticated account.

POST /sources

JSON body:

{ "name": "Scratch notes", "class": "curated", "type": "curated", "enabled": true, "description": "Private working notes." }

enabled may be omitted (defaults true).

Website crawler:

{
  "name": "Docs site",
  "class": "readonly",
  "type": "url",
  "seedUrls": ["https://docs.example.com/"],
  "syncSchedule": { "daily": {} }
}

At least one of seedUrls (max 10) or siteMapUrls (max 3) is required. syncSchedule is required: { "daily": {} }, { "weekly": { "dayOfWeek": "MONDAY" } } (SUNDAY–SATURDAY), or { "monthly": { "dayOfMonth": { "dayNumber": 15 } } } (1–28) / { "lastDayOfMonth": {} }. Those fields on other types return Web Crawler fields are only valid for type url (except syncSchedule on type=gdrive). Creating a crawler source does not start a crawl. Each seed origin must publish robots.txt before POST /sources/{id}/sync; missing robots.txt is robots.txt is required. Typical create errors: seedUrls or siteMapUrls is required, syncSchedule is required, seedUrls must be https URLs, seedUrls max is 10.

Google Drive and Zendesk require a connected Integration connector in your account before create. Create and connect the connector on the Integration API (https://api.lincolncannon.co/integration, or https://api-dev.lincolncannon.co/integration when your integration contact gives you a dev base). Drive connectors must use read privilege. Zendesk connectors may be read (export-only) or read_write.

Google Drive:

{
  "name": "Drive",
  "class": "readonly",
  "type": "gdrive",
  "connectors": [{ "name": "Drive" }],
  "syncSchedule": { "daily": {} },
  "driveInclude": { "folders": ["https://drive.google.com/drive/folders/FOLDER_ID"] }
}

connectors is required for type=gdrive: exactly one { "name": "…" } naming an existing gdrive connector with read privilege and a stored credential. Omit, empty, or more than one entry returns connectors must be an array of one name. Typical errors: connector was not found, connector type does not match knowledge source, connector is not connected.

syncSchedule is required (same daily / weekly / monthly shapes as website sources). driveInclude is required: exactly one of { "allAccessible": {} } (My Drive and files shared with the connected Google user) or { "folders": ["…"] } (Drive folder https URLs or folder ids, max 10). GET returns folder ids, not the URLs you sent. driveInclude on other types returns Google Drive fields are only valid for type gdrive. Creating a Drive source does not start ingest until the connector is connected; then call POST /sources/{id}/sync. Recurring ingest follows syncSchedule. Drive access-control lists are not used as a security boundary: associating this source with an agent or site can surface files the connected Google user can access. The connector indexes Google Docs, Sheets, and common document types (plain text, Markdown, HTML, PDF, CSV, Word, Excel); it does not index images, audio, or video.

Zendesk Help Center:

{
  "name": "Help Center",
  "class": "readonly",
  "type": "zendesk",
  "connectors": [{ "name": "Help Center export" }]
}

connectors is required for type=zendesk: exactly one { "name": "…" } naming an existing zendesk connector. Do not send subdomain on create — Lincoln Cannon LLC copies the Zendesk account id from the connector after the grant succeeds (subdomain on GET is the account hostname prefix).

Optional Zendesk export fields on create or update: categoryIds (numeric strings), autoExportEnabled, autoExportExpression. autoExportExpression must be rate(6 hours), rate(12 hours), or rate(1 day), and is required when autoExportEnabled is true. Locale and public article base URL come from the Integration connector at connect time, not from Knowledge create. Those export fields on curated, upload, or url return Zendesk export fields are only valid for type zendesk.

Creating a Zendesk source grants no agents or sites and does not run export until the named connector is connected (Integration connect below) and oauthConnectedAt is set.

GET /sources/{id}

{id} is the source UUID.

PUT /sources/{id}

JSON body (all optional): { "name": "New name", "enabled": false, "description": "What this source contains." }. Send description: "" to clear. Do not send subdomain — it is set by the Integration connector (subdomain is set by the Integration connector). Zendesk sources may also send locale, publicBaseUrl, categoryIds, autoExportEnabled, autoExportExpression. Website sources may send seedUrls, siteMapUrls, syncSchedule. Google Drive sources may send syncSchedule and driveInclude. Sending class or type returns class cannot be changed / type cannot be changed.

DELETE /sources/{id}

Deletes the source, its associations, files in that source, and (for Zendesk) stored connect tokens.

Upload and curated files

type=upload and type=curated sources accept documents through these file routes. You PUT bytes to a short-lived URL. Lincoln Cannon LLC assigns each file a fileId (UUID). Inventory name is a relative POSIX path unique in that source (handbook.md, about.html, support/pricing.html). Folders are not separate objects — group on / in name. File list is this inventory API — not a search of the source.

Tree replace-set routes (files/sync, files/sync-start, files/sync-end) apply only to type=upload. On a curated library those calls return source type must be upload.

GET /sources/{id}/files lists content for every source type. Optional query: prefix (path prefix, for example support/), cursor (the last name from the previous page), limit (default 100, maximum 500). When more names remain, the response includes cursor. Ignore unknown item keys.

  • upload and curated: files you added (fileId is a UUID; name is a relative POSIX path).
  • zendesk: Help Center articles in this source (name like 200-reset-password.md). GET /sources/{id}/files/{fileId} includes downloadUrl for the article markdown when export has finished.
  • url: the seed URLs and sitemap URLs configured on the source (name and url are that URI).
  • gdrive: the inclusion rule: one item named allAccessible, or one item per Drive folder id.

GET /sources/{id}/files/{fileId} returns file was not found for website and Google Drive sources — those lists are inclusion rules, not stored files.

Create, replace, complete, delete, and tree sync still apply only to type=upload and type=curated. Those calls on other types return source type must be upload or curated (tree sync: source type must be upload).

Allowed extensions: .txt, .md, .html, .htm, .pdf, .csv, .doc, .docx, .xls, .xlsx. Maximum 50 MB (byteSize ≤ 52428800). Images, audio, video, .json, and sidecar names (*.metadata.json) are rejected. name must not start with /, contain .., or be a sidecar path.

CSV: On type=upload, csvMode is required. file indexes the CSV as one document. rows indexes each data row as its own document (maximum 100000 data rows). Empty or oversized text cells are skipped. columnMap is only valid for csvMode rows. On type=curated, CSV is always csvMode file (omit csvMode, or send file; rows returns csvMode must be file). Non-CSV files must omit csvMode.

For csvMode rows, columnMap names CSV headers. You may omit it: complete infers url, title, date, and year from those headers when present, and topic maps to title when title is absent. text defaults to text. Fields you send are kept. Extra CSV columns (for example platform) are stored as metadata. Extra columns with reserved names (for example url_exists) are ignored. Do not send reserved names on the request (for example sourceId or url_exists); the API rejects them.

HTML: On type=upload, htmlMode is required. file indexes the whole page. extract indexes a unique <article>, else unique <main>, else <body>. You PUT and download the original page either way. For extract, complete writes that extract for indexing (same idea as csvMode rows keeping the original CSV). byteSize is the size of the PUT. On type=curated, omit htmlMode to default to file. Non-HTML files must omit htmlMode.

Optional sidecar fields on initiate/replace/sync: url (https), title, date (ISO). Do not send sourceId or url_exists. Do not upload a .metadata.json file. If url / title / date are omitted at complete, Knowledge infers them from the uploaded object when it can (HTML: canonical URL; unique <h1> else <title>; <time datetime> else created-date meta article:published_time / dcterms.created / date, else YYYY-MM-DD in the file name; PDF: Info Title, CreationDate else ModDate, Subject when it is an https URL; PDF title falls back to the file name).

Optional contentMd5: 32-character hex MD5 of the bytes. Required to skip an unchanged file on POST /sources/{id}/files/sync.

Public file JSON (ignore unknown keys). Never includes object keys or index identifiers.

FieldNotes
fileIdFile UUID
nameRelative POSIX path unique in this source
byteSizeExact size in bytes; must match the PUT
contentMd5Echoed when you sent it
createdAtISO timestamp when the file was first created
expandStatuspending until complete is accepted; rows then expanding or queued, then complete
rowCountPresent for csvMode rows when expandStatus is complete
csvModePresent for CSV (file or rows)
htmlModePresent for HTML (file or extract)
columnMapPresent for csvMode rows
url, title, dateEchoed when you sent them or when complete inferred them

downloadUrl appears on GET (and complete) when expandStatus is complete, expanding, or queued. Website and Google Drive list items do not include downloadUrl.

GET /sources/{id}/files

See the list rules at the start of this section. Optional query: prefix, cursor, limit.

POST /sources/{id}/files

Start an upload, or replace the existing file when name already exists in this source (case-insensitive). JSON body (required name, byteSize):

{ "name": "support/handbook.md", "byteSize": 12 }

CSV:

{ "name": "social-posts.csv", "byteSize": 4096, "csvMode": "file" }

HTML htmlMode file:

{ "name": "about.html", "byteSize": 12, "htmlMode": "file" }

HTML htmlMode extract:

{ "name": "about.html", "byteSize": 12, "htmlMode": "extract" }

csvMode rows:

{ "name": "social-posts.csv", "byteSize": 4096, "csvMode": "rows" }

Optional columnMap when headers are not text / url / title / date / year (or topic for title):

{
  "name": "social-posts.csv",
  "byteSize": 4096,
  "csvMode": "rows",
  "columnMap": { "text": "body", "url": "permalink", "title": "headline", "date": "published" }
}

Success includes uploadUrl and uploadHeaders. HTTP PUT the bytes to uploadUrl with those headers (Content-Type and Content-Length). Then call complete.

Typical errors: source was not found, source type must be upload or curated, name is required, name must have a document extension (csv, doc, docx, htm, html, md, pdf, txt, xls, xlsx), name must be a relative file path, name must not be a sidecar path, byteSize must be a positive integer, byteSize exceeds maximum (50 MB), contentMd5 must be a 32-character hex MD5, csvMode is required, csvMode must be file or rows, csvMode must be file, csvMode is only valid for CSV files, htmlMode is required, htmlMode must be file or extract, htmlMode is only valid for HTML files, columnMap is only valid for csvMode rows, columnMap must be an object, columnMap has unknown fields, url must be an https URL, sourceId is not allowed on the request, url_exists is not allowed on the request.

POST /sources/{id}/files/sync-start

Empty body. type=upload only. Holds object-change ingest until sync-end so a tree upload is not indexed halfway. 409: sync is in progress or expand is in progress. Typical error on a curated library: source type must be upload.

Success: { "started": true }.

POST /sources/{id}/files/sync

JSON body: { "items": [ { "name", "byteSize", "contentMd5"?, "url"?, "title"?, "date"?, "csvMode"?, "columnMap"?, "htmlMode"? } ] }. This is a replace-set: names not listed are deleted. Files whose stored byteSize, contentMd5, csvMode / htmlMode, and expandStatus complete match are unchanged, unless the request sends url and it differs from the stored sidecar URL (then upload). Others are upload (presigned PUT). Do not send file bytes in this request. Each response mutates at most 25 uploads and 25 deletes so the call stays inside the HTTP time limit. remaining is how many listed-or-extra files still need a mutation. Repeat this same body until remaining is 0, PUT + complete each upload batch in between, then call sync-end.

Success:

{
  "upload": [{ "name": "about.html", "fileId": "<uuid>", "uploadUrl": "https://…", "uploadHeaders": { "Content-Type": "text/html", "Content-Length": "12" } }],
  "delete": [{ "fileId": "<uuid>", "name": "old.html" }],
  "unchanged": [{ "fileId": "<uuid>", "name": "support/pricing.html" }],
  "remaining": 0
}

PUT only upload, then complete each. Typical errors: items must be an array, items exceeds maximum, items must not contain duplicate names, plus the same field errors as create.

POST /sources/{id}/files/sync-end

Empty body. Releases the hold from sync-start and queues indexing once. 409: sync has remaining files — remaining is still greater than 0, or an upload from this sync is still pending (PUT + complete it). Repeat files/sync until remaining is 0 and complete every upload.

Success: { "ended": true }.

GET /sources/{id}/files/{fileId}

{fileId} is the file UUID for upload, curated, and zendesk. When expandStatus is complete, expanding, or queued for csvMode rows, the body includes downloadUrl. Website and Google Drive sources return file was not found.

POST /sources/{id}/files/{fileId}

Replace the same fileId. Same body as create. Returns a new uploadUrl. Call complete after PUT. Sending another file’s name returns name is already in use.

POST /sources/{id}/files/{fileId}/complete

Empty body. Confirms the PUT, writes file metadata, and queues indexing. PUT must already have succeeded with the same byteSize. For htmlMode extract, complete indexes a unique <article>, else <main>, else <body>; downloadUrl is still the original page you uploaded. For htmlMode file, the whole page is indexed. For csvMode rows, complete starts row expansion (expandStatus expanding) or returns queued if another CSV on this source is already expanding — you do not wait. Expansion continues after sync-end. If you omitted columnMap, complete infers it from the CSV headers and returns the map.

Typical errors: uploaded object was not found, uploaded object size does not match byteSize, uploaded object content type does not match, csv has no text column, csv exceeds maximum rows (100000), csv is unreadable. 409: expand is in progress (this file is already expanding).

DELETE /sources/{id}/files/{fileId}

Deletes that file and its inventory row. Typical error: file was not found.

Integration connect (Drive and Zendesk)

Drive and Zendesk OAuth live on the Integration API. Your integration contact creates a connector (or enables you to create one), then you name that connector on POST /sources.

  1. POST https://api.lincolncannon.co/integration/connectors (or the development API base) with type, name, and privilege (read for Drive; read or read_write for Zendesk). Same Bearer or x-api-key as Knowledge.
  2. GET …/integration/connectors/{id}/oauth/start (optional returnTo https URL that your integration contact has approved). Open the returned authorizeUrl in a browser and complete provider consent.
  3. The browser finishes on https://api.lincolncannon.co/integration/oauth/callback (development: https://api-dev.lincolncannon.co/integration/oauth/callback). When returnTo was set, you are redirected back with a short result code (connected, oauth_denied, etc.).

After the connector stores a credential, create or update the Knowledge source with connectors: [{ "name": "…" }] using that connector name. oauthConnectedAt on GET /sources/{id} means the grant is active. Swap connectors with PUT …/integration/consumers/knowledge/{sourceId}/connectors (exactly one connector id).

POST /sources/{id}/sync

Queues a Zendesk Help Center article export for a connected Zendesk source, a website crawl for a type=url source, or a Google Drive ingest for a connected type=gdrive source. Empty body.

Success:

{ "id": "<source-uuid>", "queued": true }

Typical errors: source was not found, source type must be zendesk, url, or gdrive, source is disabled, robots.txt is required, Zendesk is not connected., Google Drive is not connected.. 503 means the sync feature is unavailable for your account — contact your integration contact.

For Zendesk, published articles are written into this source. Missing title or URL, oversized articles, and per-article failures are skipped; the export still completes (lastExportStatus: complete_with_warnings). Token, Help Center API, or storage failures fail the run (lastExportStatus: failed). A second overlapping export is skipped when the first is still running.

For a website source, Lincoln Cannon LLC starts a crawl of the seed URLs and sitemaps. Recurring crawls follow syncSchedule. Publish robots.txt at each seed origin (missing robots.txt is disallow). The crawler does not index images, audio, or video.

For a Google Drive source, Lincoln Cannon LLC starts ingest according to driveInclude: the listed folders, or (when allAccessible) My Drive and files shared with the connected Google user. Recurring ingest follows syncSchedule. Drive access-control lists are not used as a security boundary. The connector does not index images, audio, or video.

Site consumers

A site consumer is a website that may search associated sources. origins must be https origins (scheme + host; paths are ignored). Example: https://www.example.com. Each origin may belong to at most one site consumer across accounts — origin is already in use.

Public site JSON: { "id", "name", "kind": "site", "origins": ["https://www.example.com"] }.

MethodPathBody
GET/consumers/site—
POST/consumers/site{ "name": "Marketing site", "origins": ["https://www.example.com"] }
GET/consumers/site/{id}—
PUT/consumers/site/{id}{ "name"?: string, "origins"?: string[] }
DELETE/consumers/site/{id}—

Deleting a site consumer also drops its source associations. Sources remain.

Agents are consumers too, but they are not created here. Use the agent id (UUID) your integration contact already issued. Associating an agent that is not in your account returns agent was not found. Source associations for manifest-managed agents cannot be changed here — PUT returns agent associations are managed by the agent manifest. GET still works. For those agents, list source names in the agent manifest (knowledgeSources); see Agent API Integration Guide.

Website pages call POST /search with JSON { "q": "your terms" } and the browser Origin. Do not put an API key in page JavaScript. Lincoln Cannon LLC matches Origin to a site consumer and searches only sources associated with that site. Unknown Origin, a site with no associated sources, or an empty index returns 200 { "organic": [] } — it does not search every source in the account.

Authenticated preview (Bearer or x-api-key) must send asConsumer. kind must be site. Optional sourceIds intersects that site’s associations (ids not associated with the site are ignored). Optional num caps the number of hits (default 10, max 100).

{
  "q": "pricing",
  "asConsumer": { "kind": "site", "consumerId": "<site-consumer-uuid>" },
  "num": 10
}

Success body (ignore extra keys):

{
  "organic": [
    { "title": "About", "link": "https://www.example.com/about.html", "snippet": "…" }
  ]
}

link is the public https URL for that page. Typical errors: asConsumer is required, asConsumer kind must be site, site consumer was not found, Parameter q is not valid. Please provide valid parameters.

Associations

Replace-sets. The array you send is the complete list.

GET / PUT /sources/{id}/consumers

PUT body:

{ "consumers": [{ "kind": "agent", "consumerId": "<agent-uuid>" }] }

kind is agent or site. consumerId is the agent id or site consumer id.

GET / PUT /consumers/{kind}/{id}/sources

kind is agent or site. {id} is that consumer’s UUID.

PUT body:

{ "sourceIds": ["<source-uuid>"] }

Empty arrays mean no associations.

Errors

JSON { "error": "<message>" } (ignore extra keys). Typical cases:

StatusTypical meaning
401Missing or invalid credentials (Authorization required, Invalid or expired token, API key is not registered)
403Access denied (for example Email is not verified)
429Rate limited — retry with backoff. Honor Retry-After when present
400Invalid body or state (for example name is already in use, source type must be upload, Zendesk is not connected., syncSchedule is required, agent associations are managed by the agent manifest). See the API Reference (knowledge) for full schemas
404source was not found, file was not found, site consumer was not found, agent was not found
409expand is in progress, sync is in progress, sync has remaining files
503Sync or export temporarily unavailable — contact your integration contact

MCP: the same routes appear as tools for a registered API key or a customer Bearer session (see MCP Integration Guide).