Skip to main content
Using TypeScript? Check out our GraphQL SDK for a fully typed client.
You can also set all tenants for a customer. Unlike the more specific add or remove mutations this is useful if you are sycing tenants and customers with Plain. For this mutation you need the following permissions:
  • customer:edit
  • customerTenantMembership:create
  • customerTenantMembership:delete
Mutation
mutation setCustomerTenants($input: SetCustomerTenantsInput!) {
  setCustomerTenants(input: $input) {
    error {
      message
      type
      code
      fields {
        field
        message
        type
      }
    }
  }
}
Variables
{
  "input": {
    "customerIdentifier": {
      "emailAddress": "jane@aol.com"
    },
    "tenantIdentifiers": [
      {
        "externalId": "team_123"
      },
      {
        "externalId": "team_456"
      }
    ]
  }
}