Skip to main content

Create Post

Create a new post by sending a POST request with the required fields.

POST https://jsonplaceholder.typicode.com/posts

Request Body Fields

NameTypeRequiredDescription
titlestringYesTitle of the post
bodystringYesContent of the post
userIdnumberYesID of the user

Example Requests

curl -X POST https://jsonplaceholder.typicode.com/posts \
-H "Content-Type: application/json" \
-d '{
"title": "foo",
"body": "bar",
"userId": 1
}'

Successful Response

{
"title": "foo",
"body": "bar",
"userId": 1,
"id": 101
}

Error Responses

Status CodeDescription
400Invalid request body
500Internal server