AI

The AI API provides direct access to Egnyte AI capabilities such as:

  • Document Q&A
  • Summarization
  • Knowledge Base queries
  • Hybrid search

This API is primarily synchronous (request → response).


When to Use

Use the AI API when:

  • You need quick answers on documents
  • You want low-latency responses
  • You do not need agent-level workflows

Use Agents API if you need orchestration or multi-step reasoning.

Note: File and folder paths must be URL-encoded segment by segment. Do not encode forward slashes (/). For example, Shared/example?path/$file.txt should be encoded as Shared/example%3Fpath/%24file.txt.

Base URL

https://{domain}.egnyte.com/pubapi/v1/ai

Authentication

All requests require an OAuth 2.0 Bearer token in the Authorization header:

Authorization: Bearer {access_token}

See Authentication for details on obtaining a token.

Rate Limits

AI API endpoints have stricter rate limits than standard Egnyte APIs. These limits apply per access token:

Limit TypeDefault
Daily100 calls per token
Per minute10 calls per token
Per second2 calls per token

If your production application requires higher limits, contact Egnyte to discuss custom arrangements.

Note: These limits are in addition to the general Egnyte API rate limits described in Best Practices.


Core Capabilities

FeatureEndpoint
Document Q&A/document/{entry-id}/ask
Summarization/document/{entry-id}/summary
AI Assistant (multi-source Q&A)POST /assistant/ask
AI Assistant — Execution Status (poll for result)GET /assistant/{executionId}/status
Copilot (multi-source Q&A) — deprecated, use AI AssistantPOST /copilot/ask
Knowledge Base Q&A/kb/{kb-id}/ask
Hybrid Search/hybrid-search

Ask a Question

Ask a question about a specific document and receive an AI-generated answer based on the document's content.

Request

POST /pubapi/v1/ai/document/{entry-id}/ask

Path Parameters

ParameterTypeRequiredDescription
entry-idstringYesThe unique identifier of the file version

Request Body

FieldTypeRequiredDefaultDescription
questionstringYes—The question to ask about the document
includeCitationsbooleanNofalseWhether to include citations in the response
chatHistoryobjectNo—Previous conversation messages for context
chatHistory.messagesarrayNo[]Array of previous message objects

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/document/{entryId}/ask" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "question": "What is the date of Christmas Day in the US in 2025?",
  "chatHistory": {
    "messages": []
  },
  "includeCitations": true
}'

Response

200 OK

FieldTypeDescription
responseobjectThe AI-generated response
response.textstringThe answer text
citationsarrayList of citations used to generate the response (if includeCitations was true)
citations[].filenamestringName of the cited file
citations[].entryIdstringEntry ID of the cited file
citations[].chunksarraySpecific content chunks referenced
citations[].chunks[].chunkIdstringUnique identifier for the chunk
citations[].chunks[].sourceTextstringThe text excerpt from the document

Example Response

{
  "response": {
    "text": "Christmas Day in the US in 2025 is on December 25th, which falls on a Thursday."
  },
  "citations": [
    {
      "filename": "Policy.pdf",
      "entryId": "535083b1-383a-4352-b993-77900bf5d98a",
      "chunks": [
        {
          "chunkId": "0",
          "sourceText": "Policy Renewal Migration Portability"
        }
      ]
    }
  ]
}

Summarize a Document

Generate an AI-powered summary of a document.

Request

POST /pubapi/v1/ai/document/{entry-id}/summary

Path Parameters

ParameterTypeRequiredDescription
entry-idstringYesThe unique identifier of the file version

Request Body

FieldTypeRequiredDefaultDescription
chatHistoryobjectNo—Previous conversation messages for context
chatHistory.messagesarrayNo[]Array of previous message objects

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/document/{entryId}/summary" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "chatHistory": {
    "messages": []
  }
}'

Response

200 OK

FieldTypeDescription
responseobjectThe AI-generated summary
response.textstringThe summary text

Example Response

{
  "response": {
    "text": "Summary of the document is here"
  }
}

AI Assistant

Ask questions to AI Assistant, which provides AI-driven answers based on content across your Egnyte domain. This is an asynchronous API — the ask returns an execution ID immediately, and you poll a separate status endpoint until the answer is ready.

Note: AI Assistant replaces the deprecated Copilot endpoint. The request format is similar but the response is different — AI Assistant is async while Copilot is synchronous.

Key Behavior

  • Works across multiple documents

  • Supports citations, tool calls, and web search

  • Can be scoped via selectedItems

  • Async: poll /{executionId}/status for the result

Request

POST /pubapi/v1/ai/assistant/ask

Request Body

FieldTypeRequiredDefaultDescription
questionstringYes—The question to ask AI Assistant
selectedItemsobjectNo—Files and folders to include in the search context
selectedItems.foldersarrayNo[]Array of folder objects
selectedItems.folders[].idstringYes—Folder ID
selectedItems.filesarrayNo[]Array of file objects
selectedItems.files[].entryIdstringYes—File entry ID
selectedItems.allEgnyteSearchbooleanNofalseSearch across all content in the Egnyte domain
selectedItems.webSearchbooleanNofalseInclude web search results in the response
includeCitationsbooleanNofalseWhether to include citations in the status response
chatHistoryobjectNo—Previous conversation messages for context
chatHistory.messagesarrayNo[]Array of previous message objects
conversationIdstringNo—Pass the conversationId from a previous response to continue an existing conversation
mcpSelectionIdstringNo—ID of the MCP (Model Context Protocol) server selection to use for this request
modelDetailsobjectNo—Override the AI model. When omitted, defaults to Gemini-2.5 Flash (gemini-2.5-flash)
modelDetails.namestringNo—Display name of the model
modelDetails.versionstringNo—Model version identifier (e.g., gemini-2.5-flash)

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/assistant/ask" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "question": "Describe the file",
  "chatHistory": {
    "messages": []
  },
  "selectedItems": {
    "folders": [
      {
        "id": "{folderId}"
      }
    ],
    "files": [
      {
        "entryId": "{entryId}"
      }
    ]
  },
  "includeCitations": true
}'

Response

200 OK

FieldTypeDescription
conversationIdstringUnique identifier for this conversation. Pass in subsequent requests to continue the conversation
executionIdstringUnique identifier for this execution. Use this to poll /{executionId}/status for the result
executionStatusstringInitial execution status (e.g., IN_PROGRESS)
truncatedbooleanWhether the response was truncated
actionsarrayPending actions returned at submission time, if any

Example Response

{
  "conversationId": "2862a232-20ac-4244-8c1e-871b7a539ae2",
  "executionId": "10cd770f-8b8f-4a76-bf0a-7418dd910fb7",
  "executionStatus": "IN_PROGRESS",
  "truncated": false,
  "actions": []
}

Get Execution Status

Poll this endpoint after calling /ask to retrieve the answer and execution details.

GET /pubapi/v1/ai/assistant/{executionId}/status

Path Parameters

ParameterTypeRequiredDescription
executionIdstringYesThe executionId returned by the /ask response

Query Parameters

ParameterTypeRequiredDefaultDescription
includeCitationsbooleanNotrueWhether to include citations in the response

Execution Status Response

200 OK

FieldTypeDescription
statusstringCurrent execution status. Poll until this is no longer IN_PROGRESS. Possible values: IN_PROGRESS, COMPLETED, FAILED, AWAITING_USER_CONFIRMATION
responseTextstringThe AI-generated answer. Populated when status is COMPLETED
thoughtsarrayModel's reasoning steps
citationsarrayCitations used to generate the response
citations[].filenamestringName of the cited file
citations[].entryIdstringEntry ID of the cited file
citations[].objectIdstringObject ID of the cited file
citations[].previewUrlstringURL to preview the file
citations[].chunksarraySpecific content chunks referenced
citations[].chunks[].chunkIdstringUnique identifier for the chunk
citations[].chunks[].sourceTextstringThe text excerpt from the document
actionsarrayActions returned by the execution
intentstringDetected intent of the question (e.g., qna)
lastUpdatedlongTimestamp of the last status update (Unix epoch in milliseconds)
numToolCallsintegerTotal number of tool calls made
pendingActionsarrayActions awaiting user confirmation (e.g., MCP authentication)
pendingActions[].typestringType of pending action (e.g., MCP_AUTH)
pendingActions[].serverIdstringID of the server requiring the action
pendingActions[].toolCallIdstringID of the tool call that triggered this pending action
toolCallsobjectMap of tool calls made, keyed by tool call ID
toolCalls.<id>.namestringInternal name of the tool
toolCalls.<id>.sourceDisplayNamestringDisplay name of the data source the tool operated on
toolCalls.<id>.toolDisplayNamestringHuman-readable display name of the tool
toolCalls.<id>.thoughtstringModel's reasoning before invoking this tool
toolCalls.<id>.thoughtsarraySequence of reasoning steps for this tool call
toolCalls.<id>.inputobjectInput parameters passed to the tool
toolCalls.<id>.outputobjectOutput returned by the tool
toolCalls.<id>.statusstringExecution status of the tool call
toolCalls.<id>.timestampstringISO 8601 timestamp of when the tool was called
toolCalls.<id>.metadataobjectAdditional key-value metadata about the tool call

Example Response

{
  "status": "COMPLETED",
  "responseText": "The provided document shows several premium examples",
  "thoughts": [],
  "citations": [
    {
      "filename": "Policy.pdf",
      "entryId": "535083b1-383a-4352-b993-77900bf5d98a",
      "objectId": "52.1e0bffbc-500d-4669-82f9-c984a33813e5",
      "previewUrl": "/navigate/file/3bf2374e-49ac-45b2-b3b3-b44e0da88597",
      "chunks": [
        {
          "chunkId": "c590a032-9ac6-467a-aa65-9b58e30bff5b",
          "sourceText": "Text"
        }
      ]
    }
  ],
  "intent": "qna",
  "lastUpdated": 1780660757000,
  "numToolCalls": 2,
  "pendingActions": [],
  "toolCalls": {
    "call_abc123": {
      "name": "search_documents",
      "sourceDisplayName": "Egnyte",
      "toolDisplayName": "Document Search",
      "thought": "Searching for relevant documents",
      "input": { "query": "premium examples" },
      "output": "Found 3 relevant documents",
      "status": "success",
      "timestamp": "2025-06-05T10:00:00Z"
    }
  }
}

Copilot

Deprecated. This endpoint is deprecated and will be removed on September 30, 2026. Use AI Assistant (POST /pubapi/v1/ai/assistant/ask) instead. Note that AI Assistant is asynchronous — see the AI Assistant section for the updated request and response format. Until then, /copilot/ask remains fully supported for backward compatibility.

Ask questions to Egnyte Copilot, which provides AI-driven answers based on content across your Egnyte domain. Optionally specify files or folders to limit the search context.

Key Behavior

  • Works across multiple documents

  • Supports citations

  • Can be scoped via selectedItems

Request

POST /pubapi/v1/ai/copilot/ask

Request Body

FieldTypeRequiredDefaultDescription
questionstringYes—The question to ask Copilot
selectedItemsobjectYes—Files and folders to include in the search context
selectedItems.foldersarrayNo[]Array of folder objects
selectedItems.folders[].idstringYes—Folder ID
selectedItems.filesarrayNo[]Array of file objects
selectedItems.files[].entryIdstringYes—File entry ID
includeCitationsbooleanNofalseWhether to include citations in the response
chatHistoryobjectNo—Previous conversation messages for context
chatHistory.messagesarrayNo[]Array of previous message objects

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/copilot/ask" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "question": "Describe the file",
  "chatHistory": {
    "messages": []
  },
  "selectedItems": {
    "folders": [
      {
        "id": "{folderId}"
      }
    ],
    "files": [
      {
        "entryId": "{entryId}"
      }
    ]
  },
  "includeCitations": true
}'

Response

200 OK

FieldTypeDescription
responseobjectThe AI-generated response
response.textstringThe answer text
citationsarrayList of citations used to generate the response (if includeCitations was true)
citations[].filenamestringName of the cited file
citations[].entryIdstringEntry ID of the cited file
citations[].objectIdstringObject ID of the cited file
citations[].previewUrlstringURL to preview the file
citations[].chunksarraySpecific content chunks referenced
citations[].chunks[].chunkIdstringUnique identifier for the chunk
citations[].chunks[].sourceTextstringThe text excerpt from the document
conversationIdstringUnique identifier for this conversation
deprecationNoticestringPresent only on this deprecated endpoint. Message indicating that /copilot/ask is deprecated and that callers should migrate to /assistant/ask. Not returned by /assistant/ask.

Deprecation Response Headers

HeaderValueDescription
DeprecationtrueSignals to API gateways and proxies that this endpoint is deprecated (RFC 8594)
SunsetWed, 30 Sep 2026 00:00:00 GMTMachine-readable date when the endpoint will be removed (RFC 8594)
Link</pubapi/v1/ai/assistant/ask>; rel="successor-version"URL of the replacement endpoint (RFC 8288)

Example Response

{
  "response": {
    "text": "The provided document shows several premium examples"
  },
  "citations": [
    {
      "filename": "Policy.pdf",
      "entryId": "535083b1-383a-4352-b993-77900bf5d98a",
      "objectId": "52.1e0bffbc-500d-4669-82f9-c984a33813e5",
      "previewUrl": "/navigate/file/3bf2374e-49ac-45b2-b3b3-b44e0da88597",
      "chunks": [
        {
          "chunkId": "c590a032-9ac6-467a-aa65-9b58e30bff5b",
          "sourceText": "Text"
        }
      ]
    }
  ],
  "conversationId": "c655a318-268c-47d2-b6e0-d53dedd117ef",
  "deprecationNotice": "This endpoint is deprecated and will be removed on September 30, 2026. Use POST /pubapi/v1/ai/assistant/ask instead. Note - the replacement endpoint is asynchronous: POST /assistant/ask returns an executionId; poll GET /assistant/{executionId}/status to retrieve the response."
}

List Knowledge Bases

Retrieve a list of Knowledge Bases (KBs) available in your Egnyte domain.

When to Use

  • Structured enterprise knowledge

  • Pre-indexed document sets

Request

POST /pubapi/v1/ai/kb/list

Request Body

FieldTypeRequiredDefaultDescription
sortByarrayYes—Sorting criteria. Allowed values: createdOn, name
sortDirectionarrayYes—Sort direction. Allowed values: ASC, DESC
statusarrayYes—KB status filter. Allowed values: ACTIVE, DELETED, CREATED
pageintegerNo0Page number for pagination
sizeintegerNo200Number of items per page
createdByintegerNo—Filter by user ID of the KB creator
createdAfterlongNo—Filter KBs created after this timestamp (Unix epoch in milliseconds)
createdBeforelongNo—Filter KBs created before this timestamp (Unix epoch in milliseconds)
includePlaceholderDatabooleanNofalseInclude placeholder data in the response
includeProcessingStatisticsbooleanNofalseInclude processing statistics in the response
includePromptsbooleanNofalseInclude prompt-related data in the response

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/kb/list" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "sortBy": [
    "name"
  ],
  "sortDirection": [
    "ASC"
  ],
  "status": [
    "ACTIVE"
  ],
  "includePlaceholderData": false,
  "includeProcessingStatistics": false,
  "includePrompts": false
}'

Response

200 OK

FieldTypeDescription
contentarrayList of Knowledge Base entries
content[].idstringUnique identifier of the KB
content[].namestringName of the KB
content[].descriptionstringDescription of the KB
content[].pathsarrayFolder paths associated with the KB
content[].paths[].idstringUnique identifier of the path
content[].paths[].folderIdstringFolder ID linked to the KB
content[].paths[].pathstringFile path where documents are stored
content[].paths[].permissionstringPermission level (e.g., Owner)
content[].paths[].statusstringPath status (e.g., ACTIVE)
content[].statusstringKB status
content[].typestringKB type (e.g., KBA)
content[].createdBystringDisplay name of the user who created the KB
content[].createdByUserobjectDetails of the user who created the KB
content[].createdByUser.firstNamestringFirst name of the creator
content[].createdByUser.lastNamestringLast name of the creator
content[].createdByUser.userNamestringUsername/email of the creator
content[].createdByUser.userIdintegerUser ID of the creator
content[].createdOnlongTimestamp when the KB was created (Unix epoch in milliseconds)
content[].noResponseMessagestringFeedback message when no AI response is generated
content[].iconNamestringIcon name used for the KB in the UI
content[].subTypestringWhether the KB is SYSTEM_DEFINED or USER_DEFINED
content[].progressintegerProcessing progress percentage
content[].lastProcessedAtlongTimestamp when the KB was last processed (Unix epoch in milliseconds)
content[].pathCountintegerNumber of paths linked to the KB
content[].promptsarrayList of prompts associated with the KB
content[].subStatusstringSub-status of the KB (e.g., WITHIN_LIMIT)
numberintegerCurrent page number
sizeintegerMaximum number of elements per page
firstbooleanWhether this is the first page
lastbooleanWhether this is the last page
emptybooleanWhether the content is empty
numberOfElementsintegerNumber of elements in the current page
totalElementsintegerTotal number of elements across all pages
totalPagesintegerTotal number of pages
fileLimitintegerMaximum number of files allowed

Example Response

{
  "content": [
    {
      "id": "a691dcbf-2d97-4420-8b08-720c88809a9e",
      "name": "KB",
      "description": "KB description",
      "paths": [
        {
          "id": "8804124f-5fb7-476c-846d-10d6c94f7c33",
          "folderId": "0f53980d-7a3b-44d7-ae15-42048bacf993",
          "path": "/Shared/Documents",
          "permission": "Owner",
          "status": "ACTIVE"
        }
      ],
      "status": "ACTIVE",
      "type": "KBA",
      "createdBy": "Ankesh Katiyar",
      "createdByUser": {
        "firstName": "Ankesh",
        "lastName": "Katiyar",
        "userName": "akatiyar@akatiyar",
        "userId": 1,
        "avatarEosObjectId": ""
      },
      "createdOn": 1738570114257,
      "noResponseMessage": "",
      "iconName": "add",
      "subType": "USER_DEFINED",
      "progress": 100,
      "lastProcessedAt": 1738570336155,
      "pathCount": 1,
      "prompts": [],
      "subStatus": "WITHIN_LIMIT"
    }
  ],
  "number": 0,
  "size": 200,
  "first": true,
  "last": true,
  "empty": false,
  "numberOfElements": 1,
  "totalElements": 1,
  "totalPages": 1,
  "fileLimit": 10000
}

Ask Knowledge Base

Ask a question to a specific Knowledge Base and receive an AI-generated answer based on the KB's content.

Request

POST /pubapi/v1/ai/kb/{kb-id}/ask

Path Parameters

ParameterTypeRequiredDescription
kb-idstringYesThe unique identifier of the Knowledge Base

Request Body

FieldTypeRequiredDefaultDescription
questionstringYes—The question to ask the Knowledge Base
includeCitationsbooleanNofalseWhether to include citations in the response
chatHistoryobjectNo—Previous conversation messages for context
chatHistory.messagesarrayNo[]Array of previous message objects with role and content fields

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/kb/{KbId}/ask" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "question": "Explain all the organizational HR policies",
  "chatHistory": {
    "messages": [
      {
        "role": "user",
        "content": "Show me the policies"
      },
      {
        "role": "assistant",
        "content": "I am sorry, but I do not know the answer to this question."
      }
    ]
  },
  "includeCitations": true
}'

Response

200 OK

FieldTypeDescription
responseobjectThe AI-generated response
response.textstringThe answer text
citationsarrayList of citations used to generate the response (if includeCitations was true)
citations[].filenamestringName of the cited file
citations[].entryIdstringEntry ID of the cited file
citations[].objectIdstringObject ID of the cited file
citations[].previewUrlstringURL to preview the file
citations[].chunksarraySpecific content chunks referenced
citations[].chunks[].chunkIdstringUnique identifier for the chunk
citations[].chunks[].sourceTextstringThe text excerpt from the document
conversationIdstringUnique identifier for this conversation

Example Response

{
  "response": {
    "text": "The provided document shows the various HR policies."
  },
  "citations": [
    {
      "filename": "Policy.pdf",
      "entryId": "535083b1-383a-4352-b993-77900bf5d98a",
      "objectId": "52.1e0bffbc-500d-4669-82f9-c984a33813e5",
      "previewUrl": "/navigate/file/3bf2374e-49ac-45b2-b3b3-b44e0da88597",
      "chunks": [
        {
          "chunkId": "c590a032-9ac6-467a-aa65-9b58e30bff5b",
          "sourceText": "Policy Renewal Migration Portability"
        }
      ]
    }
  ],
  "conversationId": "c655a318-268c-47d2-b6e0-d53dedd117ef"
}

Perform a hybrid search that combines traditional keyword-based search with semantic (vector) search to deliver more relevant results.

Key Use Case

  • Retrieve relevant chunks before sending to LLM

Important Notes

  • Responses may include structured citations

  • Tables and rich content are returned as text chunks

  • No polling required (synchronous)

Request

POST /pubapi/v1/hybrid-search

Request Body

FieldTypeRequiredDefaultDescription
semanticWeightfloatYes—Balance between keyword and semantic search. Range: 0.0 (pure keyword) to 1.0 (pure semantic)
querystringYes—The search query text. Must be between 3 and 250 characters
folderPathstringNo—Restrict search to a specific folder path
collectionIdstringNo—Restrict search to a specific collection (Knowledge Base)
createdBystringNo—Filter results by creator username
createdAfterlongNo—Filter results to items created after this timestamp (Unix epoch in milliseconds)
createdBeforelongNo—Filter results to items created before this timestamp (Unix epoch in milliseconds)
limitintegerNo100Maximum number of results to return. Range: 1-1000
preferredFolderPathstringNo—Boost results from this folder path
excludeFolderPathsarrayNo[]Exclude results from these folder paths
folderPathsarrayNo[]Include results only from these folder paths
entryIdsarrayNo[]Restrict search to specific entry IDs

Example Request

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/hybrid-search" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "semanticWeight": 0.5,
  "query": "quarterly financial report",
  "folderPath": "/Shared/Finance",
  "createdBy": "john.doe",
  "createdAfter": 1609459200000,
  "limit": 50,
  "preferredFolderPath": "/Shared/Finance/2023"
}'

Response

200 OK

FieldTypeDescription
resultsarrayList of search results
results[].filenamestringName of the file
results[].entryIdstringUnique identifier for the file entry
results[].objectIdstringObject identifier
results[].chunksarrayList of content chunks matching the query
results[].chunks[].chunkIdstringUnique identifier for the content chunk
results[].chunks[].chunkTextstringThe text content of the chunk
results[].chunks[].typestringType of chunk: TEXT or TABLE
results[].chunks[].scorefloatRelevance score for this chunk

Example Response

{
  "results": [
    {
      "filename": "Financial_Report_2023.pdf",
      "entryId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "objectId": "obj123456",
      "chunks": [
        {
          "chunkId": "chunk-123",
          "chunkText": "The quarterly financial report shows a 15% increase in revenue compared to last year.",
          "type": "TEXT",
          "score": 0.92
        },
        {
          "chunkId": "chunk-124",
          "chunkText": "Operating expenses decreased by 5% due to cost optimization initiatives.",
          "type": "TEXT",
          "score": 0.85
        }
      ]
    },
    {
      "filename": "Budget_Forecast.xlsx",
      "entryId": "b2c3d4e5-f6g7-8901-bcde-fg2345678901",
      "objectId": "obj234567",
      "chunks": [
        {
          "chunkId": "chunk-456",
          "chunkText": "Q1 2023 | Q2 2023 | Q3 2023 | Q4 2023 (Projected)\n$1.2M | $1.4M | $1.5M | $1.7M",
          "type": "TABLE",
          "score": 0.85
        }
      ]
    }
  ]
}

Error Codes

StatusErrorDescriptionResolution
400Bad RequestInvalid request parameters (e.g., query too short, invalid semanticWeight range)Check parameter values and constraints in the request body
401UnauthorizedInvalid or expired OAuth tokenRefresh your OAuth token and retry the request
403ForbiddenInsufficient permissions to access the resourceEnsure the user has the required permissions for the file, folder, or Knowledge Base
404Not FoundFile, folder, or Knowledge Base does not existVerify the entry-id, kb-id, or path is correct
409ConflictForbidden upload location (e.g., /, /Shared, /Private)Use a valid folder path within an allowed location
429Too Many RequestsAI API rate limit exceededImplement exponential backoff and check the Retry-After header. Review rate limits above

Code Examples

curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/ai/document/13c5b4d4-a324-4141-b2a3-365625969d1e/ask" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -d '{
  "question": "What is the date of Christmas Day in the US in 2025?",
  "chatHistory": {
    "messages": []
  },
  "includeCitations": true
}'
Reference →Browse all endpoints