Skip to main content

Overview

Upload prepared documents to a knowledge folder, then check that processing completes and the expected passages can be retrieved. Use the upload checklist before and after making changes.

Upload process

Uploading a document takes three requests: ask Anam for a presigned URL, send the file straight to storage, then confirm the upload so processing can start. This is the recommended route for every file, because the second request goes directly to cloud storage and so is not bound by the 4.5MB request body limit that applies to the API itself. A single multipart request to POST /v1/knowledge/groups/{id}/documents also works and is simpler for small files, but it is subject to that limit. See upload limits for file size and monthly allowance.
1

Request presigned URL

Request an upload URL from Anam:
Response:
2

Upload to presigned URL

Upload the file directly to cloud storage:
This step uploads directly to cloud storage, bypassing Anam’s API servers for better performance with large files.
3

Confirm upload

Notify Anam that the upload is complete:
The response returns the document with status PROCESSING. Indexing then runs in the background, so a successful confirmation does not mean the document is searchable yet — poll its status until it reaches READY.

The three requests as one function

The batch example below reuses uploadLargeDocument from here.

Show upload progress

The direct-to-storage request is the slow part, so track progress there with XMLHttpRequest if you need a progress bar. This replaces step 2 only — request the presigned URL and confirm the upload as above.

Monitoring upload progress

After uploading, monitor the document’s processing status:
Document statuses:
  • UPLOADED: File uploaded, waiting for processing
  • PROCESSING: Content is being extracted and indexed
  • READY: Document is searchable
  • FAILED: Processing failed (check errorMessage)
Only READY documents are returned by search. A document that stays in PROCESSING for more than 15 minutes is marked FAILED by a periodic sweep, so a status change can take up to roughly 25 minutes to appear. Poll for longer than that before treating a document as stuck: your own polling loop giving up is not the same as the server failing the document.

Batch uploads

Upload multiple documents efficiently:
Process documents in batches of 4 for optimal performance. The system handles up to 4 documents concurrently.
A successful batch means every file was accepted and queued, not that it is searchable. Wait for each document to reach READY before running retrieval tests against the folder.

Replace an existing document

To change a document’s contents, upload the revised file as a new document and remove the superseded document. The update document API only renames a file; it does not replace its contents or extracted passages. Track document IDs rather than assuming a matching filename identifies the active revision.
1

Prepare and record the replacement

Open the exact file you intend to upload and check a distinctive changed passage. Record the source revision, effective date, target folder, and old document ID. Preserve the original file and relevant persona settings outside the active knowledge folders so you can roll back.
2

Upload and check processing

Use the upload process above, record the new document ID, and wait for it to reach READY. Uploading a second file does not retire the first.If conflicting revisions must not be searchable during the update, prepare a separate replacement folder containing the complete intended document set. Test it before changing the folders selected by the knowledge tool.
3

Retire the old version

For an update in the same folder, delete the superseded document after the replacement is ready. Check the folder’s document list using the IDs you recorded.For a replacement folder, update the tool’s selected folders to use it and remove the old folder from that selection. Check other tools attached to the persona for references to the old material too.
4

Verify retrieval and a fresh conversation

Search for the changed fact and inspect its text, scope, and source document ID. Confirm that superseded IDs no longer appear in results from the selected folders.Start a fresh persona session and test its answer. If an old rule still appears, check the selected files, active IDs, and processing status before editing the prompt.
For example, a fictional returns policy changes from 14 to 30 days for a specified region. Ask about that region and check the returned policy text and effective date; the new filename alone does not prove the updated policy is in use. If verification fails, correct the release or restore the previous coherent set of files and settings from your saved copies, then verify again. Keep a short change record. A local SHA-256 hash can help identify exact file contents; equal file sizes do not prove two files are identical.

Troubleshooting

Error: File size exceeds limitSolutions:
  • Split the document at useful topic boundaries, keeping conditions and exceptions together
  • Compress images while preserving essential text and diagrams
  • Remove unnecessary pages only after checking for unique facts, qualifications, and source references
  • Contact us about Enterprise plans with higher file size limits
Error: Monthly upload quota exceededYour plan allows a fixed number of megabytes uploaded per calendar month. The response states how much of the allowance is left.Solutions:
  • Upload only the files the persona needs, so the allowance is not spent on drafts or duplicates
  • Wait for the allowance to reset at the start of next month
  • Contact us about Enterprise plans with higher upload limits
Possible causes:
  • Invalid API key
  • Invalid folder ID
  • Unsupported file type
Solutions:
  1. Verify API key is valid and has proper permissions
  2. Confirm folder ID exists: GET /v1/knowledge/groups
  3. Check the file is a supported type and that the filename is 255 characters or fewer
  4. Review error message in response
Status remains PROCESSINGPossible causes:
  • Very large file (40-50MB)
  • Complex PDF with many images
  • Service temporarily slow
Solutions:
  1. Keep polling. A document is only considered stuck after 15 minutes in PROCESSING, and the sweep that marks it FAILED runs every 10 minutes, so allow roughly 25 minutes before concluding anything.
  2. Once the status is FAILED, read errorMessage for the reason.
  3. Upload the file again as a new document if it failed, then delete the failed one.
  4. Contact support if the same file fails repeatedly.
Status changes to FAILEDCommon causes:
  • Corrupted file
  • Encrypted or password-protected PDF
  • Invalid file format despite correct extension
  • File contains only images (no text)
Solutions:
  1. Check error message in document details
  2. Verify file opens correctly on your computer
  3. Remove password protection from PDFs
  4. Ensure PDFs contain extractable text (not just images)
  5. Try converting to a different supported format
Error when uploading to presigned URLSolutions:
  • Presigned URLs expire after 1 hour
  • Request a new presigned URL if expired
  • Upload the file immediately after receiving the URL

Next steps

Test the retrieved passages and persona answers, then complete the upload checklist.

Connect knowledge tools

Enable semantic search with knowledge tools

Set up your knowledge base

Organize documents with folders

Single-request upload

The multipart alternative to the presigned flow, for small files

Knowledge overview

Learn how RAG works
Last modified on September 10, 2026