Errors
PhantomJSON returns consistent error responses across all endpoints.
Error Response Format
Section titled “Error Response Format”{ "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 |
HTTP Status Codes
Section titled “HTTP Status Codes”| 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) |
Examples
Section titled “Examples”404 Not Found
Section titled “404 Not Found”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"}400 Bad Request
Section titled “400 Bad Request”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"}429 Too Many Requests
Section titled “429 Too Many Requests”# After exceeding 100 requests per minutecurl 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"}