Skip to main content

Update seats

Assign seat(s)

If a seat has a granteeId of null it is considered unassigned. To assign an unassigned seat, set the type to assign and the granteeId to the new value. An available empty seat on the subscription will then be assigned to the new granteeId. If there are no empty seats, the request will be rejected.

import { Salable } from '@salable/node-sdk';

const salable = new Salable('your-salable-api-key', 'v2');
await salable.subscriptions.manageSeats('your-subscription-uuid', [
{
type: "assign",
granteeId: "your-new-grantee-id"
},
// You can perform multiple actions by passing in multiple objects.
]);

Unassign seat(s)

For a seat to be unassigned, its granteeId must be set to null. To unassign a seat, set the type to unassign and the granteeId to the ID of the grantee you want to unassign from the seat.

import { Salable } from '@salable/node-sdk';

const salable = new Salable('your-salable-api-key', 'v2');
await salable.subscriptions.manageSeats('your-subscription-uuid', [
{
type: "unassign",
granteeId: "grantee-id-to-be-unassigned"
},
// You can perform multiple actions by passing in multiple objects.
]);

Replace grantee(s)

Replacing a seat's granteeId is moving the seat from one grantee to another. To replace a seat's grantee, set the type to replace, the granteeId to the ID of the grantee you want to unassign from the seat, and set newGranteeId to the ID of the new grantee of the seat.

import { Salable } from '@salable/node-sdk';

const salable = new Salable('your-salable-api-key', 'v2');
await salable.subscriptions.manageSeats('your-subscription-uuid', [
{
type: "replace",
granteeId: "grantee-id-to-be-replaced",
newGranteeId: "new-grantee-id"
},
// You can perform multiple actions by passing in multiple objects.
]);