Get a connection
Read the connection a user's calls use for an integration: their own, or the connection of the group their session acts for.
/api/v1/users/:userId/connections/:integrationconst response = await fetch("https://api.smallworld.sh/api/v1/users/customer_123/connections/github", {
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.integrationstringrequiredAn integration key from GET /integrations, such as github or notion.
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.
{
"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
status is not_connected, with nullable account fields, only when neither the user nor the selected group has a connection. A known user gets this rather than a connection-not-found error.
needs_reauth with source personal means the user should complete a new connect session; the group's connection doesn't replace it meanwhile. With source group, connect the group again.
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.