Confirm a connect session
Activate credentials held by a session created with requireConfirmation: true.
/api/v1/connect-sessions/:id/confirmconst response = await fetch("https://api.smallworld.sh/api/v1/connect-sessions/01995e58-1000-7000-8000-009ea3dcd8fc/confirm", {
method: "POST",
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
body: JSON.stringify({
"userId": "customer_123"
}),
});
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#
idUUIDrequiredThe connect-session ID returned when the session was created.
Request body#
userIdstringFor a user's session: the user authenticated in your application after the browser returns. Must match the user used to create the session. Send userId or groupId, not both.
groupIdstringFor a group's session: the group the signed-in person connected the account for, after your backend checked their authority over it. Must match the session's group.
Responses#
Held credentials were activated for the authenticated user. Other session states return errors.
{
"id": "01995e58-1000-7000-8000-009ea3dcd8fc",
"integration": "github",
"userId": "customer_123",
"groupId": null,
"status": "completed",
"requireConfirmation": true,
"redirectUrl": "https://app.example.com/settings/integrations",
"error": null,
"connection": {
"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
},
"expiresAt": "2026-10-10T12:30:00.000Z",
"createdAt": "2026-10-10T12:00:00.000Z",
"updatedAt": "2026-10-10T12:00:01.000Z",
"completedAt": "2026-10-10T12:00:01.000Z"
}
More about this endpoint
Only confirm a session whose status is awaiting_confirmation. Derive userId from your server-side login session.
For a group's session, send groupId once your backend has checked that the signed-in person may connect accounts for that group. The completed connection is the group's.
A different user or group, or a userId for a group's session, fails the connection attempt and discards the held credentials. Repeated confirmation of a completed session returns a conflict.