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
| Endpoint | Quick Link |
|---|---|
POST /api/v3.1/tool_router/session | Create 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}/attach | Attach to an existing tool router session (v3.1) |
GET /api/v3.1/tool_router/session/{session_id}/config_history | List a tool router session config history |
POST /api/v3.1/tool_router/session/{session_id}/search | Search for tools using a query |
GET /api/v3.1/tool_router/session/{session_id}/tools | List tools with schemas for a tool router session (v3.1) |
POST /api/v3.1/tool_router/session/{session_id}/execute | Execute a tool within a tool router session |
POST /api/v3.1/tool_router/session/{session_id}/execute_meta | Execute a meta tool within a tool router session |
POST /api/v3.1/tool_router/session/{session_id}/link | Create a link session for a toolkit in a tool router session |
POST /api/v3.1/tool_router/session/{session_id}/proxy_execute | Execute proxy request within a tool router session |
GET /api/v3.1/tool_router/session/{session_id}/toolkits | Get toolkits for a tool router session |
GET /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/items | List files in a session mount |
POST /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/download_url | Create a presigned download URL for a mount file |
POST /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/upload_url | Create a presigned upload URL for a mount file |
POST /api/v3.1/tool_router/session/{session_id}/mounts/{mount_id}/delete | Delete a file from a session mount |