Skip to content

Schema Reference

Exhaustive specification of the test file format.

Global [config]

KeyTypeRequiredNotes
base_urlstringyesBase URL for all requests
default_headersmap<string,string>noAdded to every request
insecureboolnoAccept invalid TLS certs
allowed_commandsarray<string>noWhitelist for command hooks

Environment variables can be interpolated in any string via ${{NAME}}.

toml
[config]
base_url = "https://api.example.com"
default_headers = { "Content-Type" = "application/json" }
insecure = false
allowed_commands = ["bash", "sh", "echo", "jq"]

[[tests]] entries

KeyTypeRequiredNotes
namestringyesDisplay name
methodstringyesGET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
endpointstringyesAppended to base_url; supports {{vars}}
query_paramsmap<string,string>noEach value supports {{vars}} and ${{ENV}}
headersmap<string,string>noPer-test headers
bodyJSON valuenoInline JSON; strings support {{vars}} and {{file:path}}
body_filestring (relative path)noLoad body from file; .json parsed as JSON
expected_statusnumberyesHTTP status code
expected_bodyJSON valuenoExact match; use assertions for flexible checks
assertionsarray&lt;Assertion&gt;noSee Assertions Reference
storemap<string,string>noJSONPath (like $.id) → variable name
get_cookiemap<string,string>noCookie name → variable name
max_response_timenumber (ms)noFails if exceeded
beforearray&lt;CommandStep&gt;noRun before HTTP call
afterarray&lt;CommandStep&gt;noRun after; supports on condition

Mutual exclusivity: body and body_file cannot be used together.

CommandStep

KeyTypeRequiredNotes
runstringyesCommand binary or script
argsarray<string>noArguments array
shellboolnoRun via shell (sh -lc)
dirstringnoWorking directory
envmap<string,string>noStep environment variables
timeout_msnumbernoDefault 30000
ignore_errorboolnoDon’t fail on non-zero exit
capture{ var: string }noSave stdout→, stderr→_stderr
exportmap<string,string>noJSONPath from stdout → variable
whenstringnoSimple ==/!= condition after substitution
onstringnoOnly for after: success/failure/always

Security: every step is validated against [config].allowed_commands.