API Reference / Posts
Edit a draft
PostPiper API: update an existing draft's text, image attachments, or Pinterest fields. Only unpublished drafts can be edited with PATCH.
PATCH
https://api.postpiper.ai/v1/posts/{postId}Only drafts can be edited. Omitted fields keep their values. Supplying asset_ids replaces attached assets in order; an empty array detaches them all. The draft must still contain text or media after editing.
You cannot change the platform or account with this endpoint.
Path and query parameters
| Name | Type | Description |
|---|---|---|
| postId | UUID, required | ID of an owned draft. |
Request body
| Name | Type | Description |
|---|---|---|
| platform_fields | object, optional | Replacement Pinterest fields. Supplied keys replace previous values; omitted keys are kept. |
| content | string, optional | Replacement text, up to 25,000 characters. |
| media_urls | string[], optional | Replacement HTTPS image URLs; cannot be sent with asset_ids. |
| asset_ids | UUID[], optional | Replacement owned X image assets; cannot be sent with media_urls. |
Example request
Terminal
curl -X PATCH "https://api.postpiper.ai/v1/posts/<post-uuid>" \
-H "Authorization: Bearer $POSTPIPER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"Updated post text"}'Response
200 OK. Returns the updated draft.
JSON
{
"post": {
"id": "<post-uuid>",
"content": "Updated post text",
"media_urls": [],
"asset_ids": [],
"platform": "x",
"status": "draft",
"account_id": "<account-uuid>",
"created_at": "2030-10-12T01:00:00.000Z"
}
}Errors
400INVALID_CONTENT or MEDIA_FORMAT_CONFLICT.401Missing or invalid API key.403API key lacks the required scope.404POST_NOT_FOUND or MEDIA_NOT_FOUND.409POST_NOT_DRAFT.