Welcome to my portfolio API documentation.
This document provides information about the available endpoints and their usage.
This is the API for working with local mock-data.
GET /users/
Returns an array of all users.
- None
- Status Code: 200 OK
- Body: Array of user objects
GET /users/:id
Returns a specific user based on the provided ID.
id
(query parameter) - The ID of the user to retrieve.
- Status Code: 200 OK (if user is found)
- Status Code: 404 Not Found (if user is not found)
- Body: User object
POST /users/
Adds a new user with a unique ID.
name
(string, required) - The name of the new user.age
(number, required) - The age of the new user.
- Status Code: 201 Created
- Body: Newly created user object
PATCH /users/:id
Updates a specific user based on the provided ID.
id
(query parameter) - The ID of the user to update.name
(string, optional) - The updated name of the user.age
(number, optional) - The updated age of the user.
- Status Code: 200 OK (if user is updated)
- Status Code: 404 Not Found (if user is not found or no update parameters are provided)
- Body: Updated user object
DELETE /users/:id
Removes a specific user based on the provided ID.
id
(query parameter) - The ID of the user to delete.
- Status Code: 204 No Content (if user is deleted successfully)
- Status Code: 404 Not Found (if user is not found)
- No response body