Skip to content

API Documentation

API Documentation

Akurion exposes several API surfaces:

SurfaceBase pathBest for
Developer REST API/api/v1/*Direct integration with project files, search, answer generation, data sources, discovery, and usage.
MCP JSON-RPC API/mcp-serverMCP-compatible agents and tool callers.
Streaming RAG API/askme, /mcp, /mcpragUI-style streaming answer generation.
File access API/generate-file-url, /file-info/:fileIdSource preview, original file access, and signed URLs.
App control-plane APIsAuthenticated app operation endpoints plus custom HTTP APIsAkurion web app control-plane behavior.

The primary public developer surface is the REST API under /api/v1/* and the MCP endpoint under /mcp-server.

Authentication

Send the API key in the API-KEY header:

Terminal window
API-KEY: YOUR_API_KEY

Project-scoped keys usually resolve the project automatically. Subscription-scoped keys can access all or selected projects and must provide project context for project-level tools.

Project context can be provided through one of these options:

  • X-Project-ID: YOUR_PROJECT_ID
  • project_id query parameter
  • projectId or project_id JSON body field
  • project_id inside MCP params.arguments

Example:

Terminal window
curl -X GET "https://api.structhub.io/api/v1/project/details" \
-H "API-KEY: YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID"

Response Shape

REST developer API responses use:

{
"status": "success",
"tool": "answer_query",
"result": {},
"meta": {
"credits_used": 80,
"execution_time_ms": 1234
}
}

Errors use:

{
"status": "error",
"tool": "answer_query",
"error": "Project context is required",
"result": null,
"meta": {
"credits_used": 0,
"execution_time_ms": 10
}
}

Developer REST API

Base URL:

https://api.structhub.io/api/v1

Account and Tool Discovery

MethodPathToolProject requiredDescription
GET/projectslist_accessible_projectsNoList projects available to the API key.
GET/subscriptionget_subscription_detailsNoReturn subscription/workspace usage summary.
GET/toolsTool catalogNoList all MCP-backed REST tools, schemas, costs, and categories.
GET/tools/{tool_name}Tool describeNoDescribe one tool schema and metadata.

Project

MethodPathToolDescription
GET/project/detailsget_project_detailsProject configuration, credits, optional members, and optional key metadata.
GET/project/metadata-keyslist_project_metadata_keysProject metadata keys and definitions.
GET/project/settingsget_project_settingsSearch topK, token limit, metadata prompt, and retrieval configuration.
GET/project/credit-usageget_project_credit_usageCredit usage history, grouped by day/week/month.
GET/project/file-statisticsget_file_statistics_detailedFile statistics and optional index-level stats.
GET/project/metadata-coverageget_metadata_coverageMetadata coverage across project files.
GET/project/sync-statusget_sync_statusData source sync health and timing.
GET/project/usage-trendsget_project_usage_trendsCredit, file, and search activity trends.

Search and AI

MethodPathToolDescription
POST/search/vectorvector_searchSemantic search over project chunks.
POST/search/vector/metadata-filtervector_search_with_metadata_filterSemantic search with structured metadata filters.
POST/queries/multigenerate_multi_queriesExpand one query into multiple optimized retrieval queries.
POST/queries/intelligent-searchintelligent_searchOrchestrated retrieval with intent and metadata handling.
POST/queries/answeranswer_queryEnd-to-end answer generation with sources.
POST/queries/intentanalyze_query_intentClassify query type and recommend search strategy.
POST/queries/metadata-extractextract_metadata_from_queryExtract metadata key/value hints from natural language.

Example answer request:

Terminal window
curl -X POST "https://api.structhub.io/api/v1/queries/answer" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-d '{
"query": "Compare vendor security requirements across the latest documents",
"search_mode": "comparative",
"max_depth": 5,
"web_search": false
}'

Example metadata-filtered search:

Terminal window
curl -X POST "https://api.structhub.io/api/v1/search/vector/metadata-filter" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-d '{
"query": "retention obligations",
"metadata_filters": {
"department": { "$eq": "legal" },
"year": { "$gte": 2025 }
},
"top_k": 25
}'

Supported metadata operators include $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $and, and $or.

Files

MethodPathToolDescription
GET/project/files/countget_project_files_countFile totals and optional breakdowns.
GET/project/filesget_project_files_listPaginated file list with status/type/source metadata.
GET/project/files/searchsearch_files_by_nameSQL-like file name search using % wildcard.
GET/project/files/status/{status}get_files_by_statusFiles by status such as processing, completed, or failed.
GET/project/files/type/{file_type}get_files_by_typeFiles by MIME type or extension.
GET/project/files/date-rangeget_files_by_date_rangeFiles created or updated between two dates.
GET/project/files/{file_id}get_file_by_idFile details and optional generated metadata.
POST/project/files/{file_id}/chunksget_file_chunksChunks from one file with optional ranking query.
GET/project/files/{file_id}/chunksget_file_chunksQuery-parameter variant of chunk retrieval.
POST/project/files/{file_id}/chunks/around-pagesget_chunks_around_pageChunks around one or more pages.
GET/project/files/{file_id}/chunks/around-pagesget_chunks_around_pageQuery-parameter variant of page context retrieval.
GET/files/{file_id}/previewpreview_file_contentInitial chunks and optional summary.
POST/project/files/upload-urlcreate_file_uploadCreate or upsert file record and return signed upload URL.
DELETE/project/files/{file_id}delete_fileDelete file and associated vectors.

Example upload URL:

Terminal window
curl -X POST "https://api.structhub.io/api/v1/project/files/upload-url" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-d '{
"name": "security-policy.pdf",
"file_type": "application/pdf"
}'

Data Sources

MethodPathToolDescription
GET/project/data-sourcesget_data_sourcesList project data sources and status.
POST/project/data-sourcescreate_data_sourceCreate a data source for a source type enabled in your workspace.
PATCH/project/data-sources/{data_source_id}update_data_sourceUpdate enabled source settings or source-specific config.
DELETE/project/data-sources/{data_source_id}delete_data_sourceDelete source and related indexed content.
POST/project/data-sources/{data_source_id}/resyncresync_data_sourceQueue a fresh source sync for enabled source types.

Source connector availability is controlled in the Akurion app. Disabled source types are intentionally not listed in public API docs until they are enabled for customer use.

Chunk Collection

MethodPathToolDescription
POST/chunks/collect/filecollect_chunks_from_fileOrdered chunks for one file.
POST/chunks/collect/filescollect_chunks_from_multiple_filesChunks for multiple files.
POST/files/find/metadatafind_files_by_metadataFiles matching metadata filters.
GET/files/find/namefind_files_by_nameFiles matching wildcard or regex name pattern.
POST/chunks/collect/metadata-filecollect_chunks_by_metadata_and_fileChunks from files matching metadata and optional name pattern.
GET/files/statisticsget_file_statisticsAggregate collection statistics.
POST/chunks/collect/page-rangecollect_chunks_by_page_rangeChunks from one file page range.
POST/chunks/collect/batch-page-rangesbatch_collect_by_file_ids_and_pagesChunks from multiple file/page ranges.

Discovery

MethodPathToolDescription
GET/discovery/metadata-schemadiscover_metadata_schemaInfer metadata keys, types, counts, and examples.
GET/discovery/metadata-values/{metadata_key}list_metadata_valuesUnique values and optional counts for a metadata key.
GET/discovery/file-structureexplore_file_structureCorpus structure grouped by type, source pattern, or metadata key.
POST/discovery/content-topicsdiscover_content_topicsDiscover dominant corpus topics.
GET/discovery/similar-files/{file_id}find_similar_filesFiles similar by content or metadata.
POST/discovery/metadata-correlationsanalyze_metadata_correlationsCorrelations between metadata keys.
POST/discovery/metadata-combinationssearch_metadata_combinationsComplex logical metadata search.

MCP JSON-RPC API

Base URL:

https://api.structhub.io/mcp-server

Alternate JSON-RPC-compatible routes:

  • /developer-api
  • /api/v1

Initialize:

Terminal window
curl -X POST "https://api.structhub.io/mcp-server" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"method": "initialize",
"params": {},
"id": 1
}'

List tools:

Terminal window
curl -X POST "https://api.structhub.io/mcp-server" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"method": "tools/list",
"params": {},
"id": 2
}'

Call a tool:

Terminal window
curl -X POST "https://api.structhub.io/mcp-server" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-H "X-Project-ID: YOUR_PROJECT_ID" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "answer_query",
"arguments": {
"query": "Summarize this project with citations",
"search_mode": "focused",
"max_depth": 5
}
},
"id": 3
}'

Supported JSON-RPC methods:

MethodDescription
initializeMCP lifecycle handshake.
notifications/initializedMCP initialization notification.
tools/list or tools.listList available tools.
tools.describeDescribe one tool.
tools/call or tools.callExecute one tool.

Standalone MCP Tool Catalog

Low-Level Retrieval Tools

ToolCreditsRequired inputsDescription
vector_search10querySemantic search over the vector store.
vector_search_with_metadata_filter15query, metadata_filtersSemantic search constrained by metadata filters.
get_file_chunks12file_idFetch chunks from a specific file.
get_chunks_around_page10file_id, page_numbersRetrieve chunks around page anchors.
list_project_metadata_keys5NoneList configured project metadata keys.
get_project_settings5NoneReturn project retrieval settings.

High-Level RAG Tools

ToolCreditsRequired inputsDescription
generate_multi_queries20queryExpand one query into multiple search queries.
intelligent_search40queryOrchestrated retrieval with metadata handling.
answer_query80queryEnd-to-end answer generation with sources.
analyze_query_intent15queryClassify query intent and recommend search strategy.
extract_metadata_from_query15querySuggest applicable metadata filters from a user request.

Collection Tools

ToolCreditsRequired inputsDescription
collect_chunks_from_file12file_idCollect ordered chunks from one file.
collect_chunks_from_multiple_files20file_idsBatch collect chunks from multiple files.
find_files_by_metadata10metadata_filtersFind files matching metadata criteria.
find_files_by_name8name_patternFind files by wildcard or regex-like pattern.
collect_chunks_by_metadata_and_file18metadata_filtersCollect chunks by metadata and optional file name pattern.
get_file_statistics8NoneAggregate file statistics and breakdowns.
collect_chunks_by_page_range10file_id, start_page, end_pageCollect chunks from one page range.
batch_collect_by_file_ids_and_pages25file_page_rangesBatch page-range chunk collection.

Discovery Tools

ToolCreditsRequired inputsDescription
discover_metadata_schema20NoneInfer metadata schema by sampling indexed documents.
list_metadata_values8metadata_keyList values for one metadata key.
explore_file_structure12NoneSummarize corpus structure.
discover_content_topics25NoneDiscover major topics and representative files.
find_similar_files15file_idFind similar files by content or metadata.
analyze_metadata_correlations18metadata_keysAnalyze correlations between metadata keys.
preview_file_content12file_idPreview file chunks and optional summary.
search_metadata_combinations15filter_expressionSearch with complex metadata logic.

Project Management Tools

ToolCreditsRequired inputsDescription
get_project_files_count5NoneFile counts and breakdowns.
get_project_files_list8NonePaginated project file list.
get_project_details5NoneProject configuration and optional members/API keys.
get_project_credit_usage8NoneProject credit usage history.
get_data_sources5NoneProject data sources and sync status.
get_file_by_id5file_idFile metadata by ID.
search_files_by_name5name_queryFile name search.
get_files_by_status5statusFiles by processing status.
get_files_by_type5file_typeFiles by MIME type or extension.
get_files_by_date_range8start_date, end_dateFiles by date range.
get_file_statistics_detailed10NoneDetailed file statistics and optional vector stats.
get_metadata_coverage8NoneMetadata coverage summary.
get_sync_status5NoneSource sync status.
get_project_usage_trends10NoneUsage trend summary.
list_accessible_projects3NoneProjects available to the API key.
get_subscription_details4NoneSubscription details and usage.
create_file_upload8name, file_typeCreate a file record and signed upload URL.
delete_file10file_idDelete a file and associated vectors.
create_data_source12source_typeCreate a data source.
update_data_source10data_source_idUpdate data source settings.
delete_data_source15data_source_idDelete a data source and associated records.
resync_data_source6data_source_idQueue a data source resync.

Streaming RAG APIs

POST /askme

Streaming Server-Sent Events endpoint for answer generation.

Request body:

{
"q": "What changed in the latest policy?",
"threadId": "thread-id",
"mode": "fast",
"depth": 1,
"searchMode": "focused",
"maxDepth": 5,
"sources": []
}

Supported mode values:

  • fast
  • research
  • agentic

POST /mcp

Streaming endpoint used by enhanced chat. It supports advanced project-aware answers with citations, filters, graph context when enabled, and user-visible progress events.

POST /mcprag

Advanced MCP-compatible answer endpoint for tool-driven knowledge workflows. Use it when an integration needs richer reasoning, source grounding, and citation-aware responses.

File Access APIs

POST /generate-file-url

Generate a source-aware URL for viewing or downloading a file.

Terminal window
curl -X POST "https://api.structhub.io/generate-file-url" \
-H "Content-Type: application/json" \
-H "API-KEY: YOUR_API_KEY" \
-d '{
"fileId": "FILE_ID",
"accessType": "view",
"durationHours": 24
}'

GET /file-info/{file_id}

Return file metadata and access information for a project-scoped file.

App Control-Plane APIs

The Akurion web app uses authenticated operation endpoints for app behavior. These are usually called by the web client rather than by external developers.

Custom HTTP APIs

MethodPathPurpose
POST/stripe-webhookStripe billing webhook.
GET/auth/sso/startStart organization SSO.
GET/auth/sso/callbackOIDC SSO callback.
POST/auth/sso/exchangeExchange SSO login token.
POST/ui/assistant/:targetAuthenticated UI proxy to assistant endpoints.
POST/ui/file/:targetAuthenticated UI proxy to file endpoints.
POST/ui/developer/restAuthenticated UI proxy to REST developer API.
POST/ui/developer/mcpAuthenticated UI proxy to MCP server.
POST/ui/tools/:targetAuthenticated UI proxy to tool endpoints.
POST/internal/datasource/:id/statusInternal Cloud Workflow status callback.
GET/migrate-emailLegacy migration endpoint.

Connector OAuth routes are internal and are only documented publicly when the corresponding source type is enabled in the UI.

App Actions

Actions are authenticated mutations used by the web app:

Major action groups include API key management, file management, project and membership administration, billing, contact/demo requests, chat threads and messages, feedback, prompt playbooks, workflows, data source lifecycle actions for enabled source types, project metadata/settings, graph management, admin controls, SSO settings, organization admins, and workspace naming.

Connector-specific generated actions are intentionally omitted from public docs while those source tiles are disabled in the UI.

App Queries

Queries are authenticated read operations used by the web app:

Major query groups include project discovery, file lists, member lists, API keys, subscription details, usage and credit analytics, contact messages, chat history, prompt playbooks, workflows, workflow runs, SSO settings, organization settings, graph browser data, graph review queues, project analytics, admin dashboard data, global metadata/model config, and system health metrics.

Connector-specific generated queries are intentionally omitted from public docs while those source tiles are disabled in the UI.

Rate Limits and Credits

Each API key is subject to tenant-specific rate limits and credit availability. Tool calls publish credit usage events and responses include credit metadata where applicable.

Common error codes:

CodeMeaning
200Successful request.
204MCP initialized notification accepted.
400Invalid request, missing parameter, or unsupported input.
401Missing or invalid API key.
403Valid key but forbidden project or user context.
404Unknown route, unsupported REST operation, or missing resource.
429Rate limit exceeded.
500Tool execution or internal server error.