Update a license grantee
Update the granteeId
of the license to assign it to a new grantee.
info
If you want to unassign the license, you can set the granteeId
to null
.
- Node.js
- cURL
import { Salable } from '@salable/node-sdk';
const salable = new Salable('your-salable-api-key');
const updatedLicenses = await salable.licenses.updateMany([
{ granteeId: 'new_userId_1', uuid: 'your-license-uuid' },
{ granteeId: null, uuid: 'your-license-uuid' }, // this license will be unassigned
]);
curl
-XPUT
-H 'x-api-key: your-salable-api-key'
-d '[{ "licenseUuid": "your-license-uuid", "granteeId": "new-user-id" }, { "licenseUuid": "your-license-uuid", "granteeId": null }]'
'https://api.salable.app/licenses'