Create a group connect session
Create a hosted flow that connects one account for a whole group, through OAuth consent or API-key entry.
/api/v1/groups/:groupId/connect-sessionsOpen the returned connectUrl in the browser of the person connecting for the group. When they return, read the connect session and confirm it with the groupId if its status is awaiting_confirmation. Connect a group walks through it.
const response = await fetch("https://api.smallworld.sh/api/v1/groups/team_42/connect-sessions", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"integration": "github",
"redirectUrl": "https://app.example.com/settings/integrations",
"requireConfirmation": true
}),
});
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#
groupIdstringrequiredYour application's group ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes.
Request body#
integrationstringrequiredThe key from GET /integrations.
redirectUrlstring | nullOptional absolute URL, at most 2048 characters. HTTPS is required; HTTP is allowed only for loopback development. No credentials or fragment.
requireConfirmationbooleanDefaults to false. true holds credentials until your backend confirms the session with this groupId; requires redirectUrl.
Responses#
A new hosted attempt was created for the group. connectUrl is returned only here; navigate the browser to it.
{
"id": "01995e58-2000-7000-8000-009ea3dcd8fc",
"integration": "github",
"userId": null,
"groupId": "team_42",
"status": "pending",
"requireConfirmation": true,
"redirectUrl": "https://app.example.com/settings/integrations",
"error": null,
"connection": null,
"expiresAt": "2026-10-10T12:30:00.000Z",
"createdAt": "2026-10-10T12:00:00.000Z",
"updatedAt": "2026-10-10T12:00:00.000Z",
"completedAt": null,
"connectUrl": "https://api.example.com/api/integrations/connect/one-time-example-token"
}
More about this endpoint
The group must already exist. Check that the person signed in to your application may connect accounts for this group before you create the session, and again before you confirm it.
The hosted API-key form names the group, such as Connect GitHub for Support team, and says that everyone in the group can use the account. A group without a name is called your team. OAuth continues to the provider's consent screen.
When the flow completes, the account is the group's. Members without a connection of their own use it in every World that allows the integration; members with their own connection keep using theirs.
A new session cancels earlier pending attempts for this group and integration with connect_session_superseded. Members' own attempts are not affected.
Redirect query parameters (connectSessionId, status, and possible error) are hints. Read the session from your backend before relying on them.
Sessions expire after 30 minutes by default. Use the returned expiresAt. With requireConfirmation, the session waits at awaiting_confirmation before credentials become active.