API Mocking
Mock Assistant
Chat with an agent to build, link and test mock endpoints.
Mock Assistant
The Mock Assistant is a chat on each mock's page. Describe the API you need in plain language, and it builds the endpoints and scenarios, links realistic data, and tests the results for you.
Opening the Assistant
Open a mock and click Assistant. The panel works exactly like the Data Assistant on schema pages:
- History reopens or deletes earlier conversations about this mock.
- New chat starts a fresh conversation.
- Each step the assistant takes appears as a row (for example Create endpoint
GET /orders/{id}or Test requestGET /orders/0), and the steps fold into an "N tool calls" summary once it replies.
Conversations belong to one mock and one user.
You can also describe the API when creating a mock: the prompt on the New Mock form is handed to the assistant, which builds the endpoints in the background and notifies you when they're ready.
What You Can Ask
- Build endpoints: "create a todo API with 10 endpoints", "add CRUD endpoints for products", "add GET /orders/{id} that returns 404 when id is 0". There's no fixed endpoint count; only your plan's endpoints-per-mock limit applies.
- Add scenarios: "return 401 when the Authorization header is missing", "return 422 when email is not provided".
- Shape responses: "use a paginated envelope with data and meta", "add a 2 second delay to the slow scenario".
- Use generated data: "list users from my Shop schema". The assistant links a generated table and uses
"$column"and"$array(table, n)"placeholders. - Fix things: "disable the legacy endpoint", "make the success scenario the default".
- Verify: "test GET /orders/0 and /orders/5". The assistant reports the matched scenario and the response.
How It Stays Safe
- It only works on the mock you have open, and only reads your own schemas.
- Every change follows the same rules as the forms: unique method and path, plan limits, valid JSON, valid status codes, and exactly one default scenario per endpoint.
- It always describes a deletion first and waits for your explicit "yes".
- It tests changes with dry runs, which don't use your mock request quota.
Scenario Rules It Follows
- Scenarios are tried by priority, highest first. A scenario matches when all of its conditions match.
- The default scenario answers any request that no other scenario matches.
- Conditions use a type (
query,header,path,body), a field, and an operator (equals,contains,starts_with,ends_with,greater_than,less_than,exists,not_exists). - Conditional scenarios are given a higher priority than the catch-all default.
Usage
Assistant replies use AI tokens from your plan. See Limits and Plans.