title | sidebarTitle | description |
---|---|---|
Running a test via webhook |
Webhook |
How to run tests by sending a webhook. |
You can trigger a test run by sending a POST request to a webhook URL. This can be useful if you want to trigger a test run in your CI pipeline. Make sure to generate an API key in the Momentic app first.
```bash curl -X POST \ -H 'Authorization: Bearer ' \ -H "Content-Type: application/json" \ 'https://api.momentic.ai/v1/tests/d8c4ee5c-bb47-4471-bbe1-93cbfef49fb4/queue' ``` ```js fetch("https://api.momentic.ai/v1/tests/d8c4ee5c-bb47-4471-bbe1-93cbfef49fb4/queue", { method: "POST", headers: { Authorization: 'Bearer ', "Content-Type": "application/json" }, }) ``` ```bash curl -X POST \ -H 'Authorization: Bearer ' \ -H "Content-Type: application/json" \ 'https://api.momentic.ai/v1/tests/queue' \ --data-binary @- << EOF { "testIds": [ "d8c4ee5c-bb47-4471-bbe1-93cbfef49fb4", "d8c4ee5c-bb47-4471-bbe1-93cbfef49fb4" ] } EOF ``` ```js fetch("https://api.momentic.ai/v1/tests/queue", { method: "POST", headers: { Authorization: 'Bearer ', "Content-Type": "application/json" }, body: JSON.stringify({ testIds: [ "d8c4ee5c-bb47-4471-bbe1-93cbfef49fb4", "d8c4ee5c-bb47-4471-bbe1-93cbfef49fb4" ] }) }) ```