Sessions
Sessions are connections to providers that allow clients to interact with MCP servers. Each session can include one or more provider deployments.
Sessions object
Attributes
object
StringString representing the object's type
id
StringUnique session identifier
name
StringNullableDisplay name
description
StringNullableDescription
status
EnumSession status
connection_status
EnumConnection state
usage
Objectmetadata
ObjectNullableCustom key-value pairs
connection_url
StringNullableDirect MCP connection URL for this session
provider_deployments
ObjectList of provider deployments in this session
created_at
DateTimestamp when created
updated_at
DateTimestamp when last updated
{"object": "session","id": "ses_4dEfGhJkLmNpQrSt","name": "Production Session","description": "Session for production environment","status": "active","connection_status": "connected","usage": {},"metadata": {"environment": "production"},"connection_url": "https://subspace.metorial.io/sol_abc/ten_xyz/sessions/ses_4dEfGhJkLmNpQrSt/mcp","provider_deployments": [{"object": "session.provider_deployment#preview","id": "spr_3cDeFgHjKlMnPqRs","name": "GitHub Provider","provider_id": "pro_5gHjKlMnPqRsTuVw","provider_deployment_id": "pde_1aBcDeFgHjKlMnPq"}],"created_at": "2025-09-15T10:30:00.000Z","updated_at": "2026-01-10T14:45:00.000Z"}
List sessions
Returns a paginated list of sessions.
Query Parameters
limit
NumberOptionalMaximum number of items to return (1-100)
after
StringOptionalReturn items after this ID
before
StringOptionalReturn items before this ID
cursor
StringOptionalPagination cursor from a previous response
order
EnumOptionalSort order for results
status
UnionOptionalprovider_id
UnionOptionalprovider_deployment_id
UnionOptionalcurl -X GET "https://api.metorial.com/sessions" \-H "Authorization: Bearer metorial_sk_..."
Get session
Retrieves a specific session by ID.
URL Parameters
session_id
StringThe unique identifier for the session
curl -X GET "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."
Create session
Creates a new session with provider deployments.
Request Body
name
StringOptionaldescription
StringOptionalmetadata
ObjectOptionalA key-value map
providers
Objectcurl -X POST "https://api.metorial.com/sessions" \-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"},"session_template_id": "example_session_template_id","tool_filters": {"tool_keys": ["example_item"]}}}'
Update session
Updates a session.
URL Parameters
session_id
StringThe unique identifier for the session
Request Body
name
StringOptionaldescription
StringOptionalmetadata
ObjectOptionalCustom key-value pairs for storing additional information
curl -X PATCH "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"name": "example_name","description": "example_description","metadata": {}}'
Delete session
Deletes a session.
URL Parameters
session_id
StringThe unique identifier for the session
curl -X DELETE "https://api.metorial.com/sessions/ses_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."