- π οΈ API Contracts
- Knowledge Base API reference
- Knowledge File API
Get a file inside knowledge base
const url = 'https://api.amitysolutions.com/api/v1/knowledge/1/files/1';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.amitysolutions.com/api/v1/knowledge/1/files/1 \ --header 'x-api-key: <x-api-key>'Authorizations
Section titled βAuthorizationsβParameters
Section titled β Parameters βPath Parameters
Section titled βPath ParametersβKnowledge Base ID
Knowledge File ID
Responses
Section titled β Responses βFile with specified ID
object
Numeric ID of the file
Generated unique name of the file in storage
Current status of the file, either active or deleting. When the status is deleting, the contents of the file will not be passed to LLM.
File path in storage container
File path in storage container
The storage container that the file is stored
File metadata
object
The version of parent knowledge base
object
Numeric ID of the knowledge
The name of the knowledge
Type of knowledge base. internal will search the content from uploaded files and external will send a request to target endpoint for search.
List of supported languages for the knowledge. Files uploaded to this knowledge will have a copy of the document with each supported language translated.
Search endpoint for external knowledge bases
If set to true, search will use semantic search on top of full-text search.
Timestamp of creation for knowledge
Last updated timestamp for knowledge
Timestamp of creation for knowledge
Last updated timestamp for knowledge
Example
{ "status": "active", "knowledge": { "source": "internal", "supportedLanguages": [ "en" ], "createdAt": "2023-11-09T00:00:00.000Z", "updatedAt": "2023-11-09T00:00:00.000Z" }, "createdAt": "2023-11-09T00:00:00.000Z", "updatedAt": "2023-11-09T00:00:00.000Z"}Unauthorized Error. ASAP will return this error when there is either no api key, invalid api key or the client`s IP address is not whitelisted.
object
object
Example
{ "name": "UnauthorizedException", "code": 401001, "status": 401, "message": "Unauthorized", "errors": []}Not found error. Could be one of KnowledgeNotFoundError or KnowledgeFileNotFoundError
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
Example
{ "name": "NotFoundException", "code": 404001, "status": 404, "message": "Knowledge base with specified ID not found.", "errors": []}Validation Error
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
Type of error
Name of the field having the error
Input value
Error message
Example
{ "name": "UnprocessableEntityException", "code": 422001, "status": 422, "message": "request payload validation failed", "errors": [ { "type": "isNotEmpty", "field": "name", "message": "name must not be empty" }, { "type": "min", "field": "limit", "value": -1, "message": "limit must not be less than 1" } ]}Too Many Requests
object
Name of the error
ASAP platform specific error code
HTTP status code
Error message details
object
Example
{ "name": "RateLimitExceededException", "code": 429001, "status": 429, "message": "Rate limit exceeded", "errors": []}Was this page helpful?
Thank you for your feedback!