The auto-generated unique identifier for the new user
POST
/users BearerCreate User
Create a new user account with email, password, and optional profile details via authenticated POST request
Overview
Creates a new user account with the provided information. Returns the created user object with a generated ID.
Authorization
Warning
This endpoint requires authentication. Include a valid Bearer token in the Authorization header.
Request Body
Body Parameters
name requiredFull name of the user
email requiredEmail address of the user. Must be a valid email format.
usernameUnique username for the user. If not provided, will be auto-generated.
phonePhone number of the user
websitePersonal website URL
Response
Returns the created user object with the assigned ID.
id integername stringThe name provided in the request
email stringThe email address provided in the request
Error Responses
| Status | Description |
|---|---|
400 | Invalid request body - missing required fields |
401 | Unauthorized - missing or invalid authentication |
409 | Conflict - user with this email already exists |
curl -X POST "https://jsonplaceholder.typicode.com/users" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <token>" \ -d '{ "name": "John Doe", "email": "[email protected]", "username": "johndoe", "phone": "555-1234" }'const response = await fetch("https://jsonplaceholder.typicode.com/users", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer <token>" }, body: JSON.stringify({ name: "John Doe", username: "johndoe", phone: "555-1234" })});
const data = await response.json();console.log(data);import requests
response = requests.post( "https://jsonplaceholder.typicode.com/users", headers={"Authorization": "Bearer <token>"}, json={ "name": "John Doe", "username": "johndoe", "phone": "555-1234" })print(response.json()){ "id": 11, "name": "John Doe", "username": "johndoe", "phone": "555-1234"}{ "error": "Missing required field: email"}Was this page helpful?
Request
curl -X POST "https://jsonplaceholder.typicode.com/users" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>"const response = await fetch("https://jsonplaceholder.typicode.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
});
const data = await response.json();
console.log(data);import requests
response = requests.post(
"https://jsonplaceholder.typicode.com/users",
headers={'Content-Type':'application/json','Authorization':'Bearer <token>'},
)
print(response.json())package main
import (
"fmt"
"net/http"
"io"
)
func main() {
req, _ := http.NewRequest("POST", "https://jsonplaceholder.typicode.com/users", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer <token>")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}Response
Send a request to see the response
Authorization
Headers
Body
Response