Help
DevelopersReference

Knowledge

The bases and sources the agents answer from, retrieval with citations, and refresh control.

Base URL https://api.showpilot.com/v1. Every call needs Authorization: Bearer <api key>; see Authentication.

List knowledge bases

GET /knowledge/bases

Scope: knowledge:read. Operation id: listKnowledgeBases.

Every base in the workspace with its refresh mode, last refresh, source counts and the agents that read it.

Example request

curl "https://api.showpilot.com/v1/knowledge/bases" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

All bases; small enough not to page.

FieldTypeAlwaysMeaning
itemsarray of KnowledgeBaseyes

KnowledgeBase

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstring or nullyes
sharedbooleanyesA shared base can be attached to many agents; a personal one belongs to one.
statusstringyesactive, indexing or failed.
refreshobjectyes
lastRefreshobject or nullyesThe last refresh receipt
sourcesobjectyes
agentIdsarray of string (uuid)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

Errors

StatusWhen
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

One base with its sources

GET /knowledge/bases/{id}

Scope: knowledge:read. Operation id: getKnowledgeBase.

Parameters

NameInTypeMeaning
idpathstring (uuid)The base's UUID.

Example request

curl "https://api.showpilot.com/v1/knowledge/bases/b0000001-0000-4000-8000-000000000000" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The base and every source in it.

Every field of KnowledgeBase, plus:

FieldTypeAlwaysMeaning
sourcesarray of KnowledgeSourceyes

KnowledgeBase

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstring or nullyes
sharedbooleanyesA shared base can be attached to many agents; a personal one belongs to one.
statusstringyesactive, indexing or failed.
refreshobjectyes
lastRefreshobject or nullyesThe last refresh receipt
sourcesobjectyes
agentIdsarray of string (uuid)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

KnowledgeSource

FieldTypeAlwaysMeaning
idstring (uuid)yes
baseIdstring (uuid)yes
kindstringyesurl, sitemap, text or file.
namestringyes
urlstring or null (uri)yesFor url and sitemap kinds.
statusstringyespending, indexing, loaded or failed.
errorstring or nullyes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Set how a base keeps itself current

PATCH /knowledge/bases/{id}

Scope: knowledge:write. Operation id: setKnowledgeBaseRefresh.

auto watches the site and does a weekly full check; scheduled does a full check at the interval; off freezes the base until a refresh is requested.

Parameters

NameInTypeMeaning
Idempotency-KeyheaderstringAny unique string, up to 200 characters, chosen by the caller. A retry with the same key and the same request replays the stored response (with the header Idempotent-Replayed set to true); the same key with a different request is refused. Keys are remembered for 24 hours.
idpathstring (uuid)The base's UUID.

Example request

curl "https://api.showpilot.com/v1/knowledge/bases/b0000001-0000-4000-8000-000000000000" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The base after the change.

KnowledgeBase

FieldTypeAlwaysMeaning
idstring (uuid)yes
namestringyes
descriptionstring or nullyes
sharedbooleanyesA shared base can be attached to many agents; a personal one belongs to one.
statusstringyesactive, indexing or failed.
refreshobjectyes
lastRefreshobject or nullyesThe last refresh receipt
sourcesobjectyes
agentIdsarray of string (uuid)yes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
409The write cannot apply. Code conflict when the object's state refuses it (a follow-up already closed); code idempotency-mismatch when the Idempotency-Key was already used for a different request.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Refresh a base now

POST /knowledge/bases/{id}/refresh

Scope: knowledge:write. Operation id: refreshKnowledgeBase.

Queues a full pass, exactly as the Refresh button in Settings does. Loaded URL sources go back to pending and the worker re-reads them.

Parameters

NameInTypeMeaning
Idempotency-KeyheaderstringAny unique string, up to 200 characters, chosen by the caller. A retry with the same key and the same request replays the stored response (with the header Idempotent-Replayed set to true); the same key with a different request is refused. Keys are remembered for 24 hours.
idpathstring (uuid)The base's UUID.

Example request

curl "https://api.showpilot.com/v1/knowledge/bases/b0000001-0000-4000-8000-000000000000/refresh" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Status 202.

Queued.

FieldTypeAlwaysMeaning
queuedbooleanyes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
409The write cannot apply. Code conflict when the object's state refuses it (a follow-up already closed); code idempotency-mismatch when the Idempotency-Key was already used for a different request.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Add a URL source to a base

POST /knowledge/bases/{id}/sources

Scope: knowledge:write. Operation id: addKnowledgeSource.

The source lands pending and is ingested by the worker. Set includeSubpages to crawl the site from that page. File sources are added in the dashboard.

Parameters

NameInTypeMeaning
Idempotency-KeyheaderstringAny unique string, up to 200 characters, chosen by the caller. A retry with the same key and the same request replays the stored response (with the header Idempotent-Replayed set to true); the same key with a different request is refused. Keys are remembered for 24 hours.
idpathstring (uuid)The base's UUID.

Example request

curl "https://api.showpilot.com/v1/knowledge/bases/b0000001-0000-4000-8000-000000000000/sources" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Status 201.

The new source, pending ingest.

KnowledgeSource

FieldTypeAlwaysMeaning
idstring (uuid)yes
baseIdstring (uuid)yes
kindstringyesurl, sitemap, text or file.
namestringyes
urlstring or null (uri)yesFor url and sitemap kinds.
statusstringyespending, indexing, loaded or failed.
errorstring or nullyes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
409The write cannot apply. Code conflict when the object's state refuses it (a follow-up already closed); code idempotency-mismatch when the Idempotency-Key was already used for a different request.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

List sources, newest first

GET /knowledge/sources

Scope: knowledge:read. Operation id: listKnowledgeSources.

Parameters

NameInTypeMeaning
limitqueryintegerPage size, 1 to 200. Default 50.
cursorquerystringThe nextCursor from the previous page. Opaque; never build one.
baseIdquerystring (uuid)

Example request

curl "https://api.showpilot.com/v1/knowledge/sources?limit=50" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

One page of sources.

FieldTypeAlwaysMeaning
itemsarray of KnowledgeSourceyes
nextCursorNextCursoryes

KnowledgeSource

FieldTypeAlwaysMeaning
idstring (uuid)yes
baseIdstring (uuid)yes
kindstringyesurl, sitemap, text or file.
namestringyes
urlstring or null (uri)yesFor url and sitemap kinds.
statusstringyespending, indexing, loaded or failed.
errorstring or nullyes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

NextCursor

Pass as cursor for the next page; null on the last page.

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

One source

GET /knowledge/sources/{id}

Scope: knowledge:read. Operation id: getKnowledgeSource.

Parameters

NameInTypeMeaning
idpathstring (uuid)The source's UUID.

Example request

curl "https://api.showpilot.com/v1/knowledge/sources/c0000001-0000-4000-8000-000000000000" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The source with its ingest status.

KnowledgeSource

FieldTypeAlwaysMeaning
idstring (uuid)yes
baseIdstring (uuid)yes
kindstringyesurl, sitemap, text or file.
namestringyes
urlstring or null (uri)yesFor url and sitemap kinds.
statusstringyespending, indexing, loaded or failed.
errorstring or nullyes
createdAtstring (date-time)yes
updatedAtstring (date-time)yes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Remove a source and its vectors

DELETE /knowledge/sources/{id}

Scope: knowledge:write. Operation id: deleteKnowledgeSource.

Parameters

NameInTypeMeaning
Idempotency-KeyheaderstringAny unique string, up to 200 characters, chosen by the caller. A retry with the same key and the same request replays the stored response (with the header Idempotent-Replayed set to true); the same key with a different request is refused. Keys are remembered for 24 hours.
idpathstring (uuid)The source's UUID.

Example request

curl "https://api.showpilot.com/v1/knowledge/sources/c0000001-0000-4000-8000-000000000000" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Status 204. Gone. The agents stop answering from it at once.

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
409The write cannot apply. Code conflict when the object's state refuses it (a follow-up already closed); code idempotency-mismatch when the Idempotency-Key was already used for a different request.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Retrieve ranked chunks for a query

POST /knowledge/retrieve

Scope: knowledge:query. Operation id: retrieveKnowledge.

The agent's own retrieval, without generation: ranked chunks with score, source and citation, for composing with your own model. Name an agentId to search exactly what that agent sees, baseIds to search those bases, or neither for every base in the workspace. Draws from the knowledge:query bucket (30 burst, one call every two seconds).

Example request

curl "https://api.showpilot.com/v1/knowledge/retrieve" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

Chunks, best first.

FieldTypeAlwaysMeaning
resultsarray of KnowledgeChunkyes

KnowledgeChunk

FieldTypeAlwaysMeaning
textstringyes
scorenumberyesSimilarity
sourceIdstring or null (uuid)yes
sourceTitlestring or nullyes
urlstring or null (uri)yes
chunkIndexinteger or nullyes

Example response

{
  "results": [
    {
      "text": "Pro costs $99 a month, billed yearly.",
      "score": 0.9123,
      "sourceId": "c0000001-0000-4000-8000-000000000000",
      "sourceTitle": "Pricing",
      "url": "https://example.com/pricing",
      "chunkIndex": 3
    }
  ]
}

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

Ask a question, get an answer with citations

POST /knowledge/ask

Scope: knowledge:query. Operation id: askKnowledge.

Retrieve, then one grounded answer, with no chat session, no visitor and no analytics. Same targeting as retrieve. When the sources do not cover the question the answer says so rather than guessing. Draws from the knowledge:query bucket.

Example request

curl "https://api.showpilot.com/v1/knowledge/ask" \
  -H "Authorization: Bearer $SHOWPILOT_API_KEY"
Runs against your sandbox with a test key.

Response

The answer and what it rests on.

FieldTypeAlwaysMeaning
answerstringyes
citationsarray of objectyes

Errors

StatusWhen
400A parameter is malformed, such as a cursor this API did not issue, a limit under 1, or an unknown status. Code invalid-request.
401No key, or an unknown or revoked key. Code unauthorized.
403A valid key without the operation's scope (code insufficient-scope), or a plan without API access (code plan-api-off).
404No object with that id in this workspace. Code not-found.
429The key's bucket is empty. Code rate-limited; wait the Retry-After seconds.

On this page