API (Documents)
API
The API function provides a programmatic interface for managing documents and indexes. Details of how to use the APIs can be found below as well as directly in the platform.
List Documents API
API Version
v0.1
Description
Lists the files currently stored in your collection.
Endpoint
nginxCopyEditPOST https://atlantis.greatwave.ai/api/list-documents
Parameters
key
Collection API key used for authentication
Sample Request
bashCopyEditcurl -i -X POST https://atlantis.greatwave.ai/api/list-documents \
-H "Content-Type: application/json" \
-d '{ "key":"COLLECTION-API-KEY" }'
Sample Response
jsonCopyEdit{
"documents": ["file1.pdf", "file2.txt"]
}
Upload API
API Version
v0.2
Description
Uploads new files to your collection. You can also assign these files to indexes and trigger auto-refreshing of those indexes.
Endpoint
nginxCopyEditPOST https://atlantis.greatwave.ai/api/upload
Parameters
key
Collection API key
files
Array of filenames to upload
index_ids
(optional)
Array of index IDs to refresh after upload
Sample Request
bashCopyEditcurl -i -X POST https://atlantis.greatwave.ai/api/upload \
-H "Content-Type: application/json" \
-d '{ "key":"COLLECTION-API-KEY", "files":["report1.pdf", "report2.pdf"] }'
Sample Response
jsonCopyEdit{
"uploaded": ["file1", "file2"],
"failed": ["file3"],
"skipped": [],
"overwritten": ["file2"],
"refreshed_indexes": [1, 2],
"failed_indexes": [3]
}
Delete File API
API Version
v0.1
Description
Deletes files from your collection. Files cannot be deleted if they are part of an active index unless manually removed first. You can optionally delete all files in the collection.
Endpoint
perlCopyEditDELETE https://atlantis.greatwave.ai/api/delete
Parameters
key
Collection API key
files
Array of filenames to delete
Sample Request
bashCopyEditcurl -i -X DELETE https://atlantis.greatwave.ai/api/delete \
-H "Content-Type: application/json" \
-d '{ "key":"COLLECTION-API-KEY", "files":["report1.pdf", "report2.pdf"] }'
Sample Response
jsonCopyEdit{
"deleted": ["file1", "file2"],
"failed": [
{
"name": "file2",
"message": "File in use by indexes: Annual-Report, Q1 Report"
}
]
}
Last updated