Audience Quotas
Create or replace a project's quota
Create or replace a project’s quota. Id-preserving: matching group and segment ids keep their progress. The response includes changes and warnings.
PUT
/
v1
/
projects
/
{projectId}
/
quotas
Create or replace a project's quota
curl --request PUT \
--url https://api-staging.respondent.io/v1/projects/{projectId}/quotas \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-api-secret: <x-api-secret>' \
--data '
{
"version": "v2",
"groups": [
{
"name": "<string>",
"segments": [
{
"name": "<string>",
"rule": {
"kind": "group",
"children": [
{
"kind": "condition",
"condition": {
"source": "attribute",
"values": [
"<string>"
]
}
}
]
},
"target": {
"value": 1
},
"id": "<string>"
}
],
"id": "<string>"
}
]
}
'import requests
url = "https://api-staging.respondent.io/v1/projects/{projectId}/quotas"
payload = {
"version": "v2",
"groups": [
{
"name": "<string>",
"segments": [
{
"name": "<string>",
"rule": {
"kind": "group",
"children": [
{
"kind": "condition",
"condition": {
"source": "attribute",
"values": ["<string>"]
}
}
]
},
"target": { "value": 1 },
"id": "<string>"
}
],
"id": "<string>"
}
]
}
headers = {
"x-api-key": "<x-api-key>",
"x-api-secret": "<x-api-secret>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<x-api-key>',
'x-api-secret': '<x-api-secret>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
version: 'v2',
groups: [
{
name: '<string>',
segments: [
{
name: '<string>',
rule: {
kind: 'group',
children: [{kind: 'condition', condition: {source: 'attribute', values: ['<string>']}}]
},
target: {value: 1},
id: '<string>'
}
],
id: '<string>'
}
]
})
};
fetch('https://api-staging.respondent.io/v1/projects/{projectId}/quotas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.respondent.io/v1/projects/{projectId}/quotas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'version' => 'v2',
'groups' => [
[
'name' => '<string>',
'segments' => [
[
'name' => '<string>',
'rule' => [
'kind' => 'group',
'children' => [
[
'kind' => 'condition',
'condition' => [
'source' => 'attribute',
'values' => [
'<string>'
]
]
]
]
],
'target' => [
'value' => 1
],
'id' => '<string>'
]
],
'id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-api-secret: <x-api-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.respondent.io/v1/projects/{projectId}/quotas"
payload := strings.NewReader("{\n \"version\": \"v2\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"segments\": [\n {\n \"name\": \"<string>\",\n \"rule\": {\n \"kind\": \"group\",\n \"children\": [\n {\n \"kind\": \"condition\",\n \"condition\": {\n \"source\": \"attribute\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"target\": {\n \"value\": 1\n },\n \"id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-api-secret", "<x-api-secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-staging.respondent.io/v1/projects/{projectId}/quotas")
.header("x-api-key", "<x-api-key>")
.header("x-api-secret", "<x-api-secret>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"v2\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"segments\": [\n {\n \"name\": \"<string>\",\n \"rule\": {\n \"kind\": \"group\",\n \"children\": [\n {\n \"kind\": \"condition\",\n \"condition\": {\n \"source\": \"attribute\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"target\": {\n \"value\": 1\n },\n \"id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.respondent.io/v1/projects/{projectId}/quotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-api-secret"] = '<x-api-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"v2\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"segments\": [\n {\n \"name\": \"<string>\",\n \"rule\": {\n \"kind\": \"group\",\n \"children\": [\n {\n \"kind\": \"condition\",\n \"condition\": {\n \"source\": \"attribute\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"target\": {\n \"value\": 1\n },\n \"id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"projectId": "<string>",
"version": "v2",
"revision": 123,
"filled": true,
"closed": true,
"groups": [
{
"id": "<string>",
"name": "<string>",
"segments": [
{
"target": {
"op": "min",
"value": 1
},
"progress": {
"pending": 123,
"qualified": 123,
"invited": 123,
"attended": 123,
"externalFills": 123
},
"filled": true,
"closed": true,
"overTarget": true,
"id": "<string>",
"name": "<string>",
"rule": {
"kind": "group",
"connector": "AND",
"children": [
{
"kind": "condition",
"condition": {
"source": "attribute",
"attribute": "gender",
"op": "in",
"values": [
"<string>"
]
}
}
]
}
}
],
"noMatch": {
"target": {
"op": "min",
"value": 1
},
"progress": {
"pending": 123,
"qualified": 123,
"invited": 123,
"attended": 123,
"externalFills": 123
},
"filled": true,
"closed": true,
"overTarget": true
},
"filled": true,
"closed": true,
"minProtected": true
}
],
"changes": {
"created": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
],
"preserved": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
],
"removed": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
],
"rebucketed": 123,
"externalFillsDropped": [
{
"groupId": "<string>",
"segmentId": "<string>",
"count": 123
}
],
"overTarget": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
]
},
"warnings": [
{
"path": "<string>",
"message": "<string>"
}
],
"id": "<string>",
"source": "app",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Path Parameters
Body
application/json
Available options:
v2 Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
- Option 1
- Option 2
Hide child attributes
Hide child attributes
Available options:
group Available options:
AND, OR Hide child attributes
Hide child attributes
Available options:
condition - Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Hide child attributes
Hide child attributes
Available options:
attribute Available options:
gender, ethnicity, country, industry, companySize, seniority, education Available options:
in, notIn Response
200 - application/json
Available options:
v2 Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
- Option 1
- Option 2
Hide child attributes
Hide child attributes
Available options:
group Available options:
AND, OR Hide child attributes
Hide child attributes
Available options:
condition - Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Hide child attributes
Hide child attributes
Available options:
attribute Available options:
gender, ethnicity, country, industry, companySize, seniority, education Available options:
in, notIn Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Available options:
app, api, agent, migration Last modified on September 15, 2026
Was this page helpful?
⌘I
Create or replace a project's quota
curl --request PUT \
--url https://api-staging.respondent.io/v1/projects/{projectId}/quotas \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-api-secret: <x-api-secret>' \
--data '
{
"version": "v2",
"groups": [
{
"name": "<string>",
"segments": [
{
"name": "<string>",
"rule": {
"kind": "group",
"children": [
{
"kind": "condition",
"condition": {
"source": "attribute",
"values": [
"<string>"
]
}
}
]
},
"target": {
"value": 1
},
"id": "<string>"
}
],
"id": "<string>"
}
]
}
'import requests
url = "https://api-staging.respondent.io/v1/projects/{projectId}/quotas"
payload = {
"version": "v2",
"groups": [
{
"name": "<string>",
"segments": [
{
"name": "<string>",
"rule": {
"kind": "group",
"children": [
{
"kind": "condition",
"condition": {
"source": "attribute",
"values": ["<string>"]
}
}
]
},
"target": { "value": 1 },
"id": "<string>"
}
],
"id": "<string>"
}
]
}
headers = {
"x-api-key": "<x-api-key>",
"x-api-secret": "<x-api-secret>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-api-key': '<x-api-key>',
'x-api-secret': '<x-api-secret>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
version: 'v2',
groups: [
{
name: '<string>',
segments: [
{
name: '<string>',
rule: {
kind: 'group',
children: [{kind: 'condition', condition: {source: 'attribute', values: ['<string>']}}]
},
target: {value: 1},
id: '<string>'
}
],
id: '<string>'
}
]
})
};
fetch('https://api-staging.respondent.io/v1/projects/{projectId}/quotas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-staging.respondent.io/v1/projects/{projectId}/quotas",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'version' => 'v2',
'groups' => [
[
'name' => '<string>',
'segments' => [
[
'name' => '<string>',
'rule' => [
'kind' => 'group',
'children' => [
[
'kind' => 'condition',
'condition' => [
'source' => 'attribute',
'values' => [
'<string>'
]
]
]
]
],
'target' => [
'value' => 1
],
'id' => '<string>'
]
],
'id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>",
"x-api-secret: <x-api-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-staging.respondent.io/v1/projects/{projectId}/quotas"
payload := strings.NewReader("{\n \"version\": \"v2\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"segments\": [\n {\n \"name\": \"<string>\",\n \"rule\": {\n \"kind\": \"group\",\n \"children\": [\n {\n \"kind\": \"condition\",\n \"condition\": {\n \"source\": \"attribute\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"target\": {\n \"value\": 1\n },\n \"id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("x-api-secret", "<x-api-secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api-staging.respondent.io/v1/projects/{projectId}/quotas")
.header("x-api-key", "<x-api-key>")
.header("x-api-secret", "<x-api-secret>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"v2\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"segments\": [\n {\n \"name\": \"<string>\",\n \"rule\": {\n \"kind\": \"group\",\n \"children\": [\n {\n \"kind\": \"condition\",\n \"condition\": {\n \"source\": \"attribute\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"target\": {\n \"value\": 1\n },\n \"id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.respondent.io/v1/projects/{projectId}/quotas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-api-secret"] = '<x-api-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"v2\",\n \"groups\": [\n {\n \"name\": \"<string>\",\n \"segments\": [\n {\n \"name\": \"<string>\",\n \"rule\": {\n \"kind\": \"group\",\n \"children\": [\n {\n \"kind\": \"condition\",\n \"condition\": {\n \"source\": \"attribute\",\n \"values\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"target\": {\n \"value\": 1\n },\n \"id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"projectId": "<string>",
"version": "v2",
"revision": 123,
"filled": true,
"closed": true,
"groups": [
{
"id": "<string>",
"name": "<string>",
"segments": [
{
"target": {
"op": "min",
"value": 1
},
"progress": {
"pending": 123,
"qualified": 123,
"invited": 123,
"attended": 123,
"externalFills": 123
},
"filled": true,
"closed": true,
"overTarget": true,
"id": "<string>",
"name": "<string>",
"rule": {
"kind": "group",
"connector": "AND",
"children": [
{
"kind": "condition",
"condition": {
"source": "attribute",
"attribute": "gender",
"op": "in",
"values": [
"<string>"
]
}
}
]
}
}
],
"noMatch": {
"target": {
"op": "min",
"value": 1
},
"progress": {
"pending": 123,
"qualified": 123,
"invited": 123,
"attended": 123,
"externalFills": 123
},
"filled": true,
"closed": true,
"overTarget": true
},
"filled": true,
"closed": true,
"minProtected": true
}
],
"changes": {
"created": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
],
"preserved": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
],
"removed": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
],
"rebucketed": 123,
"externalFillsDropped": [
{
"groupId": "<string>",
"segmentId": "<string>",
"count": 123
}
],
"overTarget": [
{
"groupId": "<string>",
"segmentId": "<string>"
}
]
},
"warnings": [
{
"path": "<string>",
"message": "<string>"
}
],
"id": "<string>",
"source": "app",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}