A free mock REST API for QA & SDET students β a drop-in replacement for GoRest.co.in.
Built by Naveen AutomationLabs.
π Live at: https://gorest.in
https://gorest.in/public/v2/users
No signup. No account. Just use it.
npm install
node server.jsAPI runs at http://localhost:3000
Docs homepage at http://localhost:3000/
- GET requests are public β no token needed
- POST, PUT, PATCH, DELETE require an
Authorizationheader with a Bearer token
Authorization: Bearer <your-token>
Any non-empty token is accepted. Use anything β demo-token, abc123, naveen-rocks.
Only blocked-token is rejected β triggers 403 (useful for testing forbidden scenarios).
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| GET | /public/v2/users |
β | List all users (paginated) |
| POST | /public/v2/users |
β | Create a new user |
| GET | /public/v2/users/:id |
β | Get user by ID |
| PUT | /public/v2/users/:id |
β | Replace user (full update) |
| PATCH | /public/v2/users/:id |
β | Update user (partial) |
| DELETE | /public/v2/users/:id |
β | Delete user |
The API supports both JSON (default) and XML responses.
GET https://gorest.in/public/v2/users.xml
GET https://gorest.in/public/v2/users/1001.xmlcurl https://gorest.in/public/v2/users \
-H "Accept: application/xml"<?xml version="1.0" encoding="UTF-8"?>
<users>
<user>
<id>1001</id>
<name>Aarav Sharma</name>
<email>aarav.sharma@example.com</email>
<gender>male</gender>
<status>active</status>
</user>
</users><?xml version="1.0" encoding="UTF-8"?>
<user>
<id>1001</id>
<name>Aarav Sharma</name>
<email>aarav.sharma@example.com</email>
<gender>male</gender>
<status>active</status>
</user><?xml version="1.0" encoding="UTF-8"?>
<e>
<message>Resource not found</message>
</e>{
"id": 1001,
"name": "Aarav Sharma",
"email": "aarav.sharma@example.com",
"gender": "male",
"status": "active"
}| Field | Type | Values |
|---|---|---|
id |
integer | Auto-generated |
name |
string | Required |
email |
string | Required, must be unique |
gender |
string | "male" or "female" |
status |
string | "active" or "inactive" |
curl https://gorest.in/public/v2/userscurl https://gorest.in/public/v2/users.xmlcurl https://gorest.in/public/v2/users \
-H "Accept: application/xml"curl "https://gorest.in/public/v2/users?status=active&gender=male&page=1&per_page=5"curl https://gorest.in/public/v2/users/1001curl https://gorest.in/public/v2/users/1001.xmlcurl -X POST https://gorest.in/public/v2/users \
-H "Content-Type: application/json" \
-H "Authorization: Bearer demo-token" \
-d '{"name":"Naveen Kumar","email":"naveen@example.com","gender":"male","status":"active"}'curl -X PUT https://gorest.in/public/v2/users/1001 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer demo-token" \
-d '{"name":"Naveen Kumar","email":"naveen@example.com","gender":"male","status":"inactive"}'curl -X PATCH https://gorest.in/public/v2/users/1001 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer demo-token" \
-d '{"status":"inactive"}'curl -X DELETE https://gorest.in/public/v2/users/1001 \
-H "Authorization: Bearer demo-token"| Parameter | Description | Example |
|---|---|---|
name |
Filter by name (partial match) | ?name=aarav |
email |
Filter by email (partial match) | ?email=example.com |
gender |
Filter by gender | ?gender=male |
status |
Filter by status | ?status=active |
page |
Page number | ?page=2 |
per_page |
Results per page (max 100) | ?per_page=5 |
| Header | Description |
|---|---|
X-Pagination-Total |
Total number of records |
X-Pagination-Pages |
Total number of pages |
X-Pagination-Page |
Current page number |
X-Pagination-Limit |
Results per page |
| Header | Description |
|---|---|
X-RateLimit-Limit |
Max requests per minute (60) |
X-RateLimit-Remaining |
Remaining requests in current window |
X-RateLimit-Reset |
Seconds until limit resets |
| Code | Meaning | How to trigger |
|---|---|---|
200 |
OK | Successful GET, PUT, PATCH |
201 |
Created | Successful POST |
204 |
No Content | Successful DELETE |
304 |
Not Modified | GET with matching If-None-Match ETag |
400 |
Bad Request | Send malformed/invalid JSON body |
401 |
Unauthorized | Write operation without Authorization header |
403 |
Forbidden | Send Authorization: Bearer blocked-token |
404 |
Not Found | Request a non-existent user ID |
405 |
Method Not Allowed | e.g. DELETE /public/v2/users without ID |
415 |
Unsupported Media Type | POST without Content-Type: application/json |
422 |
Validation Failed | POST with blank/invalid fields |
429 |
Too Many Requests | Exceed 60 requests per minute |
500 |
Internal Server Error | Unexpected server-side error |
The API comes pre-loaded with 20 users (IDs 1001β1020). New users created via POST start from ID 1021. All data resets when the server restarts.
- All write operations (
POST,PUT,PATCH,DELETE) requireContent-Type: application/jsonand a Bearer token - Duplicate emails return a
422validation error - Rate limit is 60 requests/minute per IP
- Use
blocked-tokento deliberately trigger a403response in tests - XML format works on all endpoints β use
.xmlsuffix orAccept: application/xmlheader
Made with β€οΈ for the QA community β Naveen AutomationLabs