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

# Update quota cells

> Replace a study's quotas with cells

Replaces every [quota with cells](https://docs.getversive.com/studies/quota-cells.md) of the study. Send the full list you want to keep, with the `id` of each quota you keep; an empty list removes them all. The study quota and question quotas are not affected.

**id** `string` *required*

The study ID.

**groups** `object[]` *required*

Up to 20 quotas, with unique names. Each takes the fields of [Get quota cells](https://docs.getversive.com/api-reference/quotas/get-quota-groups.md):

**properties**

**id** `string`

An existing quota's ID, to keep it (and the Results filters that point at it). Omit for a new quota.

**name** `string` *required*

The quota name.

**action** `string` (default: screen\_out)

`screen_out` or `quota_full`.

**message** `string`

`quota_full` only: what the participant sees when there is no source quota URL or pause URL to send them to (with one, they go straight there). Empty means the screen-out message.

**limit\_mode** `string` (default: count)

`count` or `percent`.

**total** `integer`

Required in `percent` mode.

**variables** `object[]` *required*

One to three variables, each read once per quota. Level names must be different within a variable, a value can only be in one level, and ranges must not overlap. Option texts must be current options of the question, in the study's default language.

**cells** `object[]`

`{ levels, limit, percent }` per capped cell; up to 50 cells per quota. In `count` mode every listed cell needs a `limit`, and `limit` 0 closes the cell. In `percent` mode every listed cell needs a `percent` and no `limit`: the server computes the counts.

### Response

The saved quotas, same shape as [Get quota cells](https://docs.getversive.com/api-reference/quotas/get-quota-groups.md).

Returns `422` when a quota names a question, option, randomizer or arm the study does not have, or breaks a shape rule.

```bash cURL theme={null}
curl -X PUT https://api.getversive.com/api/v1/studies/9b2f7c1e-4a4b-4f6e-9a1d-1c2d3e4f5a6b/quota-groups \
  -H "Authorization: Bearer $VERSIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "groups": [
      {
        "name": "Social media",
        "action": "screen_out",
        "variables": [
          {
            "kind": "choice",
            "question_id": "3f1c2a9e-8d4b-4c7a-9e21-5b6d7c8e9f01",
            "match": "includes",
            "levels": [{ "label": "Social", "values": ["Instagram", "WhatsApp", "Facebook"] }]
          }
        ],
        "cells": [{ "levels": [0], "limit": 50 }]
      }
    ]
  }'
```


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