You can add multiple tenants and companies to a tier in a single mutation.

Companies and tenants can only be in a single tier.

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.addMembersToTier({
  memberIdentifiers: [
    {
      tenantId: 'te_123',
    },
    {
      companyId: 'co_123',
    },
  ],
  tierIdentifier: { externalId: 'XXX' },
});

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