Create endpoint
create_endpointCreate a mock HTTP endpoint in a workspace. Provide the workspace slug, method, route (must start with /), and response_body (served as-is; JSON is typical). Pass folder_id to place it in a folder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| route | Yes | Path starting with /, e.g. /api/v1/users/:id (:param matches one segment). | |
| method | Yes | HTTP method. | |
| delay_ms | No | Artificial response delay in ms (default 0). | |
| auth_type | No | Simulated auth scheme shown for the mock (default None). | |
| folder_id | No | Folder id to place the endpoint in (from list_folders / create_folder). Omit for the workspace root. | |
| workspace | Yes | Workspace slug (from list_workspaces). | |
| capture_mode | No | Request-log capture detail (default metadata). | |
| content_type | No | Content-Type header (default application/json). | |
| require_auth | No | Make the mock require an Authorization header (default false). | |
| response_body | Yes | Response body served as-is (usually JSON). | |
| cors_allow_all | No | Send permissive CORS headers (default true). | |
| selection_mode | No | How a response variant is chosen when several match. first_match (default) serves the first matching variant. weighted picks among matching variants by weight (a percentage); the rest goes to the endpoint's own response. | |
| response_status | No | HTTP status code (default 200). | |
| template_enabled | No | Interpret response_body as a response template (default false). | |
| response_variants | No | Alternative responses; replaces the whole list ([] removes them all). Each has a name, status, body and content_type, and optional conditions that must all match: source header | query | path_param | cookie | body (dot path such as customer.email), with operator equals | not_equals | contains | not_contains | starts_with | ends_with | one_of (value is a list) | exists | not_exists | gt | gte | lt | lte | matches (RE2 regex). With no match the endpoint's own response is served. A request can force a variant with the X-APIMock-Variant header. Check the result with simulate_request. |