Limits

Configure and monitor rate limits for your LinkedIn accounts. See the Admin overview for initialization.

Get defaults

Get the system default limits. These are applied when an account has no custom limits or after resetting.

typescript
try {
  const { limits } = await admin.limits.getDefaults();

  for (const limit of limits) {
    console.log(`${limit.category} (${limit.period}): max ${limit.maxValue}, enabled: ${limit.isEnabled}`);
  }
} 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

Array of limit objects:

  • category – limit category (see table below).
  • perioddaily, weekly, or monthly.
  • maxValue – maximum allowed actions.
  • isEnabled – whether this limit is enforced.

Limit categories

CategoryDescription
stPersonProfileViewsStandard LinkedIn profile views
stCompanyPageViewsStandard LinkedIn company page views
stConnectionRequestsConnection requests sent
stMessagesMessages sent
stSearchQueriesLinkedIn search queries
stReactionsPost reactions
stCommentsPost comments
stPostsPosts created
nvPersonProfileViewsSales Navigator profile views
nvCompanyPageViewsSales Navigator company page views
nvMessagesSales Navigator messages

Get account limits

typescript
const { limits } = await admin.limits.get({ accountId: 'f9b4346a-...' });

Params

  • accountId – account UUID.

Get usage

Check current usage against configured limits.

typescript
const { usage } = await admin.limits.getUsage({ accountId: 'f9b4346a-...' });

for (const entry of usage) {
  const remaining = entry.maxValue - entry.currentValue;
  console.log(`${entry.category} (${entry.period}): ${entry.currentValue}/${entry.maxValue} (${remaining} remaining)`);
}

Params

  • accountId – account UUID.

Data

Array of usage objects:

  • category – limit category.
  • perioddaily, weekly, or monthly.
  • maxValue – maximum allowed actions.
  • currentValue – actions performed in the current period.
  • isEnabled – whether this limit is enforced.

Set limits

Set or update limits for an account. Only the specified limits are created or updated; other limits remain unchanged.

typescript
await admin.limits.set({
  accountId: 'f9b4346a-...',
  limits: [
    {
      category: 'stMessages',
      period: 'daily',
      maxValue: 25,
      isEnabled: true,
    },
    {
      category: 'stConnectionRequests',
      period: 'weekly',
      maxValue: 30,
    },
  ],
});

Params

  • accountId – account UUID.
  • limits – array of limit configurations:
    • category – limit category.
    • perioddaily, weekly, or monthly.
    • maxValue – maximum allowed actions (>= 0).
    • isEnabled – whether this limit is enforced (default: true).

Delete limits

Remove specific limits from an account. The account will fall back to default behavior for removed limits.

typescript
await admin.limits.delete({
  accountId: 'f9b4346a-...',
  limits: [
    { category: 'stMessages', period: 'daily' },
    { category: 'stConnectionRequests', period: 'weekly' },
  ],
});

Params

  • accountId – account UUID.
  • limits – array of limits to remove, each with category and period.

Reset to defaults

Reset all limits for an account to the system defaults.

typescript
await admin.limits.resetToDefaults({ accountId: 'f9b4346a-...' });

Params

  • accountId – account UUID.

Errors

All limit methods may throw:

  • linkedApiTokenRequired – missing token.
  • invalidLinkedApiToken – invalid or expired token.
  • accountNotFound – account does not exist or does not belong to you.
  • tooManyRequests – rate limit exceeded.

For the complete HTTP API reference, see Admin API: Limits.