Create a cohort
curl --request POST \
--url https://api.kintra.io/api/v1/tenant/{tenantId}/cohorts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rules": {
"operator": "and",
"predicates": [
{
"key": "<string>",
"op": "<string>",
"type": "attribute",
"value": "<string>"
}
],
"version": 1
},
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rules: {
operator: 'and',
predicates: [{key: '<string>', op: '<string>', type: 'attribute', value: '<string>'}],
version: 1
},
description: '<string>'
})
};
fetch('https://api.kintra.io/api/v1/tenant/{tenantId}/cohorts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kintra.io/api/v1/tenant/{tenantId}/cohorts"
payload = {
"name": "<string>",
"rules": {
"operator": "and",
"predicates": [
{
"key": "<string>",
"op": "<string>",
"type": "attribute",
"value": "<string>"
}
],
"version": 1
},
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>"
},
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": {
"id": "<string>"
},
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}Cohorts
Create a cohort
Creates a cohort, a saved rule that selects customers by their attribute values. name and rules are required and description is optional. The response data carries the new id. A name already in use returns 409, and a rule document the API cannot read returns 422.
POST
/
tenant
/
{tenantId}
/
cohorts
Create a cohort
curl --request POST \
--url https://api.kintra.io/api/v1/tenant/{tenantId}/cohorts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rules": {
"operator": "and",
"predicates": [
{
"key": "<string>",
"op": "<string>",
"type": "attribute",
"value": "<string>"
}
],
"version": 1
},
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
rules: {
operator: 'and',
predicates: [{key: '<string>', op: '<string>', type: 'attribute', value: '<string>'}],
version: 1
},
description: '<string>'
})
};
fetch('https://api.kintra.io/api/v1/tenant/{tenantId}/cohorts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kintra.io/api/v1/tenant/{tenantId}/cohorts"
payload = {
"name": "<string>",
"rules": {
"operator": "and",
"predicates": [
{
"key": "<string>",
"op": "<string>",
"type": "attribute",
"value": "<string>"
}
],
"version": 1
},
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>"
},
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": {
"id": "<string>"
},
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}{
"success": true,
"data": null,
"errors": [
{
"message": "<string>",
"path": "<string>"
}
],
"message": "<string>"
}Authorizations
Auth0 access token
Path Parameters
Body
application/json
⌘I

