API Reference

Sessions (prev Tool Router)

These are Composio's session endpoints. A session is the runtime context your agent uses to work for one of your users: it scopes which user's connected accounts are in play, which tools are available, how authentication happens, and where execution state lives. Read What is a session? for the full concept.

Sessions were formerly called the "tool router", which is why these endpoints live under tool_router. They are the same thing.

In the SDK you do not call these endpoints directly. Use composio.create(...) to start a session and composio.use(...) to resume one, then call session.tools(), session.execute(...), and session.authorize(...) on the returned object.

Reach for the raw API when you need lower-level control: creating and patching a session config, attaching to an existing session, searching for tools, executing tools and meta tools, opening link sessions for auth, proxying authenticated requests, and reading or writing files in a session mount.

See Configuring sessions for toolkits, auth configs, account selection, and presets.

Endpoints

EndpointQuick Link
POST /api/v3.1/tool_router/sessionCreate a new tool router session
GET /api/v3.1/tool_router/session/{session_id}Get a tool router session by ID (v3.1)
PATCH /api/v3.1/tool_router/session/{session_id}Patch a tool router session config (v3.1)
POST /api/v3.1/tool_router/session/{session_id}/attachAttach to an existing tool router session (v3.1)
GET /api/v3.1/tool_router/session/{session_id}/config_historyList a tool router session config history
POST /api/v3.1/tool_router/session/{session_id}/searchSearch for tools using a query
GET /api/v3.1/tool_router/session/{session_id}/toolsList tools with schemas for a tool router session (v3.1)
POST /api/v3.1/tool_router/session/{session_id}/executeExecute a tool within a tool router session
POST /api/v3.1/tool_router/session/{session_id}/execute_metaExecute a meta tool within a tool router session
POST /api/v3.1/tool_router/session/{session_id}/linkCreate a link session for a toolkit in a tool router session
POST /api/v3.1/tool_router/session/{session_id}/proxy_executeExecute proxy request within a tool router session
GET /api/v3.1/tool_router/session/{session_id}/toolkitsGet toolkits for a tool router session
GET /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/itemsList files in a session mount
POST /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/download_urlCreate a presigned download URL for a mount file
POST /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/upload_urlCreate a presigned upload URL for a mount file
POST /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/deleteDelete a file from a session mount

On this page