Create a link session for a toolkit in a tool router sessionv3.1
Initiates an authentication link session for a specific toolkit within a tool router session. Returns a link token and redirect URL that users can use to complete the OAuth flow.
Project API key authentication
In: header
Path Parameters
The unique identifier of the tool router session
toolRouterSessionIdRequest Body
application/json
The unique slug identifier of the toolkit to connect
A human-readable alias for this connected account. Must be unique per entity and toolkit within the project.
URL where users will be redirected after completing auth
uriSharing model for this connected account. PRIVATE (default) is usable only by the owning user_id. SHARED is reachable from a tool-router session ONLY when explicitly pinned in the session config — at most one SHARED connection per toolkit per session. Sessions never use a SHARED connection implicitly. Set at creation time only — cannot be changed later.
PRIVATESHAREDResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://backend.composio.dev/api/v3.1/tool_router/session/trs_LX9uJKBinWWr/link" \ -H "Content-Type: application/json" \ -d '{ "toolkit": "github" }'{
"link_token": "lt_abc123xyz",
"redirect_url": "https://app.composio.dev/link/lt_abc123xyz",
"connected_account_id": "ca_abc123xyz",
"account_type": "PRIVATE"
}{
"error": {
"message": "string",
"code": 0,
"slug": "string",
"status": 0,
"request_id": "string",
"suggested_fix": "string",
"errors": [
"string"
]
}
}{
"error": {
"message": "string",
"code": 0,
"slug": "string",
"status": 0,
"request_id": "string",
"suggested_fix": "string",
"errors": [
"string"
]
}
}{
"error": {
"message": "string",
"code": 0,
"slug": "string",
"status": 0,
"request_id": "string",
"suggested_fix": "string",
"errors": [
"string"
]
}
}{
"error": {
"message": "string",
"code": 0,
"slug": "string",
"status": 0,
"request_id": "string",
"suggested_fix": "string",
"errors": [
"string"
]
}
}{
"error": {
"message": "string",
"code": 0,
"slug": "string",
"status": 0,
"request_id": "string",
"suggested_fix": "string",
"errors": [
"string"
]
}
}