Webhooks

Many tools and services allow you to configure a webhook that will receive notifications when you commit code, complete a test run, or deploy your application. You can use these settings to initiate a loader.io load test and get notification when a test completes.

Run Webhook

Each test has a unique URL which will initiate that test through the loader.io API when it receives a POST request. A unique test-specific token is embedded right into the URL, so you can initiate tests without writing any code or handing out full access to your account.

You can find your test's run webhook on the "Webhooks & Schedule" tab:

To initiate a test from the command line you could use this URL and curl:

curl -X POST https://api.loader.io/v2/tests/14eed142a0276528b6cab1758e94f2c3/token/feadfbf9aec09f5d9062a95fcb3c343a/run

Click on "reset token" to reset your test's token. Once the token is reset, webhooks with the previous token for this test will no longer work.

Notify Webhook

You can put in a publicly accessible URL into the "Notification" webhook field in order to initiate some action (such as an automated task on your build server) when a test completes.

This URL will receive a POST with a URL-encoded body with the format 

test_id=[test ID]&status=complete

Security #

The run webhook gives limited API access to your account - the token in the URL is specific to a single test, and allows anybody who has it to run a test against your server, so be careful who you give it to! If you think your webhook may have been compromised, you can reset the token and the old one will no longer work.

Because the notify webhook must be accessible from loader.io servers, it might also be a good idea to obfuscate this e.g. with a long path or query parameter and ensure it does not get search indexed.

Still need help? Contact Us Contact Us