/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
| Method | Path | Description | Auth |
|---|---|---|---|
POST | /documents/presign | Create a document and request an upload URL | [User+Key] |
GET | /documents/status | Check processing status | [User+Key] |
GET | /documents | List documents in a knowledge base | [User+Key] |
POST | /documents/upload-url | Ingest one web page | [User+Key] |
POST | /documents/upload-url-site | Discover pages on a site | [User+Key] |
GET | /documents/:id | Get a document | [User+Key] |
GET | /documents/:id/download | Request a download URL | [User+Key] |
DELETE | /documents/:id | Remove a document | [User+Key] |
POST | /documents/:id/reprocess | Process a document again | [User+Key] |
Request an upload URL
POST /documents/presign
Creates a document in pending_upload and returns a time-limited URL for uploading the raw bytes.
Knowledge base that will receive the document.
Tenant that owns the knowledge base. It must match the knowledge base’s tenant.
Original filename, including its extension.
MIME type of the uploaded file.
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
Document ID returned by the presign request.
status, is_processing, timestamps, and document metadata.
| Status | Meaning |
|---|---|
pending_upload | Waiting for file bytes. |
queued | Uploaded and waiting for processing. |
processing | Being parsed, chunked, embedded, and indexed. |
processed | Searchable and ready for grounded answers. |
failed | Processing did not complete. |
deleted | Removed from active document listings and retrieval. |
List documents
GET /documents
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.
Destination knowledge base.
Owning tenant. It must match the knowledge base’s tenant.
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.
Knowledge base used for access validation.
Owning tenant.
Site root to crawl.
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.