Skip to main content

Replace the folders an Oliver chat is scoped to.

POST/api/v1/oliver-threads/{oliver_thread_id}/contexts/replaceoliver:run

Scopes your own folder-scoped chat to exactly the folders named, as the Portal's scope change does: the folders it had are marked superseded, the new ones added, and a continuation run retries the chat's original request with the new scope (continuation_oliver_run_id; follow it with wait_oliver_run). Each folder is checked as in create_oliver_thread (422 reference_not_found or reference_forbidden naming the ID you sent) and again by the Portal. A chat that is not scoped to a folder is 409 (documents and dataviews are not replaced here). Naming the folders it already has changes nothing. If-Match is the thread's ETag from get_oliver_thread, evaluated under the thread's lock. A progressive thread is refused (403). Needs Accept Oliver Scope Proposals, Start Oliver Runs and Execute Oliver Tools, as the Portal's scope change does; callers without View Oliver Conversations receive a write receipt.

Scopeoliver:run
AsynchronousNo
MCP toolreplace_oliver_thread_contexts
Portal permissionsaccept_oliver_scope_proposals, start_oliver_runs, execute_oliver_tools

Parameters​

NameInTypeRequiredDescription
oliver_thread_idpathstringRequired
Docwize-Versionheaderstring (date)Optional
If-MatchheaderstringOptional

Request body​

Content typeType
application/jsonOliverThreadContextsReplaceInput

Responses​

StatusDescriptionBody
200Success.application/json OliverThreadContextSet
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
404not_foundapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409conflictapplication/problem+json Problem
412precondition_failedapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

OliverThreadContext​

FieldTypeRequiredDescription
dataview_idstring or nullRequiredThe dataview, for type dataview.
document_idstring or nullRequiredThe document, for type document.
folder_idstring or nullRequiredThe folder, for type folder.
labelstring or nullRequiredWhat the Portal shows for the context: a document's number, a folder's or dataview's name. Read-only: ignored when sent.
typestringRequireddocument, folder or dataview. A context this API does not set (a search, a clustering run, a redaction) reads as unknown.
type_codestring or nullRequiredThe stored type of a context whose type is unknown. Read-only.

OliverThreadContextInput​

FieldTypeRequiredDescription
dataview_idstring or nullOptionalThe dataview, for type dataview.
document_idstring or nullOptionalThe document, for type document.
folder_idstring or nullOptionalThe folder, for type folder.
labelstring or nullOptionalWhat the Portal shows for the context: a document's number, a folder's or dataview's name. Read-only: ignored when sent.
typestringRequireddocument, folder or dataview. A context this API does not set (a search, a clustering run, a redaction) reads as unknown.
type_codestring or nullOptionalThe stored type of a context whose type is unknown. Read-only.

OliverThreadContextSet​

FieldTypeRequiredDescription
changedbooleanRequiredFalse when the chat was already scoped to exactly these folders: nothing was written and no run was started.
contextsarray of OliverThreadContextRequiredWhat the chat is scoped to now.
continuation_oliver_run_idstring or nullRequiredThe run that retries the original request with the new scope; null when nothing changed.

OliverThreadContextsReplaceInput​

FieldTypeRequiredDescription
contextsarray of OliverThreadContextInputRequiredThe folders the chat is scoped to from now on, each {type: folder, folder_id}, replacing the folders it has. At least one; each must be readable by you (422 names the ID you sent) and needs folders:read.
source_oliver_run_idstring or nullOptionalThe run whose request is retried with the new scope; omit for the thread's latest run.