List a user's connections
List the account a represented user's calls use for each integration: their own, or the account of the group their session acts for.
/api/v1/users/:userId/connectionsconst response = await fetch("https://api.smallworld.sh/api/v1/users/customer_123/connections", {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
Use your server-side apiKey. Replace the example IDs.
Path parameters#
userIdstringrequiredYour application's user ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes. Encode the IDs
.and..as%2Eand%2E%2E: curl sends these as written, but JavaScript'sfetchremoves them even when encoded.
Query parameters#
groupIdstringYour application's group ID: which of the user's groups the result is for. Omit it for a user with no group or one group. Required when the user belongs to several groups. URL-encode it.
Responses#
The user's own account. The provider accepted the credentials; secret credential values are never returned.
{
"items": [
{
"integration": "github",
"userId": "customer_123",
"groupId": null,
"source": "personal",
"overridesGroup": false,
"authScheme": "api_key",
"status": "connected",
"accountId": "123456",
"accountName": "octocat",
"workspaceId": null,
"connectedAt": "2026-10-10T12:00:01.000Z",
"updatedAt": "2026-10-10T12:00:01.000Z",
"error": null
}
]
}
More about this endpoint
One item per integration. The user's own connection is listed when they have one; otherwise the selected group's. An own connection that needs reauthorization still wins over the group's until the user reconnects or you disconnect it.
groupId follows the rules of a new session in POST /worlds/:worldId/execute. Without it, a user with no groups is read without a group and a user with one group is read for that group. A user in several groups needs groupId. Two of a user's groups can have different accounts for the same integration, so read the connections for the group of the session you run.
The user must already exist. Disconnected accounts and built-in integrations are omitted. An explicitly disconnected own account counts as absent, so the group's connection is listed again.
Connections can be used in multiple Worlds when World policies allow them.