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

status

Enum

Status of the session template

name

String

Template name

description

StringNullable

Template description

metadata

ObjectNullable

Custom key-value pairs

providers

Object

Template providers

created_at

Date

Timestamp when created

updated_at

Date

Timestamp when last updated

{
"object": "session.template",
"id": "stm_2bCdEfGhJkLmNpQr",
"status": "active",
"name": "Production Template",
"description": "Template for production sessions",
"metadata": {},
"providers": [
{
"object": "session.template.provider",
"id": "stp_3cDeFgHjKlMnPqRs",
"status": "active",
"tool_filter": {
"type": "allow_all"
},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"session_template_id": "stm_2bCdEfGhJkLmNpQr",
"deployment": {
"object": "provider.deployment#preview",
"id": "pde_1aBcDeFgHjKlMnPq",
"name": "Production",
"description": "Production deployment",
"metadata": {},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"config": {
"object": "provider.config#preview",
"id": "pcf_7dEfGhJkLmNpQrSt",
"name": "Production Config",
"description": "Configuration for production environment",
"metadata": {},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"auth_config": {
"object": "provider.auth_config#preview"
},
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
{
"object": "session.template.provider",
"id": "stp_3cDeFgHjKlMnPqRs",
"status": "active",
"tool_filter": {
"type": "allow_all"
},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"session_template_id": "stm_2bCdEfGhJkLmNpQr",
"deployment": {
"object": "provider.deployment#preview",
"id": "pde_1aBcDeFgHjKlMnPq",
"name": "Production",
"description": "Production deployment",
"metadata": {},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"config": {
"object": "provider.config#preview",
"id": "pcf_7dEfGhJkLmNpQrSt",
"name": "Production Config",
"description": "Configuration for production environment",
"metadata": {},
"provider_id": "pro_5gHjKlMnPqRsTuVw",
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
},
"auth_config": {
"object": "provider.auth_config#preview"
},
"created_at": "2025-09-15T10:30:00.000Z",
"updated_at": "2026-01-10T14:45:00.000Z"
}
],
"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

after

StringOptional

before

StringOptional

cursor

StringOptional

order

EnumOptional

status

UnionOptional

Filter by status (active, archived)

id

UnionOptional

Filter by session template ID(s)

session_id

UnionOptional

Filter templates that include sessions with these IDs

session_provider_id

UnionOptional

Filter templates that include session providers with these IDs

provider_id

UnionOptional

Filter templates that include providers with these IDs

provider_deployment_id

UnionOptional

Filter templates that include provider deployments with these IDs

provider_config_id

UnionOptional

Filter templates that include provider configs with these IDs

provider_auth_config_id

UnionOptional

Filter templates that include provider auth configs with these IDs

created_at

ObjectOptional

Filter session template creation time by date range

updated_at

ObjectOptional

Filter session template last update time by date range

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_id": "example_provider_deployment_id",
"provider_config_id": "example_provider_config_id",
"provider_auth_config_id": "example_provider_auth_config_id",
"tool_filters": {
"type": "example_type",
"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": {}
}'

Delete session template

Deletes a specific session template.

URL Parameters

session_template_id

String

The unique identifier for the session_template

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

List session template tools

Returns the effective set of tools available through the providers in a session template, filtered by the tool filters of each provider, deployment, config, and auth config.

URL Parameters

session_template_id

String

The unique identifier for the session_template

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