---
title: "Update a draft"
method: PATCH
path: "/v1/drafts/{id}"
tags: ["Drafts"]
---

# Update a draft

`PATCH /v1/drafts/{id}`

## Request

- Base URL: `https://api.curviate.com`
- URL: `https://api.curviate.com/v1/drafts/{id}`
- Auth: HTTP bearer

Partial update: an omitted field is left as is, null clears it. attachments replaces the whole list ({id} keeps an existing file, a base64 object adds one, anything left out is deleted). account_id moves the Draft to another of your accounts. Editing a failed Draft clears its failure.

## Path parameters

- `id` string, required

## Request body

- object
  - `account_id` string, nullable: The account (acc_...) this Draft will publish as, or null for none yet. A Draft belongs to at most one account.
  - `scheduled_at` string, nullable: When Curviate publishes this Draft: an ISO 8601 date-time with an offset, at least 5 minutes and at most 365 days ahead, stored in UTC truncated to the minute. Scheduling needs an account and text. Curviate publishes it up to 20 seconds after this time, and keeps scheduled posts on one account at least 5 minutes apart. null unschedules.
  - `text` string, nullable: Post body text, up to 3000 characters. May be empty while drafting; publishing needs at least one character.
  - `quoted_post_id` string, nullable: A post to quote or repost when published, the same as on create post. Checked at publish time.
  - `can_read` 'anyone' | 'relations_only', nullable: Who can read the post once published.
  - `can_comment` 'anyone' | 'relations_only' | 'no_one', nullable: Who may comment once published.
  - `post_as` string, nullable: Company page id to post as; the account must administer it. Checked at publish time.
  - `attachments` union[]: Replaces the whole list. Each item is {id} to keep an existing attachment, or a new base64 object. Attachments left out are deleted.
    - union
      - object
        - `id` string, required: An attachment already on this Draft (att_...), kept as is.
      - object
        - `content` string, required: Base64-encoded file bytes.
        - `content_type` string, required: The file's type: image/jpeg, image/png, image/gif, image/webp, video/mp4 or application/pdf.
        - `filename` string, required: File name.

## Response `200`

The updated Draft. scheduled_at schedules, reschedules or (null) unschedules; changing it or the account cancels a pending publish and its retries. Unscheduling alone needs no active seat. With scheduled_at, the response carries safety_warning (reason activity_window) when the time is outside the account's activity window and its posture is warn; under enforce the request is refused instead (429 BUDGET_EXHAUSTED, reason activity_window) and nothing is saved.

- object
  - `object` 'draft', required: Response type discriminator.
  - `id` string, required: Draft id (drf_...).
  - `account_id` string, nullable, required: The account this Draft will publish as, or null for none yet.
  - `status` 'draft' | 'scheduled' | 'failed', required: Derived: failed if failure is set, else scheduled if scheduled_at is set, else draft.
  - `text` string, nullable, required: Post body text. May be empty or null while drafting.
  - `attachments` object[], required: Media, in post order.
    - `id` string, required: Attachment id (att_...). Send {id} in a PATCH attachments list to keep it.
    - `content_type` string, required: The file's type.
    - `filename` string, required: File name.
    - `size_bytes` integer, required: Stored size in bytes.
    - `url` string, nullable, required: Signed download link to the stored file, valid for 1 hour. Read the Draft again for a fresh one. Null when the stored file is unavailable.
  - `quoted_post_id` string, nullable: A post to quote or repost when published.
  - `can_read` 'anyone' | 'relations_only' | 'null', nullable: Who can read the post once published.
  - `can_comment` 'anyone' | 'relations_only' | 'no_one' | 'null', nullable: Who may comment once published.
  - `post_as` string, nullable: Company page id to post as.
  - `scheduled_at` string, nullable, required: When Curviate publishes the Draft (UTC, whole minute), or null. It goes out up to 20 seconds after this time. A failed Draft has null here; the time that failed is failure.scheduled_at.
  - `failure` object, nullable, required: Why the last scheduled publish failed; present on failed Drafts only.
    - `code` 'platform_error' | 'rate_limited' | 'account_unavailable' | 'media_rejected' | 'budget_exhausted' | 'outside_activity_window' | 'no_active_seat' | 'not_publishable' | 'platform_rejected' | 'missed' | 'outcome_unknown': Why it failed. outcome_unknown: the platform gave no usable answer, so the post may be live; check the account's posts before you publish again. missed: Curviate could not start within an hour of the time. platform_error and rate_limited: 3 attempts over about 15 minutes all failed.
    - `message` string: What went wrong and what to do next. Never contains post text.
    - `failed_at` string: When it failed.
    - `scheduled_at` string: The time that failed to publish.
  - `created_at` string, required: Creation time.
  - `updated_at` string, required: Last change.
  - `safety_warning` SafetyWarning: Present on a successful response when this account crossed an account-safety ceiling while the affected budget row is on the default warn posture. The action still happened. Field-identical to the BUDGET_EXHAUSTED error body except that blocked is false and hint.message describes the outcome, so one branch handles both postures and switching the account to enforce is a configuration change rather than a client rewrite.
    - `row` string, nullable, required: The budget row that breached, for example profile_views or pending_invites. Null when the breach is not about a row: an activity_window warning on an action that spends no budget of its own (editing a message, dismissing a notification, a Recruiter or Sales Navigator admin action) is still governed by the hours the account works in. Read hint.parameter for what to change; whenever this is null it names posture, because the activity window edges are set per action type and this action has none, so the levers that reach it are the account timezone and posture.
    - `reset_at` string, nullable, required: The instant the refusal lifts: the window roll on a ceiling refusal, the next window open on an activity-window one. Null in the two cases no clock frees, the pending_invites gauge and InMail credits (row inmail).
    - `hint` object, required
      - `parameter` string, required: The settable parameter on PATCH /v1/{account_id}/safety-policy.
      - `message` string, required: What the condition is and what changing that parameter would do. This is the one field whose text differs from the BUDGET_EXHAUSTED refusal: here it says the action went through, and on a ceiling breach how far past the ceiling this row now stands, rather than telling you to set posture to warn when it already is. Branch on parameter, reason and blocked, never on this text.
    - `reason` 'ceiling' | 'activity_window', required: Which rule was crossed. ceiling means the row's configured limit is spent; activity_window means the account is outside the hours it works in, which is a different fact with a different remedy. hint.parameter names the right setting for each.
    - `blocked` boolean, required: Always false here. True on the BUDGET_EXHAUSTED refusal carrying the same payload.

## Other responses

- `400`: Invalid input. Media rules: up to 20 images (JPEG, PNG, GIF, WEBP, at most 6012 x 6012 px), or one MP4 video, or one PDF, never mixed. Also: an attachment id that is not on this Draft. scheduled_at must be an ISO 8601 date-time with an offset, 5 minutes to 365 days ahead after truncation to the minute.
- `401`: Missing or invalid API key.
- `403`: Forbidden. NO_ACTIVE_SEAT: the account is not attached to an active seat.
- `404`: No such Draft (RESOURCE_NOT_FOUND), or the account_id is not one of yours (ACCOUNT_NOT_FOUND).
- `409`: DRAFT_PUBLISHING: a publish of this Draft is in flight. Read it again in a few seconds. Or the target account is disconnected (REAUTH_REQUIRED).
- `413`: A file is over its size limit: 5 MiB per image, and 5 MiB per file sent inline.
- `422`: DRAFT_LIMIT_REACHED: the bucket (one account, or Drafts with no account) already holds 50 Drafts. MEDIA_QUOTA_EXCEEDED: the media would take the bucket past its 2 GiB quota; nothing is stored. ACCOUNT_REQUIRED: a scheduled Draft cannot drop its account; unschedule it first. ACCOUNT_REQUIRED / DRAFT_NOT_PUBLISHABLE: scheduling needs an account and text. SCHEDULE_CONFLICT: another scheduled Draft on the account is less than 5 minutes away; the message names it.
- `429`: BUDGET_EXHAUSTED with reason activity_window: the scheduled time is outside the account's activity window and the account enforces it. Nothing is saved.

---

[API](https://skmtc.dev/curviate/apis/curviate-api.md) · [All operations](https://skmtc.dev/curviate/apis/curviate-api/llms.txt) · [OpenAPI document](https://skmtc.dev/curviate/apis/curviate-api/revisions/eab848801d95?raw)
