GraphQL
- Introduction
- Authentication
- Schema
- Customers
- Companies
- Tenants
- Threads
- Tiers
- Events
- Labels
- Messaging
- Pagination
- Error handling
- Error codes
- API Explorer
- Typescript SDK
Reference
- Customer cards
- Webhooks
- Request signing
- mTLS
- UI Components
- Attachments
Tiers
Add companies and tenants to tiers
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
Copy
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);
}
Copy
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);
}
Query
Copy
mutation addMembersToTier($input: AddMembersToTierInput!) {
addMembersToTier(input: $input) {
memberships {
__typename
... on TenantTierMembership {
id
tenantId
}
... on CompanyTierMembership {
id
companyId
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}
Variables
Copy
{
"input": {
"memberIdentifiers": [
{
"tenantId": "te_123"
},
{
"companyId": "co_123"
}
],
"tierIdentifier": { "externalId": "XXX" }
}
}
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.