How do I use the licensing API to manage licenses programmatically?
Learn how to use the SecureMailMerge licensing REST API to assign and unassign licenses programmatically using API keys.
Contents
The licensing server provides a REST API that lets you assign and unassign licenses programmatically. This is useful for resellers managing multiple clients, IT teams automating onboarding, or anyone integrating license management into their own tools.
Authentication and base URL
All API requests are authenticated using an API key. The API key is a GUID that you include in the request body (not in a header).
All API endpoints are available at:
https://licensing.solinventum.com/api/manage/{subscriptionType}/{subscriptionID}
Where:
subscriptionTypeis one of:Paddle,Azure, orManualsubscriptionIDis the GUID of your subscription
You don’t need to construct this URL yourself. On the licensing server, go to your subscription’s “Assign Licenses” page and select the Assign licenses via API tab. It will show the full base URL, your API key, and a ready-to-use JSON payload for your subscription.
Regenerating your API key
If your API key is compromised, you can regenerate it from the same page. The old key is invalidated immediately. Only the subscription owner can regenerate API keys. Always use HTTPS when calling the API and keep your API key secret - anyone with your API key can assign and unassign licenses on your subscription.
Open the licensing server →
Assign licenses
Add license assignments to one or more email addresses.
PUT /api/manage/{subscriptionType}/{subscriptionID}
Content-Type: application/json
Request body
{
"apiKey": "4024d0d8-9a7d-4ac3-9e61-efaeb7c278df",
"emails": ["[email protected]", "[email protected]"]
}
| Field | Type | Description |
|---|---|---|
apiKey | string (GUID) | Your subscription API key |
emails | string array | Email addresses to assign licenses to |
Response
Success (200):
{
"success": true,
"errors": [],
"assignmentStats": {
"availableLicenses": 10,
"assignedLicenses": 7
}
}
Insufficient licenses (402):
Returned when you try to assign more licenses than are available on your subscription.
Bad request (400):
Returned for validation errors such as invalid email format, duplicate emails, or missing fields.
Validation rules
- At least one email address must be provided
- Each email must be a valid format and no longer than 256 characters
- Duplicate emails within the same request are rejected
- You cannot assign more licenses than your subscription has available
Examples
cURL
curl -X PUT \
https://licensing.solinventum.com/api/manage/Paddle/ff3d3cf5-5388-40a0-915f-970c1d2d972f \
-H "Content-Type: application/json" \
-d '{
"apiKey": "4024d0d8-9a7d-4ac3-9e61-efaeb7c278df",
"emails": ["[email protected]"]
}'
PowerShell
$body = @{
apiKey = "4024d0d8-9a7d-4ac3-9e61-efaeb7c278df"
emails = @("[email protected]")
} | ConvertTo-Json
Invoke-RestMethod `
-Method Put `
-Uri "https://licensing.solinventum.com/api/manage/Paddle/ff3d3cf5-5388-40a0-915f-970c1d2d972f" `
-ContentType "application/json" `
-Body $body
Unassign licenses
Remove license assignments from one or more email addresses.
DELETE /api/manage/{subscriptionType}/{subscriptionID}
Content-Type: application/json
Request body
{
"apiKey": "4024d0d8-9a7d-4ac3-9e61-efaeb7c278df",
"emails": ["[email protected]"]
}
The request body format is the same as for assigning licenses.
Response
Success (200):
{
"success": true,
"errors": [],
"assignmentStats": {
"availableLicenses": 10,
"assignedLicenses": 6
}
}
Bad request (400):
Returned if the specified email addresses are not currently assigned to the subscription.
Example
curl -X DELETE \
https://licensing.solinventum.com/api/manage/Paddle/ff3d3cf5-5388-40a0-915f-970c1d2d972f \
-H "Content-Type: application/json" \
-d '{
"apiKey": "4024d0d8-9a7d-4ac3-9e61-efaeb7c278df",
"emails": ["[email protected]"]
}'
Error handling
| Status code | Meaning |
|---|---|
| 200 | Request successful |
| 400 | Invalid request (check errors array in response) |
| 402 | Insufficient licenses available |
| 404 | Subscription not found or API key does not match |
Always check the success field and errors array in the response body for details on what went wrong.