> ## Documentation Index
> Fetch the complete documentation index at: https://commet.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Seat Management

> Add, remove or set seats with the Commet SDK, with included seats billed at the start of the period and extra seats prorated.

Seats are per-user licenses that let you charge based on team size. Commet tracks seat changes and bills them automatically — included seats at the start of the period, additional seats prorated.

## Seat components

| Component | Description | Example |
| - | - | - |
| **Feature Code** | Category of user license | `editor`, `admin`, `viewer` |
| **Count** | Number of seats to add, remove, or set | `5`, `10`, `50` |
| **Billing** | Seats are billed per unit on the plan | \$25/seat/month |

## Dashboard

Seat features are created in **Features** → **Create Feature** with type **Seats** — the feature's code is what you pass as `featureCode`. Feature codes must be created in the dashboard before use. The **Seats** page shows seat balances and seat events per customer; balances also appear on each customer's subscription detail page.

## Add seats

> [tab] TypeScript
>
> ```typescript theme={null}
> await commet.seats.add({
>   customerId: 'user_123',
>   featureCode: 'editor',
>   count: 5,
> })
> ```

> [tab] Python
>
> ```python theme={null}
> commet.seats.add(
>     feature_code='editor',
>     count=5,
>     customer_id='user_123',
> )
> ```

> [tab] Go
>
> ```go theme={null}
> client.Seats.Add(ctx, &commet.AddSeatsParams{
>     FeatureCode: "editor",
>     Count:       5,
>     CustomerID:  "user_123",
> })
> ```

> [tab] Java
>
> ```java theme={null}
> commet.seats().add("editor", 5, "user_123", null);
> ```

> [tab] PHP
>
> ```php theme={null}
> $commet->seats->add(
>     featureCode: 'editor',
>     count: 5,
>     customerId: 'user_123',
> );
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl -X POST https://commet.co/api/v1/seats \
>   -H "x-api-key: $COMMET_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "customerId": "user_123",
>     "featureCode": "editor",
>     "count": 5
>   }'
> ```

## Remove seats

> [tab] TypeScript
>
> ```typescript theme={null}
> await commet.seats.remove({
>   customerId: 'user_123',
>   featureCode: 'editor',
>   count: 2,
> })
> ```

> [tab] Python
>
> ```python theme={null}
> commet.seats.remove(
>     feature_code='editor',
>     count=2,
>     customer_id='user_123',
> )
> ```

> [tab] Go
>
> ```go theme={null}
> client.Seats.Remove(ctx, &commet.RemoveSeatsParams{
>     FeatureCode: "editor",
>     Count:       2,
>     CustomerID:  "user_123",
> })
> ```

> [tab] Java
>
> ```java theme={null}
> commet.seats().remove("editor", 2, "user_123", null);
> ```

> [tab] PHP
>
> ```php theme={null}
> $commet->seats->remove(
>     featureCode: 'editor',
>     count: 2,
>     customerId: 'user_123',
> );
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl -X DELETE https://commet.co/api/v1/seats \
>   -H "x-api-key: $COMMET_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "customerId": "user_123",
>     "featureCode": "editor",
>     "count": 2
>   }'
> ```

Seats cannot go below zero — removing more than the current count will fail.

## Set exact count

Use `set` when syncing seat counts from your system.

> [tab] TypeScript
>
> ```typescript theme={null}
> await commet.seats.set({
>   customerId: 'user_123',
>   featureCode: 'editor',
>   count: 10,
> })
> ```

> [tab] Python
>
> ```python theme={null}
> commet.seats.set(
>     feature_code='editor',
>     count=10,
>     customer_id='user_123',
> )
> ```

> [tab] Go
>
> ```go theme={null}
> client.Seats.Set(ctx, &commet.SetSeatsParams{
>     FeatureCode: "editor",
>     Count:       10,
>     CustomerID:  "user_123",
> })
> ```

> [tab] Java
>
> ```java theme={null}
> commet.seats().set("editor", 10, "user_123", null);
> ```

> [tab] PHP
>
> ```php theme={null}
> $commet->seats->set(
>     featureCode: 'editor',
>     count: 10,
>     customerId: 'user_123',
> );
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl -X PUT https://commet.co/api/v1/seats \
>   -H "x-api-key: $COMMET_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "customerId": "user_123",
>     "featureCode": "editor",
>     "count": 10
>   }'
> ```

## Set all feature codes

Use `setAll` to sync multiple feature codes at once. Useful when your system tracks all roles and you want a single call to reconcile.

> [tab] TypeScript
>
> ```typescript theme={null}
> await commet.seats.setAll({
>   customerId: 'user_123',
>   seats: { editor: 5, viewer: 20, admin: 2 },
> })
> ```

> [tab] Python
>
> ```python theme={null}
> commet.seats.set_all(
>     seats={'editor': 5, 'viewer': 20, 'admin': 2},
>     customer_id='user_123',
> )
> ```

> [tab] Go
>
> ```go theme={null}
> client.Seats.SetAll(ctx, &commet.BulkSetSeatsParams{
>     Seats:      map[string]int{"editor": 5, "viewer": 20, "admin": 2},
>     CustomerID: "user_123",
> })
> ```

> [tab] Java
>
> ```java theme={null}
> commet.seats().setAll(Map.of("editor", 5, "viewer", 20, "admin", 2), "user_123", null);
> ```

> [tab] PHP
>
> ```php theme={null}
> $commet->seats->setAll(
>     seats: ['editor' => 5, 'viewer' => 20, 'admin' => 2],
>     customerId: 'user_123',
> );
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl -X PUT https://commet.co/api/v1/seats/bulk \
>   -H "x-api-key: $COMMET_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "customerId": "user_123",
>     "seats": { "editor": 5, "viewer": 20, "admin": 2 }
>   }'
> ```

## Get balance

> [tab] TypeScript
>
> ```typescript theme={null}
> const balance = await commet.seats.getBalance({
>   customerId: 'user_123',
>   featureCode: 'editor',
> })
> ```

> [tab] Python
>
> ```python theme={null}
> balance = commet.seats.get_balance(
>     feature_code='editor',
>     customer_id='user_123',
> )
> ```

> [tab] Go
>
> ```go theme={null}
> balance, err := client.Seats.GetBalance(ctx, &commet.GetSeatBalanceParams{
>     FeatureCode: "editor",
>     CustomerID:  "user_123",
> })
> ```

> [tab] Java
>
> ```java theme={null}
> var balance = commet.seats().getBalance("editor", "user_123");
> ```

> [tab] PHP
>
> ```php theme={null}
> $balance = $commet->seats->getBalance(
>     featureCode: 'editor',
>     customerId: 'user_123',
> );
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl "https://commet.co/api/v1/seats/balance?customerId=user_123&featureCode=editor" \
>   -H "x-api-key: $COMMET_API_KEY"
> ```

Pass either a Commet ID (`cus_xxx`) or your external ID as `customerId`. One active subscription per customer is required.

## Get all balances

Returns balances for every feature code on the customer's active subscription.

> [tab] TypeScript
>
> ```typescript theme={null}
> const balances = await commet.seats.getAllBalances({
>   customerId: 'user_123',
> })
> // { editor: { included: 5, used: 3, ... }, viewer: { ... } }
> ```

> [tab] Python
>
> ```python theme={null}
> balances = commet.seats.get_all_balances(
>     customer_id='user_123',
> )
> ```

> [tab] Go
>
> ```go theme={null}
> balances, err := client.Seats.GetAllBalances(ctx, &commet.GetAllSeatBalancesParams{
>     CustomerID: "user_123",
> })
> ```

> [tab] Java
>
> ```java theme={null}
> var balances = commet.seats().getAllBalances("user_123");
> ```

> [tab] PHP
>
> ```php theme={null}
> $balances = $commet->seats->getAllBalances(
>     customerId: 'user_123',
> );
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl "https://commet.co/api/v1/seats/balances?customerId=user_123" \
>   -H "x-api-key: $COMMET_API_KEY"
> ```

## Learn more

* [How Does Seat-Based Billing Work](https://commet.co/docs/how-does-seat-based-billing-work.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.