API Docs/Reference/Update Draft
API Reference

Update Draft

Update an existing draft. content is required unless you are only trashing the draft. Requires a paid Creator or Lifetime plan.

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

PATCH /v1/posts/{id} updates an existing draft. It is a partial update in intent — send only the fields you want to change — and the same media rules as create apply: post_type plus media_url or media_urls, with media_mime_type where the type is not obvious from the URL.

The route first fetches the draft to confirm it exists and belongs to the key's account, so a bad id fails cleanly as a 404 instead of creating something or writing to the wrong record.

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 PATCH "https://api.linkedmash.com/v1/posts/drf_8f3a21c9" \
  -H "Authorization: Bearer $LINKEDMASH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "5 lessons from shipping every week for a year (rewritten hook):",
    "format": "text"
  }'

Header parameters

AuthorizationstringRequired

Your secret API key as a Bearer token.

Body parameters

contentstringRequired

The post body text. Required unless only trashing the draft.

titlestringOptional

An optional title for the draft.

formatstringOptional

Post format: text, image, video, article, or poll.

post_typestringOptional

Media type to attach: text, image, video, or pdf. Set this when attaching media.

media_urlstringOptional

Public URL of an image, video, or PDF to attach.

media_urlsarrayOptional

Multiple public media URLs to attach.

media_mime_typestringOptional

MIME type of the attached media (e.g., 'image/png').

Response

{
  "status": true,
  "data": {
    "id": "drf_8f3a21c9",
    "content": "5 lessons from shipping every week for a year (updated):",
    "title": "Weekly shipping lessons",
    "format": "text",
    "status": "draft",
    "created_at": "2026-06-22T09:14:02.118Z",
    "updated_at": "2026-06-22T10:02:51.640Z"
  }
}

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

Draft identifier. Pass it to GET, PATCH and DELETE /v1/posts/{id} and to the schedule route.

data.contentstring | object

The post body. Drafts written in the Studio editor can store this as an object with a text field rather than a bare string — handle both.

data.titlestring

Internal working title. It is never published to LinkedIn; it exists so drafts are findable.

data.formatstring

Composition format, e.g. text or carousel.

data.statusstring

One of draft, scheduled or published.

data.created_atstring

ISO-8601 creation timestamp.

data.updated_atstring

ISO-8601 timestamp of the last edit.

Editing a post that is already queued

Text and timing are separate concerns here, and confusing them is the usual source of surprise.

1

Read first

GET /v1/posts/{id} to get the current content, so your edit is applied to what is actually stored rather than to what you last cached.

2

Patch the text

Send only the fields you are changing. The route pre-fetches the draft to confirm it exists, so a wrong id fails as a clean 404 without partially writing.

3

The schedule is untouched

Editing a scheduled draft leaves its queue entry exactly where it was. The revised text will publish at the original time.

4

Move the time separately

To change when it goes out, call POST /v1/queue/{scheduleId}/reschedule with the scheduleId from GET /v1/queue — not the draft id you just patched.

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.

The existence check runs first

An unknown or foreign id returns 404 before any write is attempted, so a failed update never partially applies.

Editing a scheduled post does not reschedule it

Changing content on a draft that already has a schedule entry leaves the schedule untouched. Use POST /v1/queue/{scheduleId}/reschedule to move the time.

Media replaces rather than appends

Sending media_urls overwrites the stored array. To keep an existing attachment and add another, read the draft first and send the full list.

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
400Bad Request
The draft store rejected the payload — most often an empty content field.
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 update post". Retry once; if it persists the request is not the problem.