Use your API
Using your mock API
Your project's tables are a REST API at its mock URL. It behaves like a small real backend: writes are saved, foreign keys are checked, and errors come back as JSON with a reason.
Find the mock URL
The mock URL is on the Projects page and in the status bar at the bottom of every project page. It looks like https://app.relmock.com/mock/<token>. Anyone who has it can call the API; turn on API keys to limit that. Settings › Danger zone can give the project a new mock URL, which stops the old one working.
Routes
| Request | Answer |
|---|---|
GET /orders | The records, as an array (filters below). |
GET /orders/3 | One record, or 404. |
POST /orders | Creates a record and answers 201. Without an id, the next number (or a UUID) is used. |
PUT /orders/3 | Replaces the record; fields you don't send are removed. |
PATCH /orders/3 | Changes only the fields you send. |
DELETE /orders/3 | 204, applying the relations' delete rules. |
Browser apps can call it from any origin, with or without credentials.
Filter, sort and page
| Parameter | Example | Meaning |
|---|---|---|
| field | ?status=paid | Equals. ?field=null finds empty values. |
_ne | ?status_ne=cancelled | Not equal. |
_gt, _gte, _lt, _lte | ?total_gte=100 | Greater or less than. |
_like | ?name_like=pro | Contains, in any case. |
_sort, _order | ?_sort=total&_order=desc | Sorting. |
_page, _limit | ?_page=2&_limit=10 | Pages. The answer becomes { "data": [...], "total", "page", "limit" }. |
_limit | ?_limit=5 | At most 5 records, still a plain array. |
_start, _end | ?_start=0&_end=5 | A slice of the list. |
A filter on a field the table doesn't have matches nothing, and the X-Mock-Warning header says so. To test slow or failing calls, see Network, latency and time.
Errors your app will see
| Status | When |
|---|---|
400 | The body isn't a JSON object. |
401 | API keys are on and the key is missing or wrong, or a signed-in route has no valid token. |
404 | No such record, table or route. |
409 | The id already exists, or a delete is blocked by a relation. |
422 | A field breaks a rule, or a foreign key points at nothing. The body lists each field and the reason. |
429 | Too many requests. See limits. |
{
"error": "Unprocessable Entity",
"message": "Validation failed: category must be one of \"books\", \"games\", ...",
"errors": [{ "field": "category", "message": "must be one of \"books\", \"games\", ..." }]
}
Settings › Data and writes decides how strict writes are: refuse (the default), warn (saved, with the problems in a header) or off.
Protect it with an API key
In Settings › API keys, turn on Require an API key and create a key. The key is shown once; copy it then. Your app sends it in a header:
X-API-Key: mk_9f3b7c8a1e2d4f5...
Keys in the URL are not accepted, since URLs end up in logs. The dashboard's own Try it and Replay keep working without a key.
Share docs with your team

Every project has an API reference page that needs no account: base URL, every route with parameters and examples, the models, code snippets (cURL, JavaScript, Python, Go) and a Try it button. Open it with Docs on the Tables page, and share it from Settings › Docs and sharing, where you can make it private, add a passcode, or make a new link.