Get a connect session
Read the authoritative state of a user's or a group's hosted connection attempt.
/api/v1/connect-sessions/:idconst response = await fetch("https://api.smallworld.sh/api/v1/connect-sessions/01995e58-1000-7000-8000-009ea3dcd8fc", {
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#
idUUIDrequiredThe connect-session ID returned when the session was created.
Responses#
The user has not completed the hosted flow, or credential exchange is still in progress.
{
"id": "01995e58-1000-7000-8000-009ea3dcd8fc",
"integration": "github",
"userId": "customer_123",
"groupId": null,
"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
}
More about this endpoint
This endpoint does not return connectUrl again. Poll after the hosted flow or read it when the user returns to your application.
Expired sessions are returned with status expired. Failed sessions include an error object with code and message; a failed flow can still return HTTP 200 here.
A cancelled session's error code is connect_session_superseded when a newer connect session, or credentials saved through the API, replaced it before it finished, and connect_session_cancelled when the integration was disconnected.