Core concepts
Endpoints
Endpoints define the URLs your application calls and the responses Forge API returns. Each endpoint belongs to a project and combines an HTTP method, path, status code, JSON body and optional configuration.
Every endpoint belongs to a project
Endpoint structure
A public endpoint URL contains the Forge API domain, project key and endpoint path.
https://apis.getforgeapi.com/abc12/productshttps://apis.getforgeapi.comabc12/productsExample keys are placeholders
abc12 with the real public key shown in your project dashboard.Create an endpoint
Add an endpoint from inside an existing project.
- 1
Open a project from the Forge API dashboard.
- 2
Select New endpoint.
- 3
Choose an HTTP method and enter a path.
- 4
Add a valid JSON response body.
- 5
Configure the status code, headers and optional response delay.
- 6
Save the endpoint and copy its public URL.
HTTP methods
The method determines which type of request matches the endpoint.
Retrieve mock data such as products, users or orders.
Simulate creating data, submitting forms or logging in.
Simulate replacing an existing resource.
Simulate partially updating an existing resource.
Simulate deleting a resource.
Return response headers without returning the response body.
Method and path are matched together
GET /products and POST /products are separate endpoints.Endpoint paths
The path identifies the resource or action represented by the endpoint.
/products
/products/featured
/products/1
/users/profile
/orders/latest
/auth/loginForge API normalises endpoint paths so they begin with a forward slash. Trailing slashes are removed from paths longer than the root path.
Do not include query parameters
?page=2 or URL fragments such as #section in the endpoint path.JSON response body
The response body is the JSON returned when the endpoint is called.
You can return JSON objects, arrays, nested values, booleans, numbers and null values.
{
"id": 1,
"name": "Polo Shirt",
"size": "M",
"price": 10,
"in_stock": true
}Forge API validates the JSON before saving it. Invalid JSON must be corrected before the endpoint can be created or updated.
Match your planned production API
Response status codes
Choose the HTTP status code returned with the response.
200OKA successful request returning data.201CreatedA resource was successfully created.204No ContentThe request succeeded without a response body.400Bad RequestThe request was invalid.401UnauthorizedAuthentication or a required secret is missing.404Not FoundThe requested resource could not be found.500Internal Server ErrorSimulate a server-side failure.Status codes are useful for testing success, validation, empty, unauthorized and failure states in your frontend.
{
"success": false,
"error": {
"code": "validation_failed",
"message": "The email address is required."
}
}Response headers
Add custom headers that Forge API should return with the endpoint response.
Content-Typeapplication/json; charset=utf-8A new endpoint starts with a JSON content type by default. You may add additional response headers when your application needs to test custom behaviour.
- Cache-related headers
- Custom application metadata
- API version headers
- Testing-specific headers
Some response headers are blocked
Content-Length, Connection or Set-Cookie.Required request headers
Paid plans can require callers to provide secret header values before receiving the mock response.
Request-header protection can be configured at project level, endpoint level or both.
x-api-keyyour-secret-valueCall the endpoint with the configured header:
curl \
-H "x-api-key: your-secret-value" \
https://apis.getforgeapi.com/abc12/productsRequests with a missing or incorrect value are rejected before the configured JSON response is returned.
Project and endpoint protection are combined
Shared secrets are not full authentication
Required request headers are available on supported paid plans. Compare plans.
Response delays
Simulate slower backend responses to test loading states and timeout behaviour.
Supported paid plans can configure a response delay in milliseconds. Forge API waits for the configured duration before returning the endpoint response.
1500 millisecondscurl \
-i \
https://apis.getforgeapi.com/abc12/slow-responseResponse-delay limits depend on the account plan. Forge API applies the maximum delay permitted by the active plan.
Test loading indicators
Activate or deactivate an endpoint
Temporarily stop an endpoint without deleting its configuration.
Active endpoints return their configured response. Inactive endpoints remain saved in the dashboard but are unavailable to public callers.
Active
The endpoint can be called through its public URL.
Inactive
The endpoint remains saved but public requests are rejected.
Useful during development
Edit an endpoint
Update an endpoint without creating a new public URL.
Open the endpoint from your project dashboard to update:
- HTTP method
- Endpoint path
- Response status code
- JSON response body
- Response headers
- Required request headers
- Response delay
- Active or inactive state
Changing the path changes the URL
Duplicate endpoints
A project cannot contain two endpoints with the same method and path.
The following pair is not allowed inside the same project:
GET /products
GET /productsDifferent methods may use the same path:
GET /products
POST /products
DELETE /productsDelete an endpoint
Remove an endpoint permanently when it is no longer required.
Once deleted, the endpoint URL returns a not-found response. Save any JSON or configuration you may need before deleting it.
Deletion cannot be undone
Endpoint limits
Endpoint and response-size limits depend on your Forge API plan.
Plan limits may control:
- Endpoints allowed per project
- Maximum JSON response size
- Maximum response delay
- Request-header protection availability
- Monthly request allowance
Create a mock endpoint
Choose a method, define a response and start using a hosted API URL from your application.