Skip to content

Configuration

The @config directive lets you define shared settings that apply to multiple requests, reducing repetition.

A config block at the top of the file applies to all requests in that file:

@config
baseUrl: https://api.example.com
timeout: 5000
retries: 2
headers:
Content-Type: application/json
Accept: application/json
assert:
status == 200

Scope configuration to a specific collection:

@config
collection: Auth API
baseUrl: https://auth.example.com
headers:
X-API-Key: {{apiKey}}
PropertyDescriptionExample
baseUrlPrepended to relative URLs (starting with /)https://api.example.com
timeoutDefault timeout in milliseconds5000
retriesDefault retry count for 5xx errors3
headersDefault headers (YAML-style, key: value)Content-Type: application/json
assertDefault assertions applied to every requeststatus == 200
collectionScope this config to a named collectionAuth API
PropertyBehavior
baseUrlPrepended to URLs that start with /. Full URLs are not affected.
headersMerged — request-level headers override config headers with the same key.
timeoutApplied only if the request doesn’t define its own @timeout.
retriesApplied only if the request doesn’t define its own @retry.
assertionsAccumulated — both config and request assertions run.
@config
baseUrl: https://api.example.com
headers:
Content-Type: application/json
Authorization: Bearer {{token}}
assert:
status >= 200
###
@name Get Users
GET /users
### This request overrides the Content-Type header
@name Create User
POST /users
Content-Type: application/xml
<user><name>John</name></user>

In the Get Users request:

  • URL resolves to https://api.example.com/users
  • Content-Type: application/json and Authorization: Bearer {{token}} are applied
  • @assert status >= 200 is applied automatically

In the Create User request:

  • Content-Type is overridden to application/xml
  • Authorization is still applied from config
  • The assertion is still applied