API reference / Connected account
List connected accounts
Written and maintained by The ProspectAPIs team
GET/v1/accounts
GET /v1/accounts is the ProspectAPIs operation listConnectedAccounts, in the Connected account group of the REST API. Every account connected to this API key, oldest first, up to 50, each with its account_id. Never returns a session. Free. Cost: free; every account connected to this key, up to 50, each with its account_id. Send your API key as a Bearer token in the Authorization header.
How this fits with the rest of the connected account API, with worked examples, is in the connected accounts guide.
Parameters
This operation takes no path or query parameters.
Responses
| Status | Meaning |
|---|---|
| 200 | The accounts. |
| 401 | The API key is missing or invalid. |
| 503 | Temporarily unavailable. Try again shortly. |
Every error answers with the same JSON body, an error string and sometimes a code; the errors page lists each status and when it happens.
200 response fields
The accounts. The body is a ConnectedAccountList.
| Field | Type | Description |
|---|---|---|
| data required | array of ConnectedAccount | What is connected. Never includes the session itself. |
| data[].connected required | boolean | true when an account is connected. |
| data[].status | string: active, dead, connecting | active; connecting while a sign-in waits for a code or a check; or dead when the session has signed out and needs connecting again. Absent when nothing is connected. |
| data[].account | object | The connected account as the platform names it. |
| data[].egress | string: dedicated, shared_fallback, customer_proxy, none | How the account reaches the platform. Every connected account acts through its own dedicated IP unless you bring your own proxy: dedicated (an IP leased to this account alone), shared_fallback (a shared IP, used only while every dedicated IP is taken), customer_proxy (your own proxy_url) or none. |
| data[].created_at | string (date-time) or null | |
| data[].updated_at | string (date-time) or null | |
| data[].last_used_at | string (date-time) or null | When an action last ran on it. |
| data[].account_id | string or null | This account's id. Name it with account_id on any route that acts on a connected account; optional while the key has exactly one. |
| count required | integer | |
| limit required | integer | The most accounts one key may hold (50). |
| Header | Meaning |
|---|---|
| RateLimit-Limit | Requests this API key may make per minute. |
| RateLimit-Remaining | Requests left in the current one-minute window. |
| RateLimit-Reset | Seconds until the current window resets. |
Code samples
Each sample sends the same request. Set PROSPECTAPIS_KEY in your environment first. Values come from the spec's examples; replace them with your own.
curl https://api.prospectapis.com/v1/accounts \
-H "Authorization: Bearer $PROSPECTAPIS_KEY"const res = await fetch("https://api.prospectapis.com/v1/accounts", {
headers: { Authorization: `Bearer ${process.env.PROSPECTAPIS_KEY}` },
});
if (!res.ok) throw new Error(`${res.status}: ${(await res.json().catch(() => ({}))).error ?? res.statusText}`);
const data = await res.json();
console.log(data);import os, requests
res = requests.get(
"https://api.prospectapis.com/v1/accounts",
headers={"Authorization": f"Bearer {os.environ['PROSPECTAPIS_KEY']}"},
timeout=30,
)
res.raise_for_status()
data = res.json()
print(data)Billing
The call itself is free, and what it sets up is billed as it runs: every account connected to this key, up to 50, each with its account_id. Metered spend on the same key is reported after each response in X-Credits-Remaining, and GET /v1/account shows the balance at any time.
Related
The connected accounts guide covers this area end to end. Previous operation: Cancel a queued write. Next operation: Connect another account. Every operation, grouped by area, is on the API reference index.
Create a free account to get a key, then run the samples above with your own values.
Was this page helpful?