Skip to content

REST API ​

Use REST to upload files, search their content and retrieve sources from your application. TKP groups uploaded files, called resources, into libraries inside a tenant (a team workspace). Start with the integration overview if these concepts are new to you.

Use MCP when connecting an agent that discovers and calls tools instead of making REST requests directly.

Start with the Python quickstart. It verifies access, lists libraries, optionally uploads a file, waits for processing, searches and creates a temporary source URL. It requires Python 3.9 or later without additional packages.

URLs and reference ​

Use the TKP application URL, not this documentation site's URL. For an instance at https://tkp.example.com:

PurposeURL
REST basehttps://tkp.example.com/api/v1
Interactive API referencehttps://tkp.example.com/api/documentation
OpenAPI JSONhttps://tkp.example.com/docs?api-docs.json
MCP endpointhttps://tkp.example.com/mcp

The dashboard's API Documentation button opens the instance's reference. The reference describes endpoint parameters and response schemas for that deployed version. Download its OpenAPI schema to generate an HTTP client or give a coding agent the exact API contract. The workflow guides here explain how to combine those endpoints.

Access ​

For a script or backend service, sign in to TKP and create a token on your workspace's Access Tokens page:

  1. Enable the API interface.
  2. Grant Read for the libraries the application should query.
  3. Add Create resources for libraries that accept uploads.
  4. Set an expiry appropriate to the integration and save the token. Its plaintext value is shown once.

Pass it in Authorization: Bearer <token>. Keep it in your backend's secret store; never embed it in browser JavaScript, commit it or include it in a source URL.

A credential belongs to one workspace and cannot exceed its owner's permissions. An API-enabled token can still lack library access. Check GET /api/v1/auth/check to inspect its effective libraries and abilities. See permissions and abilities.

For applications that users connect to their own TKP accounts, use OAuth. This opens a browser consent screen instead of asking users to copy a personal token. The OAuth implementation guide explains the sign-in flow. Request the api:use scope to use the token for REST. The approved Connected App must also enable API access and the required library permissions. Existing MCP integrations need this REST scope and API access too before using the same OAuth token for REST.

Choose an operation ​

The table uses TKP's content concepts: resources are uploaded files, assets are their extracted content, notes record library-level knowledge, and nodes are entries in a library's folder tree.

TaskStart with
Discover accessible librariesGET /api/v1/libraries
Upload and wait for search readinessQuickstart
Browse folders and resource metadataLibrary directory, tree and resource endpoints in the API reference
Retrieve relevant source excerptsGET /api/v1/search/resources with detailed output
Display original files or previewsResource/page/asset downloads and view-URL endpoints
Ask a question across a complete resourceResource-question endpoints; submit, poll and optionally cancel
Find structured notes or library nodesNote and node search endpoints

Search returns ranked candidates, not verified answers. Inspect the returned excerpts and original source before presenting a claim as verified. The knowledge-graph endpoint lists notes and related resources, so use the download endpoints when you need the original file.

A resource question asks TKP to analyze one complete resource using its configured generation provider. The request starts an asynchronous job: your application must poll for its answer and can cancel it. Follow the resource-question endpoints in the API reference for these states; they differ from the file-processing states used in the quickstart.

Traceable Knowledge Platform