Skip to content

Upserts a context/compaction policy by (scope_kind, scope_ref).

POST
/v1/m/knowledge/context-policies
curl --request POST \
--url https://example.com/v1/m/knowledge/context-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "effect": "", "max_tokens": 1, "redaction_required": true, "scope_kind": "session", "scope_ref": "example", "spec": {}, "strategy": "" }'

Upserts a context/compaction policy by (scope_kind, scope_ref).

X-Olivares-Tenant
string format: uuid

Target tenant id; required when the principal can act in more than one tenant.

Media type application/json
object
effect
string
default: allow
Allowed values: "" allow forbid
max_tokens
integer format: int64
<= 10000000
redaction_required
boolean
scope_kind
required
string
Allowed values: session agent user user_group role agent_group kb workspace tenant
scope_ref
required
string
>= 1 characters <= 1024 characters /\S/
spec
Any of:

Policy-specific JSON object; nested fields are not decoded into a typed DTO.

object
key
additional properties
any
strategy
string
default: truncate
Allowed values: "" truncate summarize window

OK

Media type application/json
object
Example generated
{}

Bad request

Media type application/json
object
Example generated
{}

Unauthenticated

Media type application/json
object
Example generated
{}

Forbidden

Media type application/json
object
Example generated
{}

Not found

Media type application/json
object
Example generated
{}

Conflict / setup required

Media type application/json
object
Example generated
{}

Rate limited

Media type application/json
object
Example generated
{}