Documentation
Getting Started
Create your first hosted mock REST API with Forge API in just a few minutes. Define an endpoint, add a JSON response and call the generated URL from your browser or application. Paid plans can also protect endpoints with required secret request headers.
Protect your mock API with a secret header
Paid plans can require a custom request header before Forge API returns the endpoint response. This lets you share a mock API with authorised users without allowing requests that do not include your secret value.
Example protected request
x-api-key: your-secret-valueRequests with a missing or incorrect header are rejected. View paid plans to enable request-header protection.
The fastest way to begin
Create or select a project
Projects organise related endpoints and provide the public project key used in your generated API URLs.
Open your Forge API dashboard and select New project. Enter a name such as Online Store.
Forge API assigns the project a public key similar to:
p_your_project_keyProject keys
Create an endpoint
An endpoint combines an HTTP method, a path and the response that Forge API should return.
Inside your project, create a new endpoint using:
/products200Endpoint paths should begin with a forward slash. Nested paths are also supported, for example:
/products
/products/featured
/users/profileAdd the JSON response
Define the exact JSON your frontend should receive when it calls the endpoint.
Paste the following example into the JSON response editor:
[
{
"id": 1,
"name": "Polo Shirt",
"size": "M",
"price": 10,
"stock": 24
},
{
"id": 2,
"name": "Classic Hoodie",
"size": "L",
"price": 29.99,
"stock": 12
},
{
"id": 3,
"name": "Slim Fit Jeans",
"size": "32",
"price": 39.99,
"stock": 8
}
]Use realistic test data
Save the endpoint
Save the endpoint to make the public URL available immediately.
Select Create endpoint or Save endpoint, depending on where you created it.
Your public URL will follow this structure:
https://apis.getforgeapi.com/p_your_project_key/productsYour API is live
Call the endpoint
Test the generated URL and confirm that it returns the configured response.
Use a browser
Because this example uses GET, you can paste the generated URL into your browser address bar.
Use cURL
curl https://apis.getforgeapi.com/p_your_project_key/productsUse JavaScript
const response = await fetch(
"https://apis.getforgeapi.com/p_your_project_key/products"
);
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const products = await response.json();
console.log(products);The request returns the same products array configured in the endpoint response.
Continue building
You now have a working hosted mock API that can be expanded as your application grows.
Learn about projects â
Understand project keys, project settings and how endpoints are organised.
Configure endpoints â
Learn about methods, response status codes, headers and response delays.
Call your API â
See request examples for browsers, cURL and frontend applications.
Explore examples â
Use realistic JSON examples for products, users, orders and authentication.
Ready to build your first mock API?
Create an account, define your response and start using a hosted API URL without writing backend code.