API reference / People writes
Delete your post
Written and maintained by The ProspectAPIs team
POST/v1/posts/delete
POST /v1/posts/delete is the ProspectAPIs operation deletePost, in the People writes group of the REST API. Delete one of your own posts. $0.02 per action. Give share_id or a post_url that names the post. Acts on your own connected account (connect one first with POST /v1/accounts/session). Billed per call once the write product is live; while it is not yet on sale the call is free (GET /pricing reports people_writes.available). While GET /pricing does not list this route in people_writes.available_routes it answers 503 temporarily_unavailable and nothing is charged. Cost: Not available yet. 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 |
|---|---|---|---|
| Idempotency-Key | header | string | Optional, 1 to 255 printable ASCII characters. A retry with the same key and body within 24 hours gets the first answer back with Idempotent-Replayed: true and is never charged again. The same key with a different body is 422; a retry while the first call is still running is 409. |
Request body
JSON. Give one of post_id, share_id or post_url.
| Field | Type | Description |
|---|---|---|
| post_id | string | The post id. At most 4000 characters. |
| share_id | string | The share id. At most 4000 characters. |
| post_url | string | The public post URL. At most 2000 characters. |
{}Responses
| Status | Meaning |
|---|---|
| 200 | Done. Our neutral confirmation. |
| 202 | Your connected account is signed out or needs a reconnect: the write is queued and sent, through the same pacing, once the account is connected again. Charged only when sent. See GET /v1/writes/queued. |
| 400 | The request was invalid (e.g. a bad filter or input); nothing was charged. |
| 401 | The API key is missing or invalid. |
| 402 | Out of credits. The body carries top_up_url; nothing was charged. |
| 403 | The connected account cannot take this action on that target (it is not its own), or needs attention. |
| 404 | No such record for this account. |
| 409 | No account is connected. Connect one with POST /v1/accounts/session, then retry. |
| 422 | The connected account is signed out. Connect it again, then retry. |
| 429 | Too many requests; retry after the window. |
| 503 | This action is temporarily unavailable. Nothing was changed. |
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. A per-key 429 carries Retry-After; see rate limits.
200 response fields
Done. Our neutral confirmation. The body is a PeopleWriteResult.
| Field | Type | Description |
|---|---|---|
| data required | object | Our neutral confirmation of the action taken. |
| 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 POST https://api.prospectapis.com/v1/posts/delete \
-H "Authorization: Bearer $PROSPECTAPIS_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://api.prospectapis.com/v1/posts/delete", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PROSPECTAPIS_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({}),
});
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.post(
"https://api.prospectapis.com/v1/posts/delete",
headers={"Authorization": f"Bearer {os.environ['PROSPECTAPIS_KEY']}"},
json={},
timeout=30,
)
res.raise_for_status()
data = res.json()
print(data)Billing
Billing reserves before it serves: the call holds what it may cost, serves at most what that hold covers, and refunds the rest when the response closes. Any non-2xx answer refunds the whole hold, so a failed call costs nothing. The response reports your balance in X-Credits-Remaining.
Related
Previous operation: Edit your post. Next operation: Delete your comment. 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?