Accounts
List connected accounts
Filter with reconnectBefore to find the accounts a person must reconnect soon.
GET
/v1/accountsTL;DR
| Question | Answer |
|---|---|
| What does it do? | List connected accounts. |
| 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? | status, platform, reconnectBefore in the query string. |
| What does it return? | Status 200 with a body of type AccountList. |
| In the SDK? | flung.accounts.list() |
| As an MCP tool? | find_accounts_needing_attention, list_accounts |
| What can go wrong? | 401 Missing, unknown, revoked or expired API key; 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/accounts?reconnectBefore=2026-11-30T00%3A00%3A00Z' \ --header "Authorization: Bearer $FLUNG_API_KEY"ts
import { Flung } from '@flung.dev/sdk'
const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })const result = await flung.accounts.list({ reconnectBefore: '2026-11-30T00:00:00Z',})js
const response = await fetch('https://api.flung.dev/v1/accounts?reconnectBefore=2026-11-30T00%3A00%3A00Z', { method: 'GET', headers: { 'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`, },})if (!response.ok) throw new Error((await response.json()).error.message)const result = await response.json()A successful answer looks like this:
json
{ "data": [ { "id": "acct_aaaaaaaaaaaaaaaaaaaaaaaa", "platform": "x", "platformUserId": "string", "username": "string", "profileId": "string", "status": "active", "renewal": "automatic", "tokenExpiresAt": "2026-11-01T09:00:00.000Z", "reconnectBy": "2026-11-01T09:00:00.000Z", "defaultBoard": {}, "inbox": {}, "createdAt": "2026-11-01T09:00:00.000Z", "updatedAt": "2026-11-01T09:00:00.000Z" } ]}Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
status | "active" | "needs_reconnect" | "disconnected" | no | |
platform | Platform | no | |
reconnectBefore | string | no | Only accounts that need a reconnect before this time: already needs_reconnect, or reconnectBy earlier. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Every account connected to the workspace, newest first. | AccountList |
| 401 | Missing, unknown, revoked or expired API key. | Error |
| 422 | The request failed validation. | Error |
| 429 | Too many requests for this credential; wait for retry-after seconds. | Error |
Response body
A 200 answer has the type AccountList.
| Field | Type | Required | Description |
|---|---|---|---|
data | Account[] | yes | |
data[].id | string | yes | |
data[].platform | Platform | yes | |
data[].platformUserId | string | yes | |
data[].username | string | null | yes | |
data[].profileId | string | null | yes | |
data[].status | "active" | "needs_reconnect" | "disconnected" | yes | needs_reconnect: the platform refused the token; start a reconnect. |
data[].renewal | "automatic" | "manual" | "not_needed" | yes | automatic: Flung refreshes the token before it expires, until reconnectBy if set. manual: only a reconnect renews it, by reconnectBy. not_needed: the token does not expire. |
data[].tokenExpiresAt | string | null | yes | When the current access token expires. Flung renews automatic ones about a day before. |
data[].reconnectBy | string | null | yes | The last moment the account works without a reconnect; null when it renews indefinitely. Flung sends account.reconnect_required_soon a week before. |
data[].defaultBoard | object | null | yes | Pinterest only: where pins go unless a post picks another board. |
data[].defaultBoard.id | string | yes | |
data[].defaultBoard.name | string | null | yes | |
data[].inbox | object | yes | Reading comments and mentions into GET /v1/inbox. |
data[].inbox.enabled | boolean | null | yes | Whether comments and mentions are read. null is the platform's default: on, except X, where reading costs money. |
data[].inbox.readAt | string | null | yes | |
data[].inbox.error | string | null | yes | Why the last read failed, such as a missing permission. |
data[].createdAt | string | yes | |
data[].updatedAt | string | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint |
| Schemas | Every request and response type |
| Errors | Every error code and what to do about it |
find_accounts_needing_attention | The same operation as an MCP tool |
list_accounts | The same operation as an MCP tool |