Update quota

Update Quota

Update an existing segmented quota on a survey. All parameters are optional — send only the fields you want to change.

Note: The Quotas object is designed for use with Segmented Quotas only. To manage an Overall Quota, use the Survey Object with the options[overall_quota] parameter.

Endpoint

POST /v5/survey/{survey_id}/quotas/{quota_id}

Authentication is required for all requests. See Authentication.

Path Parameters

survey_id
integer
required
The ID of the survey that contains the quota.
quota_id
integer
required
The ID of the quota to update.

Request Body

name
string
A new name for the quota.
limit
integer
A new response limit for the quota.
description
string
A new description for the quota.
distributed
boolean
Set to true to change to a distributed (percentage-based) quota, or false to revert to a standard quota.
groups
string
URL-encoded JSON array of updated logic rule groups. When updating existing groups and rules, you must include their id values (returned by Get Quota) to modify them in place. Groups or rules without an id will be created as new. See Create Quota for the full groups structure reference.

Updating existing rules: Include both the group id and the rule id to update an existing rule in-place. If you omit the id values, new groups and rules will be created instead.

Response

Note: Quota fields are returned at the top level of the response, not nested under a data key.

result_ok
boolean
Returns true if the quota was updated successfully.
id
string
The ID of the updated quota.
name
string
The name of the quota.
description
string
The description of the quota.
limit
string
The response limit for this quota.
responses
string
The current number of responses counted toward this quota.
distributed
string
Whether this is a distributed quota. Returns "true" or "false".
groups
array
The updated groups, each with their id values.

Examples

Request — update name and limit
curl -X POST "https://api.alchemer.com/v5/survey/123456/quotas/1?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET" \
  --data-urlencode "name=Updated Quota Name" \
  --data-urlencode "limit=200"
Request — update an existing rule (group and rule IDs required)
curl -X POST "https://api.alchemer.com/v5/survey/123456/quotas/1?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET" \
  --data-urlencode 'groups=[{"id":"64a1bc2e3f001","rules":[{"id":"64a1bc2e3f002","input_value":"26","operator":"12","answers_type":"17","answers_values":["26-10021"]}]}]'
Response
{
  "result_ok": true,
  "id": "1",
  "name": "Updated Quota Name",
  "description": "Limit responses from East Coast states",
  "limit": "200",
  "responses": "42",
  "distributed": "false",
  "groups": [
    {
      "id": "64a1bc2e3f001",
      "rules": [
        {
          "id": "64a1bc2e3f002",
          "input_value": "26",
          "operator": "12",
          "answers_type": "17",
          "answers_values": ["26-10021"]
        }
      ]
    }
  ]
}