API reference / People writes
List queued writes
Written and maintained by The ProspectAPIs team
GET/v1/writes/queued
GET /v1/writes/queued is the ProspectAPIs operation listQueuedWrites, in the People writes group of the REST API. Writes sent while your connected account was signed out answer 202 queued and wait here; each is sent, through the same pacing, once the account is connected again, and charged only then. At most 50 wait per account and each expires after 72 hours. Free. Cost: free; the writes waiting for your account to reconnect. Send your API key as a Bearer token in the Authorization header.
The quickstart shows this call in context, next to the first requests most integrations make.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| status | query | string: queued, sending, sent, failed, expired, cancelled | Only writes in this state. |
| limit | query | integer | How many to return, 1 to 100. |
An unknown query parameter is refused with a 400 rather than ignored, so a typo never widens a search you pay for.
Responses
| Status | Meaning |
|---|---|
| 200 | The queued writes, newest first. |
| 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 queued writes, newest first.
| Field | Type | Description |
|---|---|---|
| data | array of QueuedWrite | |
| data[].queued_id required | string (uuid) | |
| data[].op required | string | The write, e.g. message or invite. |
| data[].route required | string | The write route, e.g. POST /v1/people/invite. |
| data[].status required | string: queued, sending, sent, failed, expired, cancelled | |
| data[].reason required | string: session_logged_out, account_not_connected, account_reconnect_required | Why it was held. |
| data[].created_at required | string (date-time) | |
| data[].expires_at required | string (date-time) | |
| data[].finished_at required | string (date-time) or null | |
| data[].outcome required | object or null | Set once the write is finished. code is sent, expired, or why it was not sent: account_changed (a different account is connected now), account_disconnected (the account was disconnected), key_revoked, key_scope, key_cap_reached, insufficient_credits, duplicate, or a write error code. outcome_unknown means the send may have reached the platform but its answer was lost: it is never sent again, so check the account before sending it yourself. |
| 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/writes/queued \
-H "Authorization: Bearer $PROSPECTAPIS_KEY"const res = await fetch("https://api.prospectapis.com/v1/writes/queued", {
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/writes/queued",
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: the writes waiting for your account to reconnect. 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
Previous operation: Get one ad. Next operation: Cancel a queued write. 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?