Skip to main content

Create Post

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

Endpoint

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

Request Body Fields

NameTypeRequiredDescription
titlestringTitle of the post
bodystringContent of the post
userIdnumberID 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