Skip to content

Errors

PhantomJSON returns consistent error responses across all endpoints.

{
"statusCode": 404,
"error": "Not Found",
"message": "User with id 999 was not found",
"path": "/v1/users/999",
"timestamp": "2026-01-15T10:30:00.000Z"
}
Field Description
statusCode HTTP status code
error Error category name
message Human-readable error description
path Request path that caused the error
timestamp ISO 8601 timestamp of when the error occurred
Code Meaning When
200 OK Successful request
201 Created Resource created successfully
400 Bad Request Invalid query parameters or request body
404 Not Found Resource does not exist
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error (unexpected)
Terminal window
curl https://api.phantomjson.app/v1/users/999
{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found",
"path": "/v1/users/999",
"timestamp": "2026-01-15T10:30:00.000Z"
}
Terminal window
curl "https://api.phantomjson.app/v1/users?limit=abc"
{
"statusCode": 400,
"error": "Bad Request",
"message": "limit must be a number",
"path": "/v1/users",
"timestamp": "2026-01-15T10:30:00.000Z"
}
Terminal window
# After exceeding 100 requests per minute
curl https://api.phantomjson.app/v1/users
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded",
"path": "/v1/users",
"timestamp": "2026-01-15T10:30:00.000Z"
}