Subscription
Manage your Linked API subscription: check status and adjust seats. See the Admin overview for initialization.
Get status
typescript
try {
const status = await admin.subscription.getStatus();
console.log(status.status); // 'active' | 'trialing' | 'past_due' | 'canceled' | undefined
console.log(status.eligibleForTrial); // boolean
console.log(status.cancelAtPeriodEnd); // boolean
} catch (e) {
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}Data
status–active,trialing,past_due,canceled, orundefinedif no subscription.eligibleForTrial– whether a 7-day free trial is available.cancelAtPeriodEnd– whether the subscription is scheduled to cancel at the end of the current billing period.
Get seats
typescript
const { seats } = await admin.subscription.getSeats();
for (const seat of seats) {
console.log(`${seat.seatType} × ${seat.quantity} (${seat.billingPeriod})`);
}Data
Array of seat objects:
seatType–coreorplus. Theplustier unlocks Sales Navigator actions (nv.*).quantity– number of seats. Each seat allows one connected LinkedIn account.billingPeriod–monthoryear.
Set seats
New users can start with a 7-day free trial.
typescript
const result = await admin.subscription.setSeats({
quantity: 5,
seatType: 'plus',
billingPeriod: 'year',
});
if (result.status === 'processing') {
// No active subscription – redirect user to checkout
console.log('Complete payment:', result.paymentLink);
} else {
console.log('Seats updated');
}Params
quantity– number of seats (1–1000).seatType–coreorplus.billingPeriod–monthoryear.
Data
status–complete(subscription updated) orprocessing(checkout required).paymentLink– Stripe checkout URL (only whenstatusisprocessing).
Note: When reducing seats below the number of connected accounts, excess accounts will be automatically frozen.
Errors
All subscription methods may throw:
linkedApiTokenRequired– missing token.invalidLinkedApiToken– invalid or expired token.tooManyRequests– rate limit exceeded.
For the complete HTTP API reference, see Admin API: Subscription.