API and webhooks
Objectives
Why it's useful
These are the two sides of the same integration. Webhooks push information out: your SIEM, your HR tool, or your messaging system are notified as soon as a user is created or logs in. The API brings it in: a script or an external tool creates users, configures applications, or reads the audit log without going through the portal.
Your turn
To test without a server, use an online webhook reception service that provides you with a temporary URL.
Webhooks
- Go to Configuration, tab Webhooks. → API and Webhooks
- Click on Add an endpoint, enter the destination URL and select one or more events.
- Trigger one of the chosen events (for example, create a test user if you selected user creation): it arrives via HTTP POST at your URL.
- Find the signature secret displayed at the top of the tab. Your receiver uses it to verify the HMAC-SHA256 signature of each event.
API
- In the API tab, toggle the Enable API switch.
- Click on Create an API key, name it after what will use it (for example, "Onboarding Script"), then set its rights resource by resource: None, Read, or Read and write.
- Copy the key immediately: it is only displayed once.
- Open the interactive documentation with Open VaultysHub API documentation and call a read endpoint with your key.
- In the ⋮ menu of the key, try Edit, then Revoke the key at the end of the exercise.
One key per use, with the minimum rights: you can revoke one without cutting off the others, and the audit log attributes each modification to the key name.
A key with the right Applications: read gives access to client secrets of applications. Keep it like an administrator password.
Check your knowledge
To remember
- Webhooks send events to your systems, signed in HMAC-SHA256.
- The API is disabled by default; each key has a name and rights per resource.
- A key is only displayed once: if lost, it is revoked and replaced.
Next lesson: An AI assistant for administration