05 Enterprise administration and integrations · Advanced
Automate with the API, webhooks and a CI release gate
Create a scoped API key, send signed webhooks to your own systems, and fail a release in CI when risk is too high.
In this lesson you will learn
- How API keys and scopes work
- Which events webhooks send
- How the release gate decides pass or fail
Threat modeling in your pipeline
The REST API lets pipelines, scripts and internal tools read and update threat models without a person signing in. Webhooks tell your systems when something happens. The release gate turns your risk policy into a pass or fail for a deployment.
Steps
-
Create an API key
In Settings, API keys, click New API key. Name it, pick its scopes (for example forests:read and risks:read), and optionally an expiry, the forests it may reach and the IP addresses it may be used from. Copy the key when it's shown: it isn't shown again. Store it as a secret in your CI system.
A read-only key for a CI release gate. -
Add a webhook
In Settings, Webhooks, click Add webhook, enter an HTTPS URL and tick the events it should receive: a risk becoming high or critical, a model submitted, approved or sent back, threats flagged for re-review, comments, mitigations, imports and diagram changes. Each request is signed; check the signature with the secret shown when you create it.
A webhook that tells your SOAR about new critical risks. -
Gate releases in CI
Call the release gate for a forest from your pipeline. It fails when an open risk is at or above
max_severity(High by default), and optionally when the model isn't approved or threats wait for re-review. It returns the reasons as JSON, or as SARIF for GitHub code scanning. The API documentation has GitHub Actions and Azure Pipelines examples.
People keep the big decisions. The API follows the app's rules: approving a model, signing off an accepted risk, deleting a forest and restoring a backup stay with people in the app.
Practice
Try it
Create an API key with risks:read for one forest, store it as a CI secret, and add the release gate to a pipeline with max_severity set to high.
This lesson covers Enterprise features. Not on Enterprise yet? Talk to us about Enterprise.
Open API keysQuiz
Check what you learned
Three quick questions. Your answers stay in this browser.