Create test cohort
curl --request POST \
--url https://api.apostra.com/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.apostra.com/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.apostra.com/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.apostra.com/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.apostra.com/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.apostra.com/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": {}
}
}Path Parameters
Body
application/json
Request body for creating a new test cohort