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.
- Node SDK
- Fetch
- cURL
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.
]);
await fetch("https://api.salable.app/subscriptions/your-subscription-uuid/manage-seats", {
method: "PUT",
headers: {
"x-api-key": "your-salable-api-key",
version: "v2"
},
body: JSON.stringify([
{
type: "assign",
granteeId: "your-new-grantee-id"
},
// You can perform multiple actions by passing in multiple objects.
]);
})
curl
-XPUT
-H 'x-api-key: your-salable-api-key'
-H 'version: v2'
-d '[{ "type": "assign", "granteeId": "your-new-grantee-id" }]'
'https://api.salable.app/subscriptions/your-subscription-uuid/seats'
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.
- Node SDK
- Fetch
- cURL
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.
]);
await fetch("https://api.salable.app/subscriptions/your-subscription-uuid/manage-seats", {
method: "PUT",
headers: {
"x-api-key": "your-salable-api-key",
version: "v2"
},
body: JSON.stringify([
{
type: "unassign",
granteeId: "grantee-id-to-be-unassigned"
},
// You can perform multiple actions by passing in multiple objects.
]);
})
curl
-XPUT
-H 'x-api-key: your-salable-api-key'
-H 'version: v2'
-d '[{ "type": "unassign", "granteeId": "grantee-id-to-be-unassigned" }]'
'https://api.salable.app/subscriptions/your-subscription-uuid/seats'
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.
- Node SDK
- Fetch
- cURL
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.
]);
await fetch("https://api.salable.app/subscriptions/your-subscription-uuid/manage-seats", {
method: "PUT",
headers: {
"x-api-key": "your-salable-api-key",
version: "v2"
},
body: JSON.stringify([
{
type: "replace",
granteeId: "grantee-id-to-be-replaced",
newGranteeId: "new-grantee-id"
},
// You can perform multiple actions by passing in multiple objects.
]);
})
curl
-XPUT
-H 'x-api-key: your-salable-api-key'
-H 'version: v2'
-d '[{ "type": "replace", "granteeId": "grantee-id-to-be-replaced", "newGranteeId": "new-grantee-id" }]'
'https://api.salable.app/subscriptions/your-subscription-uuid/seats'