Skip to content

sessions module route (requires sessions:template:write)

PUT
/v1/m/sessions/templates/{id}
curl --request PUT \
--url https://example.com/v1/m/sessions/templates/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "body": { "connectors": [ "example" ], "hooks": { "post_session": [ { "command": "example", "timeout_ms": 1 } ], "post_tool": [ { "command": "example", "timeout_ms": 1 } ], "pre_session": [ { "command": "example", "timeout_ms": 1 } ], "pre_tool": [ { "command": "example", "timeout_ms": 1 } ] }, "policies": { "allowed_tools": [ "example" ], "dlp_mode": "example", "max_session_duration_minutes": 1, "record_io": true }, "settings": { "custom_instructions": "example", "effort": "example", "model": "example", "permission_mode": "example" } }, "description": "example", "name": "example" }'

Replaces one session template; an unknown key in the body is refused rather than dropped, and a built-in template is refused.

id
required
string

Path parameter id.

X-Olivares-Tenant
string format: uuid

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

Media type application/json
Any of:
object
body
Any of:
object
connectors
Any of:
Array
hooks
Any of:
object
post_session
Any of:
Array
Any of:
object
command
Any of:

Hook command; the template authoring handler stores it without semantic validation.

string
timeout_ms
Any of:
integer
post_tool
Any of:
Array
Any of:
object
command
Any of:

Hook command; the template authoring handler stores it without semantic validation.

string
timeout_ms
Any of:
integer
pre_session
Any of:
Array
Any of:
object
command
Any of:

Hook command; the template authoring handler stores it without semantic validation.

string
timeout_ms
Any of:
integer
pre_tool
Any of:
Array
Any of:
object
command
Any of:

Hook command; the template authoring handler stores it without semantic validation.

string
timeout_ms
Any of:
integer
policies
Any of:
object
allowed_tools
Any of:
Array
dlp_mode
Any of:

Validated when the template is reduced for preview or launch.

string
max_session_duration_minutes
Any of:
integer
record_io
Any of:
boolean
settings
Any of:
object
custom_instructions
Any of:

Stored custom instructions.

string
effort
Any of:

Validated when the template is reduced for preview or launch.

string
model
Any of:

Stored template model selector.

string
permission_mode
Any of:

Validated when the template is reduced for preview or launch.

string
description
Any of:

An explicit string replaces the stored description; null/omission preserves it.

string
name
Any of:

An explicit string, including empty, replaces the stored name; null/omission preserves it.

string
Example generated
{
"body": {
"connectors": [
"example"
],
"hooks": {
"post_session": [
{
"command": "example",
"timeout_ms": 1
}
],
"post_tool": [
{
"command": "example",
"timeout_ms": 1
}
],
"pre_session": [
{
"command": "example",
"timeout_ms": 1
}
],
"pre_tool": [
{
"command": "example",
"timeout_ms": 1
}
]
},
"policies": {
"allowed_tools": [
"example"
],
"dlp_mode": "example",
"max_session_duration_minutes": 1,
"record_io": true
},
"settings": {
"custom_instructions": "example",
"effort": "example",
"model": "example",
"permission_mode": "example"
}
},
"description": "example",
"name": "example"
}

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
{}