- Previous: File System API
- Up: Overview
- Next: Permissions API
AI API
The Egnyte AI API allows you to access AI features such as asking questions, generating document summaries, interacting with Egnyte Copilot, and Knowledge Bases.
URL Encoding
Note that the Path parameter in the API endpoints described below must be URL encoded in a special way. Each element of the path needs to be separately encoded; i.e., the forward slashes ('/') in the path must not be encoded, but the text in between must be. This is required because filesystem paths on Egnyte can contain characters which are not permitted in the path portion of a URL.
For example, this path: Shared/example?path/$file.txt should be encoded as Shared/example%3Fpath/%24file.txt
Rate Limiting
In addition to general rate limiting as mentioned in Best Practices, our AI APIs have more stringent rate limits that apply to all the AI APIs. These rate limits restrict the number of calls per day, per minute, and per second. Like the generic rate limits mentioned above, these rate limits are also enforced per access token rather than against the entire key. Integrations should be built with inherent support for receiving and handling these throttles. The default AI API rate limits are:
Description | Limit |
---|---|
API Key |
100 API calls per day per token |
If you anticipate that your API call volume will exceed these limits when your application is in production, please contact us and we can discuss other arrangements.
If your API call is throttled, you will see a response with a 429 HTTP status code with the following value for the X-Mashery-Error-Code header field:
Error | Description |
---|---|
429 | Requests from this source has gone over its rate limit quota. |
API Methods
Ask a Question
Allows users to ask questions related to a given document, providing an AI-driven response based on the document content.
Request Parameters:
Parameter | Description | Required | Possible Values |
---|---|---|---|
entry-id | The id of the specific version of the file | Yes (Included in the endpoint URL) | A valid unique string identifying the file version |
question |
The specific question user wants to ask against the document |
Yes |
A string (e.g. What is the date of Christmas Day in the US in 2025) |
includeCitations | Whether the response should include citations(defaults to false) | No |
true/false |
chatHistory | An object representing previous interactions | No |
|
Request Examples
Response Parameters:
Parameter | Description |
---|---|
response | The response to the question |
citations | A list or object containing citations or references used in generating the response |
Sample Response
{ "response": { "text": "The provided document." }, "citations":[ { "filename": "Policy.pdf", "entryId": "535083b1-383a-4352-b993-77900bf5d98a", "chunks":[ { "chunkId": "0", "sourceText": "Policy Renewal Migration Portability" } ] } ] }
Summarize a Document
Allows users to generate summary for a given document, providing an AI-driven response based on the document content.
Request Parameters:
Parameter | Description | Required | Possible Values |
---|---|---|---|
entry-id | The id of the specific version of the file | Yes (Included in the endpoint URL) | A valid unique string identifying the file version |
chatHistory | An object representing previous interactions | No |
|
Request Examples
Response Parameters:
Parameter | Description |
---|---|
response | The summary of the document |
Sample Response
{ "response": { "text": "Summary of the document is here" }, }
Copilot
Allows users to ask questions to the platform copilot, providing an AI-driven response based on the global content within their Egnyte domain. Users can optionally specify the particular context (files/folders) to limit the content to be synthesized to get the answer.
Request Parameters:
Parameter | Description | Required | Possible Values |
---|---|---|---|
selectedItems | The folder id/file entry id of the specific folders/files to be considered for the context | Yes | A valid unique string identifying the folder/file version |
question |
The specific question the user wants to ask against the document |
Yes |
A string (e.g. Describe the file) |
includeCitations | Whether the response should include citations (defaults to false) | No |
true/false |
chatHistory | An object representing previous interactions | No |
|
Request Examples
Response Parameters:
Parameter | Description |
---|---|
responseText | The response to the question asked to copilot |
citations | A list or object containing citations or references used in generating the response |
conversationId | A unique identifier for the conversation |
Sample 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" }
Knowledge Base (KB) Listing
Allows users to get the list of Knowledge Bases (KB) available within their Egnyte domain.
Request Parameters:
Parameter | Description | Required | Possible Values |
---|---|---|---|
sortBy | The sorting criteria for the results | Yes | createdOn/name |
sortDirection | The sort direction for the results | Yes | ASC/DESC |
status | The status of the KB to be retrieved | Yes | ACTIVE/DELETED/CREATED |
page | The page number to be retrived in a paginated response | No | A positive number |
size | The size of the folder or the number of items per page in a paginated response | No | A positive number |
createdBy | The ID of the user who created the KB. The result will be filtered by this ID when provided. | No | A valid unique string identifying the user (e.g. 123) |
createdAfter | Filter criteria to retrive the KB created after the specified timestamp | No | A valid date/time in milliseconds (e.g. 1738570114257) |
createdBefore | Filter criteria to retrive the KB created before the specified timestamp | No | A valid date/time in milliseconds (e.g. 1738570114257) |
includePlaceholderData | If true, includes the placeholder data in the response | No |
true/false |
includeProcessingStatistics | If true, includes the processing statistics in the response | No |
true/false |
includePrompts | If true, includes the prompt-related data in the response | No |
true/false |
Request Examples
- Previous: File System API
- Up: Overview
- Next: Permissions API
Docs Navigation
- Overview
- Getting Started
- Authentication
- Best Practices
- File System API
- AI API
- Permissions API
- Events API
- Search API
- Links API
- Workflow API
- User Management API
- Group Management API
- Audit Reporting API v2
- Trash API
- Comments API
- Metadata API
- Embedded UI API
- Bookmarks API
- User Insights API
- Folder Options API
- Project Folder API
- Controlled Document Management API
- eTMF API
- Document Portal API
- Mobile Development
- Other Applications
- UI Integration Framework
- Webhooks
- Secure and Govern API
- Audit Reporting API V1
- MSP API
- Upload Requests API