Docs
Quickstart
This is the whole thing: get a key, POST it somewhere, read the answer. No account is needed to read any page in this section, only to make the key you will call it with.
1. Get an API key
A key is made from inside a workspace, on its API page, and shown to you once. Bloom stores only a hash of it, so if you lose it you rotate it rather than ask for it back. A new key defaults to the license.validate scope, which is what this page uses. See Authentication for what every scope can reach.
No workspace yet? Making an account takes a minute, but nothing on this page requires it until you are ready to call the API with a real key.
2. Validate a licence
One HTTPS POST to /api/v1/licenses/validate, with the key as a Bearer token and the licence key in the body. hwid is optional and only matters for licences locked to a machine.
const res = await fetch('https://bloomcloud.pro/api/v1/licenses/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + process.env.BLOOM_API_KEY,
},
body: JSON.stringify({
key: config.licenseKey,
hwid: machineId(), // omit to check without locking to a machine
version: app.version,
}),
});
const result = await res.json();
if (!result.valid) {
throw new Error('License refused: ' + result.reason);
}3. Read the answer
A valid licence comes back as { valid: true, license }. A refused one comes back as { valid: false, reason }, with the HTTP status set to match: 401 for a bad key, 403 for a scope or plan problem, 429 when the plan's rate limit is hit, and 200 for a licence the key itself checked and rejected. The full list of reasons is on Errors.