Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/devxtra-community/hayon/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint requires a valid Bearer token. You can only update posts that belong to your account.

Endpoint

PUT /api/posts/:postId

Path parameters

postId
string
required
MongoDB ObjectId of the post to update.

Request body

The update body accepts the same shape as Create Post. All top-level fields are re-validated on each update.
content
object
required
Replacement post content.
selectedPlatforms
string[]
required
Replacement platform list. Accepted values: bluesky, threads, instagram, facebook, mastodon, tumblr.
platformSpecificContent
object
Per-platform content overrides.
scheduledAt
string
ISO 8601 datetime. When provided alongside a non-draft status, the post is set to SCHEDULED.
timezone
string
default:"UTC"
IANA timezone name.
status
string
Set to DRAFT to keep the post unpublished. Omit or provide a non-DRAFT value to queue the post.

Publishing a draft

When a post transitions from DRAFT to PENDING or SCHEDULED, the server:
  1. Updates createdAt to the current time so the post appears at the top of your history.
  2. Dispatches delivery jobs for each platform in selectedPlatforms.
To publish a previously saved draft, send the update body with status omitted (or set to PENDING) and provide the final content and selectedPlatforms.

Response

success
boolean
required
true on success.
message
string
required
"Post updated successfully"
data
object
required

Examples

curl --request PUT \
  --url 'https://api.hayon.app/api/posts/64f1a2b3c4d5e6f7a8b9c0d1' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "content": {
      "text": "Updated post text"
    },
    "selectedPlatforms": ["bluesky", "threads"]
  }'

Example response

200
{
  "success": true,
  "message": "Post updated successfully",
  "data": {
    "postId": "64f1a2b3c4d5e6f7a8b9c0d1",
    "status": "SCHEDULED",
    "scheduledAt": "2024-12-15T14:00:00.000Z"
  }
}