API reference / People writes
Cancel a queued write
Written and maintained by The ProspectAPIs team
DELETE/v1/writes/queued/:id
DELETE /v1/writes/queued/:id is the ProspectAPIs operation cancelQueuedWrite, in the People writes group of the REST API. Cancel a write that is still queued, so it is never sent. Free. Cost: free; cancel a queued write. 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 |
|---|---|---|---|
| id required | path | string | The queued_id from the 202 answer or the list. |
Responses
| Status | Meaning |
|---|---|
| 200 | Cancelled. |
| 401 | The API key is missing or invalid. |
| 404 | No queued write with this id on your account. |
| 409 | Already sent, expired or cancelled. |
| 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
Cancelled. The body is a QueuedWrite.
| Field | Type | Description |
|---|---|---|
| queued_id required | string (uuid) | |
| op required | string | The write, e.g. message or invite. |
| route required | string | The write route, e.g. POST /v1/people/invite. |
| status required | string: queued, sending, sent, failed, expired, cancelled | |
| reason required | string: session_logged_out, account_not_connected, account_reconnect_required | Why it was held. |
| created_at required | string (date-time) | |
| expires_at required | string (date-time) | |
| finished_at required | string (date-time) or null | |
| 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. |
| outcome.code | string | |
| outcome.status | integer or null |
| 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 -X DELETE https://api.prospectapis.com/v1/writes/queued/id \
-H "Authorization: Bearer $PROSPECTAPIS_KEY"const res = await fetch("https://api.prospectapis.com/v1/writes/queued/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);import os, requests
res = requests.delete(
"https://api.prospectapis.com/v1/writes/queued/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: cancel a queued write. 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: List queued writes. Next operation: List connected accounts. 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?