hitspec serve --api-only. All endpoints are prefixed with /api/v1. Responses are JSON with Content-Type: application/json.
Error Format
All error responses follow a consistent structure:Workspace & Files
Get Workspace Overview
Returns the workspace file tree, total request count, active environment, and whether a config file exists.200 OK
List Files
Returns a flat list of all.http and .hitspec files in the workspace with metadata.
200 OK
Get Parsed File
Returns the fully parsed content of a single.http or .hitspec file, including all requests, variables, assertions, and captures.
string
required
Relative path to the file within the workspace. Uses wildcard path matching (
{path...}).200 OK
Get Raw File Content
Returns the raw text content of a file. Use this for source editing.string
required
Relative path to the file within the workspace.
200 OK with Content-Type: text/plain
Create File
Create a new.http or .hitspec file in the workspace.
string
required
Relative path for the new file. Must end in
.http or .hitspec and be within the workspace.201 Created
Save File
Save raw text content to an existing file. The file watcher suppresses the corresponding change notification to prevent UI reload loops.string
required
Relative path to the file within the workspace.
text/plain.
Response 200 OK
Delete File
Delete a.http or .hitspec file from the workspace.
string
required
Relative path to the file within the workspace.
204 No Content
Execution
Execute Request
Execute one or more requests from a specific file. WhenrequestName is provided, only that request runs (filtered by name). When omitted, all requests in the file execute.
Real-time progress is broadcast over the WebSocket connection during execution.
string
required
Relative path to the
.http or .hitspec file within the workspace.string
Name of a specific request to execute. When omitted, all requests in the file are executed.
string
Environment name to use for variable interpolation. Overrides the server’s active environment.
200 OK
Run File
Run all requests in a file. Similar toexecute but always runs every request (no name filter).
string
required
Relative path to the
.http or .hitspec file within the workspace.string
Environment name to use. Overrides the server’s active environment.
200 OK — same RunResultDTO structure as the Execute Request endpoint.
Environments
List Environments
Returns all environments defined inhitspec.yaml, including the currently active environment.
200 OK
Set Active Environment
Switch the server’s active environment. Broadcasts anenvironment_changed event over WebSocket.
string
required
The name of the environment to set as active.
204 No Content
Get Environment
Get the variables for a specific environment.string
required
Environment name.
200 OK
Update Environment
Create or update the variables for a named environment.string
required
Environment name.
object
required
Map of variable names to values for this environment.
200 OK
Config
Get Configuration
Returns the currenthitspec.yaml configuration. Returns an empty object if no config file is present.
200 OK
Update Configuration
Partially update the server configuration. Only provided fields are updated; omitted fields remain unchanged. Changes are persisted to thehitspec.yaml config file on disk. If no config file exists, one is created in the workspace root.
number
Request timeout in milliseconds. Must be greater than 0.
number
Number of automatic retries on failure. Must be greater than 0.
boolean
Whether to follow HTTP 3xx redirects.
boolean
Whether to validate SSL/TLS certificates.
string
HTTP proxy URL (e.g.,
http://proxy:8080).boolean
Whether to run independent requests in parallel.
number
Maximum number of concurrent requests in parallel mode. Must be greater than 0.
200 OK — returns the updated configuration object.
History
hitspec maintains two layers of history: a lightweight in-memory history for the current session and a persistent SQLite-backed history stored at~/.hitspec/history.db.
Get In-Memory History
Returns the in-memory execution history for the current server session.200 OK
Clear In-Memory History
Clear all in-memory history entries.204 No Content
List Persistent Runs
Returns paginated persistent run history from the SQLite database.number
default:"20"
Number of runs to return. Maximum 100.
number
default:"0"
Number of runs to skip for pagination.
200 OK
Get Run Details
Returns a single run with its full results and assertion details.number
required
Numeric run ID.
200 OK
Delete a Run
Delete a specific run and all its associated results and assertions (cascade delete).number
required
Numeric run ID.
204 No Content
Delete All Runs
Delete all persistent run history.204 No Content
List Results by Request Name
Retrieve historical results for a specific request, filtered by file path. Useful for comparing how a single request’s responses have changed over time. Results are ordered by run start time (newest first).string
required
The name of the request to look up.
string
required
The file path containing the request.
number
default:"20"
Maximum number of results to return (1–100).
number
default:"0"
Number of results to skip for pagination.
200 OK
Stress Testing
Start Stress Test
Start a load test against the requests defined in one or more files. Metrics are broadcast in real time over the WebSocket connection viastress_update messages.
string[]
required
List of
.http or .hitspec file paths relative to the workspace.string
required
Duration of the stress test as a Go duration string (e.g.,
"30s", "5m", "1h").number
Target requests per second in rate mode.
number
Number of virtual users. Setting this switches from rate mode to VU mode.
number
Maximum number of concurrent virtual users.
200 OK
409 Conflict if a stress test is already running.
Stop Stress Test
Stop a running stress test. If no test is currently running, the endpoint returns200 OK with an "already_stopped" status instead of an error.
200 OK
Get Stress Test Status
Returns whether a stress test is running and, if so, the current metrics.200 OK
Get Stress Test Result
Returns the result of the last completed stress test, including summary metrics, latency percentiles, and per-request breakdown.200 OK
List Stress Profiles
Returns the stress test profiles defined inhitspec.yaml.
200 OK
Create Stress Profile
Create a new stress profile. The profile is persisted tohitspec.yaml.
string
required
Unique name for the profile. Must not conflict with an existing profile.
string
required
Duration of the stress test as a Go duration string.
201 Created
409 Conflict if a profile with the same name already exists.
Update Stress Profile
Update an existing stress profile. The changes are persisted tohitspec.yaml.
string
required
Name of the profile to update.
name).
Response 200 OK
404 Not Found if the profile does not exist.
Delete Stress Profile
Delete a stress profile. The deletion is persisted tohitspec.yaml.
string
required
Name of the profile to delete.
204 No Content
Error 404 Not Found if the profile does not exist.
Mock Server
Start Mock Server
Start a mock server that serves responses based on the request/response pairs defined in your.http files. Incoming requests to the mock server are broadcast over WebSocket as mock_request events.
string[]
required
List of
.http or .hitspec file paths containing request/response pairs.number
default:"3000"
Port on which the mock server will listen.
string
Artificial delay before each response, as a Go duration string (e.g.,
"100ms", "1s").200 OK
409 Conflict if a mock server is already running.
Stop Mock Server
Stop the running mock server.200 OK
Get Mock Routes
Returns the current status and registered routes of the mock server.200 OK (when running)
200 OK (when not running)
Contract Testing
Verify Contracts
Run contract verification against a live provider. Sends each request defined in the contract files to the provider URL and validates the responses match expectations.string
required
The base URL of the provider service to verify contracts against.
string
URL of an endpoint that accepts state setup requests before each interaction.
string[]
List of contract file paths. When omitted, all
.http/.hitspec files in the workspace are used.200 OK
List Contract Files
Returns all.http/.hitspec files in the workspace that can be used as contract files.
200 OK
Recording Proxy
Start Recording
Start a recording proxy that captures HTTP traffic passing through it. The proxy forwards requests to the target URL and records both request and response.string
required
The upstream URL that the proxy forwards requests to.
number
default:"8081"
Port on which the recording proxy will listen.
boolean
default:"false"
When true, duplicate requests with the same method and path are only recorded once.
string[]
List of URL path patterns to exclude from recording.
string[]
List of header names whose values should be sanitized (replaced with placeholders) in the recorded output.
200 OK
409 Conflict if a recording proxy is already running.
Stop Recording
Stop the recording proxy.200 OK
Get Recording Status
Returns whether the recording proxy is running, how many requests have been captured, and the captured request details.200 OK (when running)
200 OK (when not running)
Export Recordings
Export all captured recordings as.http file content. The proxy must be running.
200 OK
Clear Recordings
Clear all captured recordings without stopping the proxy.200 OK
Import
Import curl
Convert a curl command or a file containing curl commands into.http format.
command or filePath is required.
string
A curl command string to convert to
.http format.string
Path to a file containing curl commands, relative to the workspace.
200 OK
Import Insomnia
Convert an Insomnia export (JSON) into.http format.
data or filePath is required.
string
Insomnia export JSON content as a string.
string
Path to an Insomnia JSON export file, relative to the workspace.
200 OK
Import OpenAPI
Convert an OpenAPI specification (YAML or JSON, v2 or v3) into.http format. The spec can be a local file path or a URL.
string
required
Path to the OpenAPI specification file (relative to workspace) or a URL. Supports YAML and JSON, OpenAPI v2 and v3.
string
Override the base URL from the spec. Useful when the spec references a production URL but you want to target localhost.
200 OK
Export
Export as curl
Convert requests from a.http/.hitspec file into curl commands.
string
required
Relative path to the
.http or .hitspec file in the workspace.string
Name of a specific request to export. When omitted, all requests are exported.
200 OK
System
Get System Info
Returns version, build time, Go version, and platform information.200 OK
WebSocket
Connect
Establish a WebSocket connection for real-time event streaming. The server pushes events as they occur — no polling required.The WebSocket endpoint accepts connections from
localhost, 127.0.0.1, and [::1] origins only.Message Envelope
All WebSocket messages use this envelope format:Message Types
execution_start
Sent when a request execution begins.
request_progress
Sent for each individual request as it starts and completes during an execution.
status field is either "started" or "completed". The passed and duration fields are only present when status is "completed".
execution_complete
Sent when an entire execution finishes. The result payload contains the full RunResultDTO.
error
Sent when an execution fails with an error.
environment_changed
Sent when the active environment is switched via PUT /api/v1/environments/active.
file_changed
Sent when a .http or .hitspec file is created, modified, or deleted in the workspace (via filesystem watcher).
stress_update
Sent every 500ms during an active stress test with current metrics. The running and completed booleans indicate the test lifecycle — the UI uses these to detect when a test finishes naturally (without an explicit stop) and transition to the results view.
mock_request
Sent when the mock server receives a request, or when it starts/stops.
event field can be "started", "stopped", or "request".
ping / pong
Clients can send {"type": "ping"} messages and the server will respond with a pong: