POST
/
posts
/
edit
/
{post_id}
Edit a post
curl --request POST \
  --url https://localhost:5000/posts/edit/{post_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "caption": "<string>",
  "image": [
    "<string>"
  ],
  "imagePublicId": [
    "<string>"
  ]
}
'
{
  "success": true,
  "message": "Post updated successfully",
  "data": {
    "_id": "<string>",
    "caption": "<string>",
    "image": "<string>",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

post_id
string
required

Post ID

Body

application/json
caption
string

Updated post caption

image
string[]

Array of new image URLs

imagePublicId
string[]

Array of new image public IDs

Response

Post updated successfully

success
boolean
Example:

true

message
string
Example:

"Post updated successfully"

data
object