Session Templates

Session templates define reusable configurations for sessions, including which providers to include. Templates can be used to quickly create new sessions with consistent settings.

Session Templates object

Attributes

object

String

String representing the object's type

id

String

Unique session template identifier

name

String

Template name

description

StringNullable

Template description

metadata

ObjectNullable

Custom key-value pairs

created_at

Date

Timestamp when created

updated_at

Date

Timestamp when last updated

{
"object": "session.template",
"id": "stm_2bCdEfGhJkLmNpQr",
"name": "Production Template",
"description": "Template for production sessions",
"metadata": {
"environment": "production"
},
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
}

List session templates

Returns a paginated list of session templates.

Query Parameters

limit

NumberOptional

Maximum number of items to return (1-100)

after

StringOptional

Return items after this ID

before

StringOptional

Return items before this ID

cursor

StringOptional

Pagination cursor from a previous response

order

EnumOptional

Sort order for results

GEThttp://api.metorial.com/session-templates
curl -X GET "https://api.metorial.com/session-templates" \
-H "Authorization: Bearer metorial_sk_..."

Get session template

Retrieves a specific session template by ID.

URL Parameters

session_template_id

String

The unique identifier for the session_template

GEThttp://api.metorial.com/session-templates/:session_template_id
curl -X GET "https://api.metorial.com/session-templates/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Authorization: Bearer metorial_sk_..."

Create session template

Creates a new session template.

Request Body

name

String

description

StringOptional

metadata

ObjectOptional

Custom key-value pairs for storing additional information

providers

ObjectOptional

Optional list of providers to include in the template

POSThttp://api.metorial.com/session-templates
curl -X POST "https://api.metorial.com/session-templates" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"name": "example_name",
"description": "example_description",
"metadata": {},
"providers": {
"provider_deployment": {
"type": "example_type",
"provider_deployment_id": "example_provider_deployment_id"
},
"provider_config": {
"type": "example_type",
"provider_config_id": "example_provider_config_id"
},
"provider_auth_config": {
"type": "example_type",
"provider_auth_config_id": "example_provider_auth_config_id"
},
"tool_filters": {
"tool_keys": [
"example_item"
]
}
}
}'

Update session template

Updates a specific session template.

URL Parameters

session_template_id

String

The unique identifier for the session_template

Request Body

name

StringOptional

description

StringOptional

metadata

ObjectOptional

Custom key-value pairs for storing additional information

PATCHhttp://api.metorial.com/session-templates/:session_template_id
curl -X PATCH "https://api.metorial.com/session-templates/ses_Rm4Mnheq2bfEPhBhP7SY" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer metorial_sk_..." \
-d '{
"name": "example_name",
"description": "example_description",
"metadata": {}
}'