API check defaults
Using a set of shared defaults for API checks helps you manage checks that go to the same basic endpoint, share headers and other settings.
HTTP request defaults
You can set defaults for many aspects of an API request, see the separate paragraphs below. The following properties are still controlled at the check level:
- HTTP method & body
- response time limits
Use the base url to define the shared protocol, domain and path for URLs in your group's API checks. This works as follows:
- Set the base URL, i.e.
- The base URL is now available in the
- In your API check, append path and query params, i.e.
Headers & query parameters
Any headers and query parameters defined in the API check defaults are injected into each API check.
- At the group level, you define the header
- At the API check level, you define the same header
X-Customjust with the value
- Checkly will call your API with the
Use the basic auth username and password to inject it into each API check in the group.
Any assertions are injected into each API check's assertion list. Use this to always assert common response codes or headers for your API checks.
Setup & teardown scripts
You can add setup and teardown scripts at the group level as well as the individual group level.
This is the execution flow:
- Group level setup script
- Check level setup script
- Execute your API check
- Check level teardown script
- Group level teardown script
A common scenario for having two levels of setup scripts is the following:
- Group level setup: Fetch a token from a common authentication endpoint.
- Check level: prep some specific test data for this individual check.