/documents and support API keys or signed-in user sessions.
All endpoints on this page are [User+Key]. API keys need the corresponding
documents:read, documents:write, or documents:delete scope.Endpoints
Request an upload URL
POST /documents/presign
Creates a document in pending_upload and returns a time-limited URL for uploading the raw bytes.
string
required
Knowledge base that will receive the document.
string
required
Tenant that owns the knowledge base. It must match the knowledge base’s tenant.
string
required
Original filename, including its extension.
string
required
MIME type of the uploaded file.
number
required
File size in bytes. AutoSage checks document and storage quotas before returning an upload URL.
document_id, upload_url, s3_key, and expires_at. Treat s3_key as an opaque storage identifier.
Upload the bytes
Upload the file directly to the returnedupload_url before it expires:
Check processing status
GET /documents/status
string
required
Document ID returned by the presign request.
status, is_processing, timestamps, and document metadata.
List documents
GET /documents
string
required
Knowledge base whose active documents to list.
Ingest one web page
POST /documents/upload-url
Fetches one URL, converts its readable content into a document, and queues it for processing.
string
required
Destination knowledge base.
string
required
Owning tenant. It must match the knowledge base’s tenant.
string
required
Page to ingest. AutoSage adds
https:// when the scheme is omitted.Discover site URLs
POST /documents/upload-url-site
Discovers up to 25 pages from a site. This endpoint returns URLs; ingest selected pages individually with /documents/upload-url.
string
required
Knowledge base used for access validation.
string
required
Owning tenant.
string
required
Site root to crawl.
boolean
Include matching subdomains. Defaults to
false.Get a document
GET /documents/:id
Returns metadata for one document, including its processing state.
Request a download URL
GET /documents/:id/download
Returns a time-limited download_url for the original file, plus filename and expires_at.
Remove a document
DELETE /documents/:id
Removes the document from search and begins cleanup of its stored file and indexed content.
Reprocess a document
POST /documents/:id/reprocess
Queues an existing document for processing again. This is useful after a failed status. Removed documents and derived text documents cannot be reprocessed independently.
Next steps
Upload guide
Implement the presigned upload flow in your application.
Ingestion lifecycle
Understand processing stages, statuses, and quotas.
Knowledge bases
Manage the knowledge base that owns these documents.
Retrieval lifecycle
See how processed content grounds answers.