- Explicitly with POST
/v2/agents//threads//observe: learns messages (JSON) or a file (multipart/form-data) asynchronously in the background without writing an answer. - During conversation with
observe-and-respondorobserve-and-recall: answers or recalls immediately, then learns from the turn. See Answering.
Unified observe endpoint
In v2, one endpoint handles both messages and documents based on Content-Type:
application/json: one message or a batch of up to 100 messages.multipart/form-data: one file (up to 30 MiB and 20,000 pieces).
Idempotency-Key header (retained 24 hours) so safe retries replay the original 202 without duplicating work or billing.
Learn messages (JSON observe)
Send a single message (or a list of up to 100 messages in chronological order):
Success (
202):
Location header points directly to GET/v2/agents//threads//observe/.
Learn a document (multipart observe)
Upload files with multipart/form-data: one file part per document, repeated to send several in one request, within the upload limits in Limits. Supported formats include PDF, Word (.doc, .docx), PowerPoint (.ppt, .pptx, .pps, .ppsx), Excel (.xls, .xlsx, .xlsb), OpenDocument (.odt, .ods, .odp), CSV, RTF, EPUB, Markdown, plain text, source files, and images (PNG, JPEG, GIF, WebP read as one-page documents). Priors inspects file bytes, not just the filename. SVG is not accepted.
Success (
202): observation_id is null. files lists each file in the order sent, with its file_id, its own observation_id, duplicate, and error (null when the file was accepted). Poll each file’s observation_id.
Note that the v2 202 response does not have a top-level queued field. When the agent is already reading another file, Priors accepts the upload with 202 and queues it on the server; polling GET…/observe/ reports "status": "queued" until it starts.
Upload limits and concurrency
- File cap: 30 MiB per file; 20,000 pieces per file.
- Upload arrival rate: 1 per 10 s per subject; 6 per 10 s per organization.
- Concurrent reads: 1 file at a time per agent (additional uploads queue on the server); 3 files at once per organization (
429withRetry-After: 90when exceeded). - Answering while uploading:
observe-and-respond,respond,observe-and-recall, andrecallall run normally while a file is being learned.
Poll learning status
Call GET/v2/agents//threads//observe/ until a terminal status arrives. Honor the Retry-After header while the job is running.