Create test cohort
curl --request POST \
--url https://api.interchange.io/api/v2/buyer/advertisers/{advertiserId}/test-cohorts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "West Coast Treatment Group",
"cohortType": "geographic",
"definition": {
"type": "zip_code"
}
}
'import requests
url = "https://api.interchange.io/api/v2/buyer/advertisers/{advertiserId}/test-cohorts"
payload = {
"name": "West Coast Treatment Group",
"cohortType": "geographic",
"definition": { "type": "zip_code" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'West Coast Treatment Group',
cohortType: 'geographic',
definition: {type: 'zip_code'}
})
};
fetch('https://api.interchange.io/api/v2/buyer/advertisers/{advertiserId}/test-cohorts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"cohort": {
"id": "cohort_abc123",
"advertiserId": "12345",
"name": "West Coast Treatment Group",
"cohortType": "geographic",
"role": "TREATMENT",
"definition": {
"type": "zip_code"
},
"isActive": true,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-20T14:45:00Z",
"description": "<string>",
"estimatedSize": 50000
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Measurement
Create test cohort
Create a new test cohort for measurement.
POST
/
advertisers
/
{advertiserId}
/
test-cohorts
Create test cohort
curl --request POST \
--url https://api.interchange.io/api/v2/buyer/advertisers/{advertiserId}/test-cohorts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "West Coast Treatment Group",
"cohortType": "geographic",
"definition": {
"type": "zip_code"
}
}
'import requests
url = "https://api.interchange.io/api/v2/buyer/advertisers/{advertiserId}/test-cohorts"
payload = {
"name": "West Coast Treatment Group",
"cohortType": "geographic",
"definition": { "type": "zip_code" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'West Coast Treatment Group',
cohortType: 'geographic',
definition: {type: 'zip_code'}
})
};
fetch('https://api.interchange.io/api/v2/buyer/advertisers/{advertiserId}/test-cohorts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"cohort": {
"id": "cohort_abc123",
"advertiserId": "12345",
"name": "West Coast Treatment Group",
"cohortType": "geographic",
"role": "TREATMENT",
"definition": {
"type": "zip_code"
},
"isActive": true,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-20T14:45:00Z",
"description": "<string>",
"estimatedSize": 50000
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Path Parameters
Unique identifier for the advertiser
Minimum string length:
1Example:
"12345"
Body
application/json
Request body for creating a new test cohort
Name of the test cohort
Required string length:
1 - 255Example:
"West Coast Treatment Group"
Type classification for the cohort
Minimum string length:
1Example:
"geographic"
Cohort targeting definition
Show child attributes
Show child attributes
Optional description of the test cohort
Maximum string length:
1000Example:
"Users in CA, OR, WA receiving full ad exposure"
Role of the cohort in the test (default: TREATMENT)
Available options:
TREATMENT, CONTROL, OBSERVATION Estimated number of users in this cohort
Required range:
0 <= x <= 9007199254740991Example:
50000
Response
Create test cohort
Response containing a single test cohort
Test cohort resource representation
Show child attributes
Show child attributes