POST /users Bearer

Create 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

Request Body

Body Parameters

name required
string

Full name of the user

email required
string

Email address of the user. Must be a valid email format.

username
string

Unique username for the user. If not provided, will be auto-generated.

phone
string

Phone number of the user

website
string

Personal website URL

Response

Returns the created user object with the assigned ID.

id integer

The auto-generated unique identifier for the new user

name string

The name provided in the request

email string

The email address provided in the request

Error Responses

StatusDescription
400Invalid request body - missing required fields
401Unauthorized - missing or invalid authentication
409Conflict - user with this email already exists
Terminal window
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",
"email": "[email protected]",
"username": "johndoe",
"phone": "555-1234"
}
)
print(response.json())
{
"id": 11,
"name": "John Doe",
"email": "[email protected]",
"username": "johndoe",
"phone": "555-1234"
}
{
"error": "Missing required field: email"
}
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