Widget

Welcome to the Fake API documentation. This API allows you to interact with the fictional Fake Service. Below you will find details on the available endpoints and their usage.


Authentication

To access the API, you need to provide an API key in the Authorization header for each request.

Example:

curl -X GET https://api.fakeservice.com/endpoint -H "Authorization: Bearer YOUR_API_KEY"

Base URL

All API requests are made to the following base URL:

https://api.fakeservice.com/v1

Endpoints

1. Get User Info

Retrieve information about a user based on their user ID.

Endpoint

GET /users/{user_id}

Request Parameters

Parameter Type Description
user_id string The unique identifier for the user.

Example Request

curl -X GET https://api.fakeservice.com/v1/users/12345 -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "id": "12345",
  "name": "John Doe",
  "email": "john.doe@example.com",
  "created_at": "2021-08-01T12:34:56Z"
}

2. Create New User

Create a new user account.

Endpoint

POST /users

Request Body

Field Type Description
name string The name of the user.
email string The email address of the user.
password string The password for the user account.

Example Request

curl -X POST https://api.fakeservice.com/v1/users -H "Authorization: Bearer YOUR_API_KEY" -d '{"name": "Jane Doe", "email": "jane.doe@example.com", "password": "securepassword123"}'

Example Response

{
  "id": "67890",
  "name": "Jane Doe",
  "email": "jane.doe@example.com",
  "created_at": "2025-03-18T14:00:00Z"
}

3. Update User Info

Update information for an existing user.

Endpoint

PUT /users/{user_id}

Request Parameters

Parameter Type Description
user_id string The unique identifier of the user to update.

Request Body

Field Type Description
name string The new name for the user (optional).
email string The new email for the user (optional).

Example Request

curl -X PUT https://api.fakeservice.com/v1/users/12345 -H "Authorization: Bearer YOUR_API_KEY" -d '{"name": "Johnathan Doe", "email": "johnathan.doe@example.com"}'

Example Response

{
  "id": "12345",
  "name": "Johnathan Doe",
  "email": "johnathan.doe@example.com",
  "created_at": "2021-08-01T12:34:56Z"
}

Error Codes

Code Message Description
400 Bad Request The request was invalid or missing data.
401 Unauthorized Missing or invalid API key.
404 Not Found The requested resource does not exist.
500 Internal Server Error An unexpected error occurred.

Rate Limiting

To prevent abuse, the Fake API enforces rate limiting. The current limits are:

  • 1000 requests per hour per API key.
  • 60 requests per minute per API key.

If you exceed the rate limit, you will receive a 429 Too Many Requests response.


For more information, please refer to the FAQ or contact our support team at .

Updated on 20 March, 2025

On this page