If you want to explicitly set the tier for a tenant you can do so using this mutation. If instead you want to add many companies to a tier at once, you can use the add members mutation.

For this mutation you need the following permissions:

  • tierMembership:read
  • tierMembership:create
import { PlainClient } from '@team-plain/typescript-sdk';

const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });

const res = await client.updateTenantTier({
  tenantIdentifier: {
    externalId: 'XXX',

    // Or the tenant id if you prefer
    // tenantId: 'te_123',
  },

  tierIdentifier: {
    externalId: 'XXX',

    // Or the tier id:
    // tierId: "tier_123"
  },
});

if (res.error) {
  console.error(res.error);
} else {
  console.log(res.data);
}