Skip to content
ProspectAPIs

API reference / Connected account

Remove a connected account

Written and maintained by The ProspectAPIs team

DELETE/v1/accounts/:account_id

DELETE /v1/accounts/:account_id is the ProspectAPIs operation removeConnectedAccount, in the Connected account group of the REST API. Remove one account: its stored session, its browser profile and its queued writes are deleted. The key's other accounts are untouched. Free. Cost: free; remove one account, its session and its queued writes. 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

Parameters of DELETE /v1/accounts/:account_id
NameInTypeDescription
account_id requiredpathstringThe account_id from GET /v1/accounts.

Responses

Response codes of DELETE /v1/accounts/:account_id
StatusMeaning
200Removed.
401The API key is missing or invalid.
404No account with that id on this key.
503Temporarily unavailable.

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

Removed.

Fields of the 200 response
FieldTypeDescription
deletedboolean
connectedboolean
Response headers
HeaderMeaning
RateLimit-LimitRequests this API key may make per minute.
RateLimit-RemainingRequests left in the current one-minute window.
RateLimit-ResetSeconds 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
curl -X DELETE https://api.prospectapis.com/v1/accounts/account id \
  -H "Authorization: Bearer $PROSPECTAPIS_KEY"
JavaScript (fetch)
const res = await fetch("https://api.prospectapis.com/v1/accounts/account id", {
  method: "DELETE",
  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);
Python (requests)
import os, requests

res = requests.delete(
    "https://api.prospectapis.com/v1/accounts/account id",
    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: remove one account, its session and its queued writes. 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.

The connected accounts guide covers this area end to end. Previous operation: Get one connected account. Next operation: Reconnect an 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 (this call acts for real, so use real inputs).

Was this page helpful?