sessions module route (requires sessions:template:write)
PUT
/v1/m/sessions/templates/{id}
const url = 'https://example.com/v1/m/sessions/templates/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string
Path parameter id.
Header Parameters
Section titled “Header Parameters ” X-Olivares-Tenant
string format: uuid
Target tenant id; required when the principal can act in more than one tenant.
Request Body required
Section titled “Request Body required ” Media type application/json
Any of:
object
body
Any of:
object
hooks
Any of:
object
post_session
post_tool
pre_session
null
policies
settings
Any of:
object
null
null
description
null
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"}Responses
Section titled “ Responses ”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
{}