Skip to content
Connect an agent

Accounts

Get a connect session

Poll this after sending the person to authorizationUrl until status is no longer pending.

GET/v1/connect-sessions/{id}

TL;DR

QuestionAnswer
What does it do?Get a connect session.
What does it need?An API key, an OAuth access token, or a connect token (this is one of the calls a connect token may make).
What does it take?id in the path.
What does it return?Status 200 with a body of type ConnectSession.
In the SDK?flung.connectSessions.get()
As an MCP tool?get_connect_session
What can go wrong?401 Missing, unknown, revoked or expired API key; 404 No such session in this workspace, or it ended more than a week ago; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

Example

bash
curl -X GET 'https://api.flung.dev/v1/connect-sessions/cs_aaaaaaaaaaaaaaaaaaaaaaaa' \  --header "Authorization: Bearer $FLUNG_API_KEY"

A successful answer looks like this:

json
{  "id": "cs_aaaaaaaaaaaaaaaaaaaaaaaa",  "platform": "x",  "accountId": "string",  "status": "pending",  "authorizationUrl": "https://example.com",  "expiresAt": "2026-11-01T09:00:00.000Z",  "accountIds": [    "string"  ],  "error": {    "code": "string",    "message": "string"  },  "createdAt": "2026-11-01T09:00:00.000Z",  "completedAt": "2026-11-01T09:00:00.000Z"}

Path parameters

FieldTypeRequiredDescription
idstringyes

Responses

StatusMeaningBody
200The session.ConnectSession
401Missing, unknown, revoked or expired API key.Error
404No such session in this workspace, or it ended more than a week ago.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 200 answer has the type ConnectSession.

FieldTypeRequiredDescription
idstringyes
platformPlatformyes
accountIdstring | nullyesThe account being reconnected; null for a new connection.
status"pending" | "connected" | "failed" | "expired"yespending until the person finishes on the platform; expired when they did not by expiresAt.
authorizationUrlstring | nullyesSend the person here: the platform's own consent page. Null once the session has ended.
expiresAtstringyesThe person must finish by then.
accountIdsstring[]yesThe accounts stored, once connected. Facebook connects one per page.
errorobject | nullyesWhy it failed: access_denied, wrong_account, platform_error and so on.
error.codestringyes
error.messagestringyes
createdAtstringyes
completedAtstring | nullyes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it
get_connect_sessionThe same operation as an MCP tool