AI & Chat RAG-powered chat, semantic search, notes, metadata extraction, and auto-summarization

Base URL: https://api.fast.io/current/ Auth: Bearer {jwt_token}

Overview

Fast.io provides built-in AI capabilities for workspaces and shares:

AI chat is read-only. It can read, analyze, search, and answer questions about files, but it cannot modify files, change settings, manage members, or access events. All write operations must be done through the API directly.

Intelligence Setting

The intelligence boolean on a workspace or share controls whether uploaded files are automatically indexed for RAG.

Enable at creation:

POST /current/org/{org_id}/create/workspace/

Pass intelligence=true

Update later:

POST /current/workspace/{workspace_id}/update/

Pass intelligence=true

Warning: Intelligence cannot be re-enabled once disabled. Disabling is permanent.

Chat Types

Two chat types are available. Both augment answers with web knowledge.

chat — General AI Conversation

chat_with_files — RAG-Powered Chat

File Scope vs File Attachments

These are two different ways to give the AI context. They cannot be combined in the same request.

Folder/File Scope (files_scope, folders_scope)

Limits the RAG search space. The AI searches indexed files within the specified scope and uses matching content as citations.

files_scope — comma-separated nodeId:versionId pairs (max 100). Both nodeId and versionId are required and must be non-empty in each pair. Get the versionId from the file’s version field in storage list/details responses.

folders_scope — comma-separated nodeId:depth pairs (max 100 subfolder references). Depth controls how many levels of subfolders are enumerated (1–10). Only subfolder references count toward the limit, not individual files. The RAG backend searches all indexed files within the scoped folders automatically.

You do not need to enumerate individual files. Just provide top-level folder IDs with depth.

File Attachments (files_attach)

Files are directly attached to the chat message for analysis. Use this for direct analysis tasks.

Format: comma-separated nodeId:versionId pairs, e.g., files_attach=nodeId1:versionId1,nodeId2:versionId2

Choosing Between Scope and Attachments

Use CaseMechanismChat Type
Search across many indexed filesfiles_scope / folders_scopechat_with_files
Analyze specific files directlyfiles_attachchat or chat_with_files
Ask general questions about the workspaceOmit scope (defaults to all files)chat_with_files
General conversation, no filesNeitherchat

AI State (File Readiness)

Files in an intelligent workspace progress through AI processing states:

StateMeaning
disabledIntelligence not enabled for this file/workspace
pendingQueued for AI processing
inprogressCurrently being indexed
readyIndexed and available for RAG searches
failedIndexing failed

Only files with ai_state: ready are included in RAG folder/file scope searches. Check a file’s AI state in the ai.state field of storage list or file details responses.

Personality Parameter

The personality parameter controls the length and style of AI responses. Pass it when creating a chat or sending a message.

ValueBehavior
conciseShort, brief, direct answers with minimal elaboration
detailedComprehensive answers with context, evidence, and examples (default)

You can also control verbosity directly in your question phrasing:

Notes (Stored Knowledge)

Notes are a storage node type (like files and folders) that store markdown content directly on the server. They appear in storage listings with "type": "note" and "mimetype": "text/markdown". Notes are workspace-only — they cannot be created in shares.

Why Notes Matter

In an intelligent workspace, notes are ingested and indexed just like uploaded files. This makes them a way to bank knowledge over time — store interesting facts, research findings, decisions, or project context. In future AI chats that scope the entire workspace (or include the note’s folder), the note content will be used as grounding when the AI searches for relevant information.

Create a note

POST /current/workspace/{workspace_id}/storage/{parent_id}/createnote/
ParameterTypeRequiredDescription
namestringYesNote name, must end in .md
contentstringYesMarkdown content, max 100 KB

{parent_id} is a folder OpaqueId or "root". Returns the created note as a node resource.

Update a note

POST /current/workspace/{workspace_id}/storage/{node_id}/updatenote/
ParameterTypeRequiredDescription
namestringNoNew name, must end in .md
contentstringNoNew markdown content, max 100 KB

At least one of name or content must be provided. Updating content creates a new version.

Read note content

GET /current/workspace/{workspace_id}/storage/{node_id}/read/

Returns the raw markdown content.

Linking a user to a note

Workspace AI Endpoints

Create a new chat

POST /current/workspace/{workspace_id}/ai/chat/

Creates a chat with an initial message. The AI begins processing asynchronously.

Auth: Bearer token required. Workspace view permission. content_ai plan feature required.

Rate limits: 1/1s, 5/10s, 10/60s, 50/hr, 200/day (per workspace + user).

ParameterTypeRequiredDefaultDescription
typestringYeschat or chat_with_files
questionstringYesInitial question, 2–12,768 characters
privacystringNopublicprivate or public
namestringNoAuto-generatedChat name. Auto-generated from first 10 words of question if omitted.
personalitystringNodetailedconcise or detailed
files_scopestringNoAll indexed filesComma-separated nodeId:versionId pairs (max 100). Requires chat_with_files type and Intelligence enabled.
folders_scopestringNoAll indexed filesComma-separated nodeId:depth pairs (max 100, depth 1–10). Requires chat_with_files type and Intelligence enabled.
files_attachstringNoComma-separated nodeId:versionId pairs (max 20, 200 MB total). Cannot be combined with files_scope/folders_scope. Files must have AI summaries ready.

Request example:

curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d "type=chat_with_files" \
  -d "question=What were the Q3 revenue figures?" \
  -d "privacy=private" \
  -d "personality=detailed"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "chat": {
      "id": "aBcDeFgHiJkLmNoPqR",
      "message": {
        "id": "xYzAbCdEfGhIjKlMnO"
      }
    }
  },
  "current_api_version": "1.0"
}
FieldTypeDescription
response.chat.idstringOpaque ID of the created chat
response.chat.message.idstring/nullOpaque ID of the initial message, or null if no question was provided

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_INPUT_INVALID400Invalid type, privacy, or personality value
APP_ERROR_INPUT_INVALID400File/folder scope used without Intelligence enabled
APP_ERROR_INPUT_INVALID400Both files_attach and files_scope specified
APP_ERROR_INPUT_INVALID400Invalid name or other property
APP_ERROR_DATASTORE500Chat or message creation failed

List chats

GET /current/workspace/{workspace_id}/ai/chat/list/

Returns all chats created by the current user in the workspace. Sorted by most recently modified first.

Auth: Bearer token required. Workspace view permission. content_ai plan feature required.

Rate limits: 3/1s, 10/10s, 20/60s, 50/hr, 200/day.

Variant: Append /deleted to the path to list deleted chats: GET .../ai/chat/list/deleted

Request example:

curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/list/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "chats": [
      {
        "chat_id": "aBcDeFgHiJkLmNoPqR",
        "creator": { "type": "user", "id": "12345678901234567890" },
        "type": "chat_with_files",
        "name": "Quarterly report analysis",
        "status": "active",
        "message_count": 5,
        "latest_message": {
          "message_id": "xYzAbCdEfGhIjKlMnO",
          "creator": { "type": "user", "id": "12345678901234567890" },
          "state": "complete",
          "message": { "text": "Summarize the quarterly report" },
          "response": null,
          "created": "2025-06-15T10:30:00Z",
          "updated": "2025-06-15T10:30:05Z"
        },
        "unique_creators": [
          { "type": "user", "id": "12345678901234567890" }
        ],
        "cost": { "credits": { "tokens": 1500 } },
        "efficiency": "good",
        "privacy": {
          "visibility": "private",
          "owner": { "type": "user", "id": "12345678901234567890" }
        },
        "created_at": "2025-06-15T10:00:00Z",
        "updated_at": "2025-06-15T10:30:05Z"
      }
    ]
  },
  "current_api_version": "1.0"
}
FieldTypeDescription
response.chatsarrayArray of chat objects
response.chats[].chat_idstringOpaque ID of the chat
response.chats[].creatorobject{type, id} — the chat creator
response.chats[].typestringchat or chat_with_files
response.chats[].namestringChat display name
response.chats[].statusstringChat status
response.chats[].message_countintegerTotal messages in the chat
response.chats[].latest_messageobjectMost recent message preview
response.chats[].unique_creatorsarrayDistinct participants
response.chats[].cost.credits.tokensintegerTotal token cost
response.chats[].efficiencystringEfficiency rating
response.chats[].privacyobject{visibility, owner}
response.chats[].created_atstringISO 8601 creation timestamp
response.chats[].updated_atstringISO 8601 last update timestamp

Get chat details

GET /current/workspace/{workspace_id}/ai/chat/{chat_id}/details/

Returns chat details with full message history.

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 100/10s, 350/60s, 2000/hr.

Request example:

curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/aBcDeFgHiJkLmNoPqR/details/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "chat": {
      "chat_id": "aBcDeFgHiJkLmNoPqR",
      "creator": { "type": "user", "id": "12345678901234567890" },
      "type": "chat_with_files",
      "name": "Quarterly report analysis",
      "status": "active",
      "message_count": 3,
      "messages": [
        {
          "chat_id": "aBcDeFgHiJkLmNoPqR",
          "message_id": "xYzAbCdEfGhIjKlMnO",
          "creator": { "type": "user", "id": "12345678901234567890" },
          "personality": "detailed",
          "state": "complete",
          "message": {
            "text": "Summarize the quarterly report",
            "author_name": "John",
            "scope": {},
            "attached": []
          },
          "response": {
            "text": "The quarterly report shows revenue growth of 15%...",
            "error": false,
            "created": "2025-06-15T10:30:05Z",
            "cost": { "tokens": 500, "details": {} },
            "author_name": "Ripley",
            "events": [],
            "table_data": [],
            "analysis_chunks": [],
            "citations": [
              {
                "hash": "a1b2c3d4",
                "nodeId": "f3jm5-zqzfx-pxdr2-dx8z5-bvnb3-rpjfm4",
                "versionId": "v1abc-defgh-ijklm",
                "entries": [
                  { "page": 3, "snippet": "Revenue increased by 15% year over year...", "timestamp": null }
                ]
              }
            ]
          },
          "created": "2025-06-15T10:30:00Z",
          "updated": "2025-06-15T10:30:05Z"
        }
      ],
      "unique_creators": [ { "type": "user", "id": "12345678901234567890" } ],
      "cost": { "credits": { "tokens": 1500 } },
      "efficiency": "good",
      "privacy": { "visibility": "private", "owner": { "type": "user", "id": "12345678901234567890" } },
      "created_at": "2025-06-15T10:00:00Z",
      "updated_at": "2025-06-15T10:30:05Z"
    }
  },
  "current_api_version": "1.0"
}

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_NOT_FOUND404Chat ID not found
APP_INTERNAL_ERROR500Internal failure loading chat

Update a chat

POST /current/workspace/{workspace_id}/ai/chat/{chat_id}/update/

Update the name of an existing chat.

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 1/1s, 5/10s, 10/60s, 50/hr, 200/day.

ParameterTypeRequiredDescription
namestringYesNew chat name

Request example:

curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/aBcDeFgHiJkLmNoPqR/update/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d "name=Updated Chat Name"

Response (200 OK):

{ "result": "yes", "current_api_version": "1.0" }

Error responses:

Error CodeHTTP StatusCause
APP_NOT_ACCEPTED406Chat not found or locked
APP_ERROR_INPUT_INVALID400Invalid name value
APP_ERROR_DATASTORE500Update failed

Delete a chat

DELETE /current/workspace/{workspace_id}/ai/chat/{chat_id}/

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 3/1s, 20/10s, 50/60s, 250/hr, 500/day.

Request example:

curl -X DELETE "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/aBcDeFgHiJkLmNoPqR/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{ "result": "yes", "current_api_version": "1.0" }

Error responses:

Error CodeHTTP StatusCause
APP_NOT_ACCEPTED406Chat not found or locked
APP_INTERNAL_ERROR500Chat in non-deletable state or internal error

Deleted chats can be listed via GET .../ai/chat/list/deleted.

Send a follow-up message

POST /current/workspace/{workspace_id}/ai/chat/{chat_id}/message/

Send a new message to an existing chat. The message is processed asynchronously.

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 10/10s, 20/60s, 500/hr.

ParameterTypeRequiredDefaultDescription
questionstringYesFollow-up question, 2–12,768 characters
personalitystringNodetailedconcise or detailed
files_scopestringNoAll indexed filesComma-separated nodeId:versionId pairs (max 100). Only for chat_with_files type.
folders_scopestringNoAll indexed filesComma-separated nodeId:depth pairs (max 100, depth 1–10). Only for chat_with_files type.
files_attachstringNoComma-separated nodeId:versionId pairs (max 20, 200 MB total). Cannot be combined with scope params.

The chat type is inherited from the chat itself — you do not need to specify type again.

Request example:

curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/aBcDeFgHiJkLmNoPqR/message/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d "question=How does that compare to Q2?"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "message": {
      "id": "mNoPqRsTuVwXyZaBcD"
    }
  },
  "current_api_version": "1.0"
}

Error responses:

Error CodeHTTP StatusCause
APP_NOT_ACCEPTED406Chat not found or locked
APP_ERROR_INPUT_INVALID400Both files_attach and files_scope specified
APP_ERROR_INPUT_INVALID400Scope used with wrong chat type
APP_INTERNAL_ERROR500Message creation or queuing failed

List messages in a chat

GET /current/workspace/{workspace_id}/ai/chat/{chat_id}/messages/list/

Returns all messages in chronological order (oldest first).

Auth: Bearer token required. content_ai plan feature required.

Request example:

curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/aBcDeFgHiJkLmNoPqR/messages/list/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "messages": [
      {
        "chat_id": "aBcDeFgHiJkLmNoPqR",
        "message_id": "xYzAbCdEfGhIjKlMnO",
        "creator": { "type": "user", "id": "12345678901234567890" },
        "personality": "detailed",
        "state": "complete",
        "message": {
          "text": "Summarize the quarterly report",
          "author_name": "John",
          "scope": {},
          "attached": []
        },
        "response": {
          "text": "The quarterly report shows...",
          "error": false,
          "created": "2025-06-15T10:30:05Z",
          "cost": { "tokens": 500, "details": {} },
          "author_name": "Ripley",
          "events": [],
          "table_data": [],
          "analysis_chunks": [],
          "citations": []
        },
        "created": "2025-06-15T10:30:00Z",
        "updated": "2025-06-15T10:30:05Z"
      }
    ]
  },
  "current_api_version": "1.0"
}

Get message details

GET /current/workspace/{workspace_id}/ai/chat/{chat_id}/message/{message_id}/details/

Retrieve detailed information about a specific message, including response text, citations, and cost.

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 200/60s, 2000/hr.

Key response fields:

FieldDescription
stateMessage processing state: ready, in_progress, complete, errored
message.textThe original question text
message.scopeFile/folder scope used for RAG context
message.attachedAttached files as {node_id, version_id} objects
response.textThe AI response (available when state is complete)
response.errorWhether an error occurred during processing
response.cost{tokens, details} — message token cost
response.citationsArray of file citations (see Citation Format below)

Only read the response when state is complete.

Error responses:

Error CodeHTTP StatusCause
APP_MISSING404Message not found in the chat
APP_INTERNAL_ERROR500Internal retrieval failure

Stream message response (SSE)

GET /current/workspace/{workspace_id}/ai/chat/{chat_id}/message/{message_id}/read/

Returns a Server-Sent Events (SSE) stream of the AI response.

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 5/3s, 20/10s, 100/60s, 700/hr.

Request example:

curl -N -X GET "https://api.fast.io/current/workspace/12345678901234567890/ai/chat/aBcDeFgHiJkLmNoPqR/message/xYzAbCdEfGhIjKlMnO/read/" \
  -H "Authorization: Bearer {jwt_token}" \
  -H "Accept: text/event-stream"

SSE stream format:

event: data
data: {"item": "The quarterly report "}

event: data
data: {"item": "shows revenue growth of "}

event: data
data: {"item": "15% year over year."}

event: analysis_data
data: {"type": "analysis_chunk", ...}

event: table_data
data: {"type": "table_data", ...}

event: done

SSE event types:

Event TypeDescription
dataText chunks of the AI response. Payload: {"item": "..."}. Concatenate all data events for the full text.
eventStatus update or event notification
analysis_dataStructured analysis data, citations, and references to source files
table_dataTabular data extracted or generated by the AI
doneStream complete. No more events will be sent.

Behavior:

Error responses:

Error CodeHTTP StatusCause
APP_MISSING404Message not found
APP_ERROR_INPUT_INVALID400Message not in in_progress or complete state
APP_MISSING404No SSE chunk data exists for this message
APP_INTERNAL_ERROR500Internal streaming failure

Publish a private chat

POST /current/workspace/{workspace_id}/ai/chat/{chat_id}/publish/

Makes a private chat public (visible to other workspace members). One-way operation — published chats cannot be made private again.

Auth: Bearer token required. content_ai plan feature required.

Rate limits: 1/1s, 5/10s, 10/60s, 50/hr, 200/day.

Response (200 OK):

{ "result": "yes", "current_api_version": "1.0" }

Error responses:

Error CodeHTTP StatusCause
APP_NOT_ACCEPTED406Chat not found or locked
APP_CONFLICT409Chat is already public
APP_ERROR_DATASTORE500Update failed

Generate AI Share

POST /current/workspace/{workspace_id}/ai/share/

Generates markdown with temporary download URLs for selected files. Designed to be pasted into external AI chatbots.

Auth: Bearer token required. Workspace view permission. Does NOT require content_ai plan feature — available on all plans.

Rate limits: 5/min, 100/hr (per user).

ParameterTypeRequiredDescription
filesarray (JSON)YesJSON array of file opaque IDs. Min 1, max 25.

Request example:

curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/ai/share/" \
  -H "Authorization: Bearer {jwt_token}" \
  -H "Content-Type: application/json" \
  -d '{"files": ["aBcDeFgHiJkLmN", "oPqRsTuVwXyZ12"]}'

Response (200 OK):

{
  "result": "yes",
  "response": {
    "markdown": "## Files\n\n### quarterly-report.pdf\n[Download](https://api.fast.io/...)\nSize: 2.5 MB\n\n..."
  },
  "current_api_version": "1.0"
}
FieldTypeDescription
response.markdownstringGenerated markdown with file info and temporary download URLs

Notes:

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_INPUT_INVALID400Empty files array
APP_ERROR_INPUT_INVALID400More than 25 files

List AI transactions

GET /current/workspace/{workspace_id}/ai/transactions/

Returns up to 40 most recent AI token usage transactions for the workspace. Workspace-only — no share equivalent.

Auth: Bearer token required. Workspace view permission. content_ai plan feature required.

Request example:

curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/ai/transactions/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "count": 2,
    "items": [
      {
        "id": "txn_abc123",
        "type": "chat_with_files",
        "status": "complete",
        "tokens": 1500,
        "updated": "2025-06-15 10:30:05 UTC",
        "created": "2025-06-15 10:30:00 UTC"
      }
    ]
  },
  "current_api_version": "1.0"
}
FieldTypeDescription
response.countintegerNumber of transactions returned
response.items[].idstringFormatted transaction ID
response.items[].typestringParent type (e.g., chat, chat_with_files)
response.items[].statusstringTransaction status
response.items[].tokensintegerToken credits consumed
response.items[].updatedstringLast update timestamp (UTC)
response.items[].createdstringCreation timestamp (UTC)

Asking a Question and Getting the Response

Complete workflow

1. Create the chat:

curl -X POST "https://api.fast.io/current/workspace/{workspace_id}/ai/chat/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d "question=What were the Q3 revenue figures?" \
  -d "type=chat_with_files" \
  -d "personality=detailed"

Response includes chat_id and message_id. The AI begins processing asynchronously.

2. Wait for completion using activity polling (do NOT poll the message endpoint in a loop):

curl -X GET "https://api.fast.io/current/activity/poll/{workspace_id}?wait=95&lastactivity={timestamp}" \
  -H "Authorization: Bearer {jwt_token}"

Watch for the ai_chat:{chatId} activity key. This fires when the message state changes. The server holds the connection for up to 95 seconds and returns immediately when something changes.

3. Check message state:

curl -X GET "https://api.fast.io/current/workspace/{workspace_id}/ai/chat/{chat_id}/message/{message_id}/details/" \
  -H "Authorization: Bearer {jwt_token}"

Message states: readyin_progresscomplete (or errored). Only read the response when state is complete.

4. Stream the response:

curl -N -X GET "https://api.fast.io/current/workspace/{workspace_id}/ai/chat/{chat_id}/message/{message_id}/read/" \
  -H "Authorization: Bearer {jwt_token}" \
  -H "Accept: text/event-stream"

Returns SSE with event types: data (text chunks), analysis_data, table_data, done.

5. Send follow-ups:

curl -X POST "https://api.fast.io/current/workspace/{workspace_id}/ai/chat/{chat_id}/message/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d "question=How does that compare to Q2?"

Same polling flow for the reply.

Linking a user to an AI chat

Construct a workspace URL with a chat query parameter:

https://{org_domain}.fast.io/workspace/{workspace_name}?chat={chat_opaque_id}

The chat_opaque_id is returned in the chat_id field when creating or listing chats.

Share AI Endpoints

Share AI endpoints follow the same pattern as workspace AI. Replace /workspace/{workspace_id} with /share/{share_id}.

Auto-generate OG image

GET /current/share/{share_id}/ai/autoog/

Generates an Open Graph image for the share. Returns binary PNG image data (not JSON).

Auth: Conditional — required for private shares; optional for public shares.

Rate limits (private shares only): 1,000/10min, 20,000/day.

BehaviorDescription
Public shareCustom AI-generated image based on share content
Private shareDefault private image returned

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_NOT_FOUND404Share is disabled
APP_INTERNAL_ERROR500Default image not found on server

Auto-generate title and description

POST /current/share/{share_id}/ai/autotitle/

AI-generates a title, description, and display type based on the share’s contents. Values are applied directly to the share.

Auth: Bearer token required.

Rate limits: 1,000/10min, 5,000/day.

ParameterTypeRequiredDescription
contextstringNoOptional user-provided context to guide AI generation

Request example:

curl -X POST "https://api.fast.io/current/share/12345678901234567890/ai/autotitle/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "title": "Q4 Financial Reports",
    "description": "Quarterly financial reports and analysis for fiscal year 2025.",
    "display_type": "document"
  }
}
FieldTypeDescription
response.titlestringAI-generated title
response.descriptionstringAI-generated description
response.display_typestringAI-suggested display type

Error responses:

Error CodeHTTP StatusCause
APP_DENIED403Insufficient share permissions
APP_INTERNAL_ERROR500Share update or generation failure

Full share chat endpoints (identical to workspace)

EndpointMethodDescription
/current/share/{share_id}/ai/chat/POSTCreate a new chat with initial message
/current/share/{share_id}/ai/chat/list/GETList all chats
/current/share/{share_id}/ai/chat/{chat_id}/details/GETGet chat details with messages
/current/share/{share_id}/ai/chat/{chat_id}/update/POSTUpdate chat name
/current/share/{share_id}/ai/chat/{chat_id}/DELETEDelete a chat
/current/share/{share_id}/ai/chat/{chat_id}/message/POSTSend a follow-up message
/current/share/{share_id}/ai/chat/{chat_id}/messages/list/GETList all messages
/current/share/{share_id}/ai/chat/{chat_id}/message/{message_id}/details/GETGet message details
/current/share/{share_id}/ai/chat/{chat_id}/message/{message_id}/read/GETStream response (SSE)
/current/share/{share_id}/ai/chat/{chat_id}/publish/POSTPublish a private chat
/current/share/{share_id}/ai/share/POSTGenerate AI share markdown

All parameters, response formats, and SSE streaming behavior are identical to the workspace versions documented above.

Workspace AI vs. Share AI differences

FeatureWorkspace AIShare AI
AI Transactions endpointYesNo
Auto OG image endpointNoYes
Auto title endpointNoYes
content_ai feature requiredYes (except AI Share)Yes (except AI Share)
File scope contextWorkspace filesShare files

AI Share File Download

GET /current/ai/share/{token}?file={index}

Download a file from an AI Share using a temporary token. No authentication required — access is controlled by the token.

Rate limits: 60/min, 300/hr (per IP).

ParameterTypeRequiredDescription
{token}string (path)YesAlphanumeric AI share token (generated by the AI Share creation endpoint)
fileinteger (query)YesZero-based file index within the AI Share

Request example:

curl -X GET "https://api.fast.io/current/ai/share/aBcDeFgHiJkLmNoPqRsTuVwXyZ?file=0" \
  -o downloaded_file.pdf

Success response: Binary file data with appropriate Content-Type, Content-Disposition, Content-Length, and Accept-Ranges headers. Supports HTTP range requests.

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_NOT_FOUND404Token missing, invalid, expired, or use limit reached
APP_ERROR_NOT_FOUND404File index out of range
APP_INTERNAL_ERROR500Unable to retrieve or read file

All invalid/expired token errors return 404 to prevent token enumeration.

Search files by meaning using vector-based semantic search. Requires intelligence=true on the workspace/share.

GET /current/workspace/{workspace_id}/ai/search/

Auth: Bearer token required. Workspace view permission. content_ai plan feature required.

Rate limits: 2/1s, 10/10s, 30/60s, 200/hr, 1000/day.

GET /current/share/{share_id}/ai/search/

Identical to workspace semantic search but scoped to a share.

ParameterTypeRequiredDefaultDescription
query_textstringYesSearch query, 2–1,000 characters
files_scopestringNoAll indexed filesComma-separated nodeId:versionId pairs (max 100)
folders_scopestringNoAll indexed filesComma-separated nodeId:depth pairs (max 100, depth 1–10)
limitintegerNo100Results per page, 1–500
offsetintegerNo0Pagination offset

Request example:

curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/ai/search/?query_text=quarterly%20revenue&limit=10" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": true,
  "response_code": 200,
  "results": [
    {
      "content": "The quarterly revenue showed a 15% increase...",
      "score": 0.95,
      "node": {
        "id": "f3jm5-zqzfx-pxdr2-dx8z5-bvnb3-rpjfm4",
        "type": "file",
        "name": "quarterly-report.pdf",
        "parent": "root",
        "size": 1048576,
        "mimetype": "application/pdf",
        "ai": { "state": "ready", "attach": true, "summary": true }
      }
    }
  ],
  "pagination": {
    "total": 25,
    "limit": 10,
    "offset": 0,
    "has_more": true
  }
}
FieldTypeDescription
results[].contentstringMatched text snippet from the indexed document
results[].scorefloatRelevance score (0.0–1.0, higher is more relevant)
results[].nodeobject/nullFull node resource, or null if the file was deleted
results[].file_detailsobjectRaw metadata when node is null (node_id, version_id, name, mimetype)
pagination.totalintegerTotal number of results
pagination.has_morebooleanWhether more results are available

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_INPUT_INVALID400Intelligence not enabled
APP_ERROR_INPUT_INVALID400Malformed files_scope or folders_scope

How to Phrase Questions

With folder/file scope (RAG)

Write questions that will match content in indexed files. The AI searches for relevant passages and cites them. Be specific.

With file attachments

You can be more direct since the AI has the full file content.

Chat Session Object Schema

The chat resource is returned by details and list endpoints.

FieldTypeDescription
chat_idstringOpaque ID of the chat
creatorobject{type: string, id: string} — the chat creator
typestringchat or chat_with_files
namestringDisplay name of the chat
statusstringCurrent chat status
message_countintegerTotal number of messages
messagesarrayFull message list (details endpoint) or omitted
latest_messageobjectMost recent message (list endpoint) or omitted
unique_creatorsarrayDistinct participants as {type, id} objects
costobject{credits: {tokens: int}} — total token cost
efficiencystringEfficiency rating
privacyobject{visibility: "private"|"public", owner: {type, id}|null}
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp

Message Object Schema

FieldTypeDescription
chat_idstringParent chat opaque ID
message_idstringOpaque ID of the message
creatorobject{type: string, id: string} — message author
personalitystringAI personality mode used (concise or detailed)
statestringProcessing state: ready, in_progress, complete, errored
messageobjectUser’s query (see sub-fields below)
message.textstringThe question text
message.author_namestringUser’s given name
message.scopeobjectFile/folder scope used for RAG context
message.attachedarrayAttached files as {node_id, version_id} objects
responseobject/nullAI response (null if not yet available)
response.textstringAI response text
response.errorbooleanWhether an error occurred during processing
response.createdstringISO 8601 response timestamp
response.costobject{tokens: int, details: object} — message token cost
response.author_namestringAI persona name (e.g., Ripley)
response.eventsarrayStatus events generated during processing
response.table_dataarrayStructured table data in the response
response.analysis_chunksarrayAnalysis progress chunks
response.citationsarrayFile citations (see below)

Citation Format

Citations reference specific locations in files that informed the AI response.

FieldTypeDescription
hashstringFile content hash (used for grouping)
nodeIdstringStorage node opaque ID
versionIdstringFile version opaque ID
entriesarrayCitation locations within the file
entries[].pageintegerPage number in the document
entries[].snippetstring/nullRelevant text excerpt
entries[].timestampfloat/nullTimestamp for audio/video files (seconds)

Activity Polling for AI Chat Completion

Do NOT poll the message details endpoint in a loop. Use activity long-polling instead.

GET /current/activity/poll/{workspace_id}?wait=95&lastactivity={timestamp}

The server holds the connection for up to 95 seconds and returns immediately when something changes. Watch for the ai_chat:{chatId} activity key — this fires when the message state changes.

Activity Key PatternWhat Changed
ai_chat:{chatId}AI chat message state updated
storage:{fileId}File added, updated, or removed
preview:{fileId}File preview/thumbnail is ready

Pass the returned lastactivity timestamp into your next poll to receive only newer changes.

Anti-pattern: Do not GET .../ai/chat/{id}/message/{id}/details/ in a loop. Poll once on the workspace activity endpoint and wait for the ai_chat key.

Metadata Templates

Structured metadata for workspace files. Templates define schemas (fields, types, constraints). A single template is assigned at the workspace level — all files in the workspace inherit that schema automatically.

When intelligence is enabled and a template is assigned, metadata is automatically extracted during file ingestion for documents, spreadsheets, images (PNG, JPEG, WebP), and code files.

Metadata Categories

GET /current/metadata/templates/categories/

List all available metadata template categories.

Auth: Bearer token required.

Response (200 OK):

{
  "result": "yes",
  "response": {
    "count": 10,
    "items": [
      "legal", "technical", "engineering", "financial",
      "insurance", "medical", "educational", "multimedia", "hr", "business"
    ]
  },
  "current_api_version": "1.0"
}
CategoryDescription
legalContracts, NDAs, partnership agreements
technicalTech specs, system overviews, hardware docs
engineeringCAD drawings, schematics
financialInvoices, balance sheets, tax forms
insurancePolicies, claims, endorsements
medicalLab reports, patient forms
educationalLesson plans, research papers
multimediaImages, audio, video files
hrResumes, onboarding forms, employee manuals
businessGeneral business documents

Create a template

POST /current/workspace/{workspace_id}/metadata/templates/

Create a new metadata template defining fields, types, and constraints.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 10/min, 100/hr, 300/day.

ParameterTypeRequiredDescription
namestringYesTemplate name (1–255 characters)
descriptionstringYesTemplate description
categorystringYesCategory (1–50 chars). Must be a valid category from the categories endpoint.
fieldsstring (JSON)YesJSON-encoded array of field definitions

Field definition structure:

PropertyTypeDescription
namestringField identifier (alphanumeric + underscore)
descriptionstringHuman-readable description
typestringstring, int, float, bool, json, url, or datetime
minnumberMinimum value/length constraint
maxnumberMaximum value/length constraint
defaultmixedDefault value
fixed_listarrayAllowed values for dropdown-style fields
can_be_nullbooleanWhether the field allows null values

Request example:

curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/metadata/templates/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d 'name=Invoice+Template' \
  -d 'description=Metadata+schema+for+invoices' \
  -d 'category=financial' \
  -d 'fields=[{"name":"invoice_number","description":"Invoice number","type":"string","min":1,"max":50,"can_be_null":false},{"name":"amount","description":"Total amount","type":"float","min":0,"can_be_null":false}]'

Response (200 OK):

{
  "result": "yes",
  "response": {
    "template": {
      "id": "mt_aBcDeFgHiJkLmN",
      "system_template": false,
      "instanceId": "12345678901234567890",
      "orgId": "98765432109876543210",
      "category": "financial",
      "name": "Invoice Template",
      "description": "Metadata schema for invoices",
      "locked": false,
      "priority": null,
      "enabled": false,
      "deleted": null,
      "updated": "2025-01-20 10:30:00",
      "created": "2025-01-20 10:30:00",
      "fields": [
        {
          "name": "invoice_number",
          "description": "Invoice number",
          "type": "string",
          "min": 1,
          "max": 50,
          "fixed_list": [],
          "can_be_null": false
        }
      ]
    }
  },
  "current_api_version": "1.0"
}

Newly created templates start with enabled: false. Use the settings endpoint to enable them.

Delete a template

DELETE /current/workspace/{workspace_id}/metadata/templates/{template_id}/

Soft-delete a metadata template. System templates cannot be deleted.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 10/min, 100/hr, 300/day.

Error responses:

Error CodeHTTP StatusCause
APP_MISSING404Template not found
APP_DENIED403Cannot delete a system template
APP_ERROR_DATASTORE500Deletion failed

List templates

GET /current/workspace/{workspace_id}/metadata/templates/list/

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 3/1s, 10/10s, 20/60s, 50/hr, 200/day.

Optional path filter (append to URL): all (default, both system and custom), custom (non-system only), system (system only), enabled, or disabled.

Request example:

# List all templates
curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/metadata/templates/list/" \
  -H "Authorization: Bearer {jwt_token}"

# List only enabled templates
curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/metadata/templates/list/enabled/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "count": 2,
    "items": [
      {
        "id": "mt_aBcDeFgHiJkLmN",
        "system_template": true,
        "instanceId": null,
        "orgId": null,
        "category": "legal",
        "name": "Contract Template",
        "description": "Standard contract metadata fields",
        "locked": true,
        "priority": 3,
        "enabled": true,
        "deleted": null,
        "updated": "2025-01-15 08:00:00",
        "created": "2025-01-01 00:00:00",
        "fields": [
          {
            "name": "contract_type",
            "description": "Type of contract",
            "type": "string",
            "fixed_list": ["NDA", "MSA", "SOW"],
            "can_be_null": false
          }
        ]
      }
    ]
  },
  "current_api_version": "1.0"
}

Get template details

GET /current/workspace/{workspace_id}/metadata/templates/{template_id}/details/

Returns the full template with fields and workspace-level instance settings.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 3/1s, 10/10s, 20/60s, 50/hr, 200/day.

Update template settings

POST /current/workspace/{workspace_id}/metadata/templates/{template_id}/settings/

Update per-workspace instance settings (enable/disable, priority).

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 20/min, 100/hr, 500/day.

ParameterTypeRequiredDescription
enabledstringYes"true" or "false"
prioritystringYesPriority level "1" through "5"

Error responses:

Error CodeHTTP StatusCause
APP_MISSING404Template not found
APP_ERROR_NOT_FOUND404Template is deleted
APP_DENIED403Template is locked
APP_ERROR_DATASTORE500Update failed

Update template definition

POST /current/workspace/{workspace_id}/metadata/templates/{template_id}/update/

Update a template’s field definitions. All body fields are optional — only provided fields are updated.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 10/min, 100/hr, 300/day.

ParameterTypeRequiredDescription
namestringNoUpdated template name (1–255 characters)
descriptionstringNoUpdated description (up to 1000 characters)
categorystringNoUpdated category (1–50 characters)
fieldsstring (JSON)NoUpdated JSON-encoded array of field definitions

Append /create/ to the path to copy the template instead of updating in place.

Assign template to workspace

POST /current/workspace/{workspace_id}/metadata/template/assign/

One template per workspace. When assigned, files are automatically processed against the template schema.

Unassign template

DELETE /current/workspace/{workspace_id}/metadata/template/unassign/

Remove the workspace template assignment.

Resolve template

GET /current/workspace/{workspace_id}/metadata/template/resolve/{node_id}/

Resolve the workspace template. The node_id parameter is accepted for backwards compatibility but ignored — resolution is workspace-level.

List template assignments

GET /current/workspace/{workspace_id}/metadata/template/assignments/

List all template assignments in the workspace.

Node Metadata

Metadata stored on individual files. Split into template metadata (conforming to the assigned template) and custom metadata (user-defined fields).

Get file metadata

GET /current/workspace/{workspace_id}/storage/{node_id}/metadata/details/

Returns all metadata for a file. Response contains template_metadata and custom_metadata separately.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 5000/hr, 25000/day.

Request example:

curl -X GET "https://api.fast.io/current/workspace/12345678901234567890/storage/aBcDeFgHiJkLmN/metadata/details/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "instance_id": "12345678901234567890",
    "object_id": "aBcDeFgHiJkLmN",
    "template_id": "mt_oPqRsTuVwXyZ12",
    "node_id": {
      "id": "aBcDeFgHiJkLmN",
      "name": "invoice_2025.pdf",
      "type": "file",
      "size": 245760
    },
    "metadata": [
      {
        "key": "invoice_number",
        "description": "Invoice number",
        "type": "string",
        "value": "INV-2025-001",
        "is_auto": false,
        "updated": "2025-01-20 10:30:00"
      },
      {
        "key": "amount",
        "description": "Invoice amount",
        "type": "float",
        "value": 1500.00,
        "is_auto": true,
        "updated": "2025-01-20 10:30:00"
      }
    ]
  },
  "current_api_version": "1.0"
}
FieldTypeDescription
response.template_idstring/nullAssociated template ID, or null
response.node_idobjectStorage node resource with file details
response.metadata[].keystringMetadata field key
response.metadata[].typestringValue type (string, int, float, bool, json, url, datetime)
response.metadata[].valuemixedThe metadata value
response.metadata[].is_autobooleanWhether the value was auto-generated by AI extraction
response.metadata[].updatedstringLast update timestamp

Update file metadata

POST /current/workspace/{workspace_id}/storage/{node_id}/metadata/update/{template_id}/

Set or update metadata key-value pairs on a file.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 250/hr, 1000/day.

ParameterTypeRequiredDescription
key_valuesstring (JSON)YesJSON-encoded object of key-value pairs. Keys must match template field names.

Request example:

curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/storage/aBcDeFgHiJkLmN/metadata/update/mt_oPqRsTuVwXyZ12/" \
  -H "Authorization: Bearer {jwt_token}" \
  -d 'key_values={"invoice_number":"INV-2025-001","amount":1500.00}'

Existing metadata for the same keys is overwritten. Keys not included in the request are left unchanged.

Delete file metadata

DELETE /current/workspace/{workspace_id}/storage/{node_id}/metadata/

Delete metadata keys from a file.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 20/min, 100/hr, 500/day.

ParameterTypeRequiredDescription
keysstring (JSON)NoJSON-encoded array of key names to delete. If omitted, all keys may be removed.

Only files and notes support metadata — folders return an error.

Extract metadata (single file)

POST /current/workspace/{workspace_id}/storage/{node_id}/metadata/extract/

AI-extracts metadata from a file using the workspace template.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 10/min, 100/hr, 300/day.

ParameterTypeRequiredDescription
template_idstringNoOverride workspace template resolution with a specific template

Supports documents, spreadsheets, images (PNG, JPEG, WebP), and code files. Extraction is synchronous. Extracted values are stored with is_auto: true.

Error responses:

Error CodeHTTP StatusCause
APP_ERROR_INPUT_INVALID400Node is root (use extract-all for folders)
APP_ERROR_NOT_FOUND404No template assigned to workspace
APP_ERROR_NOT_FOUND404Node not found
APP_ERROR_DATASTORE500Extraction failed

Extract metadata (batch — entire folder)

POST /current/workspace/{workspace_id}/storage/{folder_id}/metadata/extract-all/

Batch-extract metadata for all files in a folder. Async — returns a job_id for tracking.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 2/min, 10/hr.

Request example:

# Extract all files in a specific folder
curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/storage/aBcDeFgHiJkLmN/metadata/extract-all/" \
  -H "Authorization: Bearer {jwt_token}"

# Extract all files from workspace root
curl -X POST "https://api.fast.io/current/workspace/12345678901234567890/storage/root/metadata/extract-all/" \
  -H "Authorization: Bearer {jwt_token}"

Response (200 OK):

{
  "result": "yes",
  "response": {
    "job_id": "aj_aBcDeFgHiJkLmN",
    "template_id": "mt_oPqRsTuVwXyZ12"
  }
}

Maximum 1,000 files processed per job. Pass root to extract all files in the workspace.

List metadata by template

GET /current/workspace/{workspace_id}/storage/{node_id}/metadata/list/{template_id}/

List all files with metadata for a specific template. Supports filtering and sorting.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 100/min, 1000/hr, 3000/day.

ParameterTypeRequiredDescription
filtersstring (JSON)NoJSON-encoded filter criteria
order_bystringNoField key name to sort by
order_descstringNo"true" or "false" for descending sort

List templates in use

GET /current/workspace/{workspace_id}/storage/{node_id}/metadata/templates/

List templates that have metadata set on files, with object counts.

Auth: Bearer token required. Workspace member. Metadata billing feature required.

Rate limits: 100/min, 400/hr, 1500/day.

Metadata versions

GET /current/workspace/{workspace_id}/storage/{node_id}/metadata/versions/

List metadata version snapshots for a file. Useful for tracking changes to extracted metadata over time.

Metadata views

Save, list, and delete custom views for metadata display.

Create/update a view

POST /current/workspace/{workspace_id}/storage/{node_id}/metadata/view/
ParameterTypeRequiredDescription
namestringYesView name (1–30 characters)
template_idstringYesTemplate ID to associate
filtersstring (JSON)NoFilter criteria
order_bystringNoSort field
order_descstringNo"true" or "false" for descending

Rate limits: 10/min, 200/hr, 500/day.

List views

GET /current/workspace/{workspace_id}/storage/{node_id}/metadata/views/

Rate limits: 50/min, 500/hr, 2000/day.

Delete a view

DELETE /current/workspace/{workspace_id}/storage/{node_id}/metadata/view/{view_id}/

Rate limits: 10/min, 200/hr, 500/day.

Template Resource Schema

FieldTypeDescription
idstringOpaque template identifier
system_templatebooleantrue for system-provided, false for user-created
instanceIdstring/nullWorkspace ID (null for system templates)
orgIdstring/nullOrganization ID (null for system templates)
categorystringTemplate category
namestringTemplate name
descriptionstringTemplate description
lockedbooleanWhether the template is locked from editing
priorityinteger/nullPriority level 1–5, or null
enabledbooleanWhether enabled for the workspace
deletedstring/nullSoft-delete timestamp, or null
updatedstringLast updated timestamp
createdstringCreation timestamp
fieldsarrayArray of field definition objects

Supported Field Types

TypeDescription
stringText values (max 10,000 characters)
intInteger numbers
floatDecimal numbers
boolBoolean true/false
jsonComplex JSON structures
urlValidated URLs
datetimeDate and time values

Quick Reference

Create a RAG chat and get the answer

POST /current/workspace/{id}/ai/chat/
  question=...&type=chat_with_files&personality=detailed
  -> chat_id, message_id

GET  /current/activity/poll/{id}?wait=95&lastactivity=...
  -> wait for ai_chat:{chatId}

GET  /current/workspace/{id}/ai/chat/{chat_id}/message/{msg_id}/details/
  -> check state == complete

GET  /current/workspace/{id}/ai/chat/{chat_id}/message/{msg_id}/read/
  -> SSE stream: data, analysis_data, table_data, done

Create a note (bank knowledge for RAG)

POST /current/workspace/{id}/storage/{parent}/createnote/
  name=research-notes.md&content=...

Extract metadata from a file

POST /current/workspace/{id}/storage/{node}/metadata/extract/

Batch extract metadata for a folder

POST /current/workspace/{id}/storage/{folder}/metadata/extract-all/
  -> returns job_id (rate limited: 2/min, 10/hr)

Semantic search

GET /current/workspace/{id}/ai/search/?query_text=quarterly+revenue&limit=10
↑ Back to top