Create a new cohort definition
Beta
Twilio Cohorts is currently available as a Private Beta product and the information contained in this document is subject to change. You acknowledge and agree that your use of Twilio Cohorts is subject to the terms of the Services in Private Beta. This means that some features are not yet implemented and others may be changed before the product is declared as Generally Available. Private Beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Not a HIPAA Eligible Service or PCI Compliant
Twilio Cohorts is not a HIPAA Eligible Service or PCI compliant and should not be enabled in workflows that are subject to HIPAA or PCI.
POST/preview/Cohorts
Base url: https://audiences.twilio.com (base url)
Creates a new cohort definition.
displayName: Human-readable namestoreType: Type of profile storestoreId: Profile store identifiercriteria: CEL query expression for matching profiles
description: Free-text descriptionlabels: Key-value labels for organizing and filtering cohorts
Rate-limited to 50 requests per minute per account.
Optional
Client-provided idempotency key for safe request retries.
When provided, the server ensures that duplicate requests with the same key produce the same result without executing the operation multiple times.
Requirements:
- Must be a non-empty string (max 128 characters)
- Keys are retained for at least 24 hours
- Scope: Account + Region combination
- If a different payload is sent with the same key, returns 422 Unprocessable Content
If a request is replayed with the same idempotency key, the response will include
the header Idempotent-Replayed: true.
1Max length: 128application/jsonHuman-readable name for the cohort
Active US AdultsMin length: 1Max length: 255Optional
Optional description of the cohort
US-based adults aged 18 and older who have an email addressMax length: 1000Type of profile store
TWILIOPossible values: TWILIOUnique identifier for the profile store
mem_store_01h9d8r0vte3hz8tykdj329t7rPattern: ^mem_store_[a-zA-Z0-9]{26}$Min length: 36Max length: 36A Boolean CEL (Common Expression Language) expression used to filter and select profiles.
profile.trait.Contact.age >= 18 && profile.trait.Contact.country == "US" && has(profile.address.email)Max length: 2000Optional
Labels for organizing and categorizing resources as key-value pairs.
- Maximum of 10 key-value pairs
- Maximum size of a label key is 128 characters
- Maximum size of a label value is 256 characters
- Keys and values must be non-empty and URL-safe: only unreserved characters
(
A-Z,a-z,0-9,-,.,_,~) are allowed. Labels are echoed back in thelabelsquery parameter of the list endpoints, so anything you can store here can also be filtered on. - Keys cannot use the reserved
twilio__prefix
{"environment":"production","campaign":"q1-2026"}Max properties: 10Created - Cohort definition created successfully
Optional
Unique identifier for the cohort following TTID format.
Format: cmp_cohort_{uuidv7-encoded}
cmp_cohort_01h9d8r0vte3hz8tykdj329t7rPattern: ^cmp_cohort_[a-zA-Z0-9]{26}$Max length: 100Optional
Human-readable name for the cohort
Active US AdultsMin length: 1Max length: 255Optional
Optional description of the cohort
US-based adults aged 18 and older who have an email addressMax length: 1000Optional
Unique identifier for the profile store
mem_store_01h9d8r0vte3hz8tykdj329t7rPattern: ^mem_store_[a-zA-Z0-9]{26}$Min length: 36Max length: 36Optional
Type of profile store
TWILIOPossible values: TWILIOOptional
A Boolean CEL (Common Expression Language) expression used to filter and select profiles.
profile.trait.Contact.age >= 18 && profile.trait.Contact.country == "US" && has(profile.address.email)Max length: 2000Optional
Labels for organizing and categorizing resources as key-value pairs.
- Maximum of 10 key-value pairs
- Maximum size of a label key is 128 characters
- Maximum size of a label value is 256 characters
- Keys and values must be non-empty and URL-safe: only unreserved characters
(
A-Z,a-z,0-9,-,.,_,~) are allowed. Labels are echoed back in thelabelsquery parameter of the list endpoints, so anything you can store here can also be filtered on. - Keys cannot use the reserved
twilio__prefix
{"environment":"production","campaign":"q1-2026"}Max properties: 10Optional
Timestamp when the cohort was created
2026-01-15T10:00:00ZOptional
Timestamp when the cohort was last updated
2026-01-15T10:00:00Z1CREATE_COHORT_REQUEST_OBJ=$(cat << EOF2{3"displayName": "Active US Adults",4"storeType": "TWILIO",5"storeId": "mem_store_01h9d8r0vte3hz8tykdj329t7r",6"criteria": "profile.trait.Contact.age >= 18 && profile.trait.Contact.country == \"US\" && has(profile.address.email)"7}8EOF9)10curl -X POST "https://audiences.twilio.com/preview/Cohorts" \11--json "$CREATE_COHORT_REQUEST_OBJ" \12-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
Response
1{2"id": "cmp_cohort_01h9d8r0vte3hz8tykdj329t7r",3"displayName": "Active US Adults",4"description": "US-based adults aged 18 and older who have an email address",5"storeType": "TWILIO",6"storeId": "mem_store_01h9d8r0vte3hz8tykdj329t7r",7"criteria": "profile.trait.Contact.age >= 18 && profile.trait.Contact.country == \"US\" && has(profile.address.email)",8"labels": {9"environment": "production",10"campaign": "q1-2026"11},12"createdAt": "2026-01-15T10:00:00Z",13"updatedAt": "2026-01-15T10:00:00Z"14}