API Docs/Reference/Delete Draft
API Reference

Delete Draft

Delete a post draft by its id. Requires a paid Creator or Lifetime plan.

DELETEhttps://api.linkedmash.com/v1/posts/{id}

DELETE /v1/posts/{id} removes a draft. The delete is soft: the draft is moved to trash rather than erased, which is why the response is a plain { id, deleted: true } rather than the deleted record.

As with update, the draft is fetched first to confirm it exists and belongs to the account, so deleting an unknown id is a clean 404.

Example request

Authenticate with a bearer token in the Authorization header. Create a key on the API page in your LinkedMash settings and export it as LINKEDMASH_API_KEY before running this.

curl
curl -X DELETE "https://api.linkedmash.com/v1/posts/drf_8f3a21c9" \
  -H "Authorization: Bearer $LINKEDMASH_API_KEY"

Path parameters

idstringRequired

The id of the draft to delete.

Header parameters

AuthorizationstringRequired

Your secret API key as a Bearer token.

Response

{
  "status": true,
  "data": {
    "id": "drf_8f3a21c9",
    "deleted": true
  }
}

Response fields

Every response is wrapped in the same envelope: a status flag and a data payload, with meta present where there is pagination or a plan limit to report.

statusboolean

true on success. Every LinkedMash API response carries this envelope flag alongside data, so a client can branch on it without re-reading the HTTP status.

data.idstring

The draft id that was trashed, echoed back.

data.deletedboolean

true on success. The delete is soft: the draft is flagged as trashed and can still be restored in the Studio, which is why the deleted record itself is not returned.

Discarding a draft safely

Order matters when the draft is queued: trashing it does not stop the publish.

1

Check for a schedule

GET /v1/posts/{id} and look at status, or search GET /v1/queue for an entry pointing at this draft. A status of scheduled means there is a queue entry to deal with.

2

Cancel the queue entry first

DELETE /v1/queue/{scheduleId} removes the scheduled publish. This is the step that actually prevents the post going out.

3

Then trash the draft

DELETE /v1/posts/{id} flags it as trashed. It disappears from GET /v1/posts and stays recoverable from the Studio.

4

Treat a repeat 404 as already-done

The second delete of the same id returns 404 because the draft is no longer in the active set. That makes the call retry-safe as long as your client does not surface 404 as a failure.

Behaviour and limits

Requires a Creator or Lifetime plan

Everything under /v1/posts, /v1/queue, /v1/schedule, /v1/media and /v1/analytics sits behind one middleware that checks for an unlocked Studio, so a Reader-plan or free key gets 402 with code SUBSCRIPTION_REQUIRED before the handler runs. Bookmark and label reads are on a separate router and are not affected by this gate.

Soft delete, so it is recoverable in the app

The draft is flagged as trashed, not destroyed. It stops appearing in GET /v1/posts, and it can still be restored from the Studio.

Deleting does not cancel a schedule

If the draft has a queue entry, cancel it with DELETE /v1/queue/{scheduleId} first. Trashing the draft alone is not the way to stop a scheduled publish.

Repeat deletes 404

The second delete of the same id finds nothing in the active set and answers 404, which makes the call safe to retry only if you treat 404 as already-done.

Errors

Failures carry the same envelope as a success, with the reason in message and a stable machine-readable code where the status alone is ambiguous — several distinct conditions share a 402.

Status
Meaning
401Unauthorized
The Authorization header is missing or the key is not a valid LinkedMash API key. Create or rotate keys on the API page in your LinkedMash settings.
402Payment Required
Returned with code SUBSCRIPTION_REQUIRED. The content API requires a Creator or Lifetime plan; Reader and free accounts get this on every /v1/posts, /v1/queue, /v1/schedule, /v1/media and /v1/analytics call.
404Not Found
No draft with that id on this account.
500Server Error
Something failed on our side. The body carries message "Failed to delete post". Retry once; if it persists the request is not the problem.