POST
/
posts
/
create
Create a new post
curl --request POST \
  --url https://localhost:5000/posts/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "image": "<string>",
  "image_public_id": "<string>",
  "caption": "<string>"
}
'
{
  "success": true,
  "message": "Post created successfully",
  "post": {
    "image": "<string>",
    "image_public_id": "<string>",
    "author": "<string>",
    "_id": "<string>",
    "caption": "<string>",
    "likes": [
      "<string>"
    ],
    "createdAt": "2023-11-07T05:31:56Z",
    "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.

Body

application/json
image
string
required

JSON stringified array of image URLs

image_public_id
string
required

JSON stringified array of image public IDs

caption
string

Post caption

Response

Post created successfully

success
boolean
Example:

true

message
string
Example:

"Post created successfully"

post
object